IImageProcessingFactory

interface IImageProcessingFactory : IGenerateFactory

A factory which instantiates objects for image processing.

ImageSourceFromRGBAArray CreateImageSource(System.Func<Byte[]> getRGBAArray, System.Func<Int32> getWidth)

Creates an image source from a callback that returns an RGBA array and an image width. This is the fastest kind of image source for image analysis.

Parameters:
  • getRGBAArray (System.Func<Byte[]>) – The callback which returns an array of RGBA values.
  • getWidth (System.Func<Int32>) – The callback which returns the width of the image.
Returns:

An image source which can be used in image analysis.

ImageSourceFromTexture CreateImageSource(System.Func<Texture2D> getTexture2D)

Creates an image source from an in-memory texture.

Parameters:
  • getTexture2D (System.Func<Texture2D>) – The callback which returns the texture.
Returns:

An image source which can be used in image analysis.

IColorInImageDetection CreateColorInImageDetection(IImageSource source)

Creates an object which can be used for detecting colors in an image. This functionality is useful for augmented reality, where you need to detect specific colored markers in an environment.

Parameters:
  • source (Protogame.IImageSource) – The image source to detect color in.
Returns:

The color detection object.

Protogame.IPointInAnalysedImageDetection CreatePointInAnalysedImageDetection(IColorInImageDetection colorInImageDetection, Protogame.ISelectedColorHandle selectedColorHandle)

Creates an object which can be used for converting detected colors in an image into a series of discrete points.

Parameters:
  • colorInImageDetection (Protogame.IColorInImageDetection) – The color detection object.
  • selectedColorHandle (Protogame.ISelectedColorHandle) – The color to detect points with.
Returns: