Public Member Functions | |
| PixelBuffer (PixelFormat format, Size size) | |
| Constructs a PixelBuffer object. | |
| PixelBuffer (PixelFormat format, Size size, byte[] data) | |
| Constructs a PixelBuffer object. Data passed is not copied; it is referenced. | |
| PixelBuffer (PixelFormat format, Size size, byte[] data, PixelFormat dataFormat) | |
| Constructs a PixelBuffer object. This overload performs automatic conversion of the data passed to match the format specified for the pixel buffer. The data is always copied in memory, even if it is of the same type as the format parameter. | |
| PixelBuffer (PixelFormat format, Size size, byte[] data, bool copyData) | |
| Constructs a PixelBuffer object. This overload allows you to specify whether or not the data parameter should be copied. | |
| PixelBuffer (PixelFormat format, Size size, IntPtr data, PixelFormat sourceFormat, int srcRowStride) | |
| Constructs a PixelBuffer object. Copies data from an unmanaged memory location in the specified format. | |
| PixelBuffer (PixelBuffer buffer, Rectangle srcRect) | |
| Constructs a PixelBuffer object, taking image data from a preexisting pixel buffer. | |
| bool | IsBlank () |
| Checks to see if this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent. | |
| bool | IsBlank (double alphaTolerance) |
| Checks to see if this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly. | |
| bool | IsRegionBlank (Rectangle rectangle) |
| Checks to see if this region of the pixelbuffer only contains transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent. | |
| bool | IsRegionBlank (Rectangle rectangle, double alphaTolerance) |
| Returns true if all pixels within the passed rectangle are below the passed alpha tolerance value. | |
| bool | IsRowBlank (int row) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent. | |
| bool | IsRowBlank (int row, double alphaTolerance) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly. | |
| bool | IsRowBlank (int row, int left, int width) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. | |
| bool | IsRowBlank (int row, int left, int width, double alphaTolerance) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly. | |
| bool | IsColumnBlank (int col) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent. | |
| bool | IsColumnBlank (int col, double alphaTolerance) |
| Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly. | |
| bool | IsColumnBlank (int col, int top, int height) |
| Checks to see if a portion of the selected row of this PixelBuffer contains only transparent pixels. | |
| bool | IsColumnBlank (int col, int top, int height, double alphaTolerance) |
| Checks to see if a portion of the selected row of this PixelBuffer contains only transparent pixels. | |
| void | CopyFrom (PixelBuffer buffer, Rectangle srcRect, Point destPt, bool clip) |
| Copies pixel data from the specified PixelBuffer. | |
| int | GetPixelIndex (int x, int y) |
| Gets the index of the first byte in the pixel in the Data array at the specified point. | |
| bool | IsPointValid (int x, int y) |
| Returns true if the specified point is within the pixel buffer. | |
| bool | IsPointValid (Point pt) |
| Returns true if the specified point is within the pixel buffer. | |
| Color | GetPixel (int x, int y) |
| Copies pixel data from the specified location to a Color structure. | |
| void | SetPixel (int x, int y, Color clr) |
| Sets the color at a particular pixel. | |
| void | SetData (byte[] srcData, PixelFormat srcFormat) |
| Copies the data from the array passed in into the internal pixel buffer array. Automatic conversion is performed if the format the data is in (indicated by format parameter) differs from the format the pixel buffer is in. | |
| void | SetData (IntPtr data, PixelFormat srcFormat, int srcRowStride) |
| Copies the data from the unmanaged memory pointer passed in into the internal pixel buffer array. Automatic conversion is performed if the format the data is in (indicated by format parameter) differs from the format the pixel buffer is in. | |
| PixelBuffer | ConvertTo (PixelFormat pixelFormat) |
| Creates a new PixelBuffer and copies the data in this PixelBuffer, performing automatic conversion. | |
| PixelBuffer | ConvertTo (PixelFormat pixelFormat, Size mTextureSize) |
| Creates a new PixelBuffer of the specified size, with the data in this PixelBuffer copied to the upper left corner. | |
| PixelBuffer | ConvertTo (PixelFormat pixelFormat, Size mTextureSize, Point point) |
| Creates a new PixelBuffer of the specified size, with the data in this PixelBuffer copied so that the upper left corner is specified by point. | |
| void | SaveTo (string filename, ImageFileFormat format) |
| Saves the data in the PixelBuffer for to an image file. | |
| void | ReplaceColor (Color searchColor, Color newColor) |
| Replaces all instances of the specified color. | |
Static Public Member Functions | |
| static PixelBuffer | FromFile (string file) |
| Loads image data from a file and returns a PixelBuffer. | |
| static void | ConvertPixel (byte[] dest, int destIndex, PixelFormat destFormat, byte[] src, int srcIndex, PixelFormat srcFormat) |
| Converts a single pixel in the specified format at the specified location from the source array and writes it to the specified location in the destination array. | |
| static int | GetPixelStride (PixelFormat format) |
| Returns the number of bytes in memory used by a single pixel in the specified format. | |
| static bool | FormatHasAlpha (PixelFormat format) |
| Returns true if the specified PixelFormat contains an alpha channel. | |
Properties | |
| PixelFormat | PixelFormat [get] |
| Gets the format of the pixel data. | |
| byte[] | Data [get, set] |
| Gets or sets the raw pixel data, in the format indicated by PixelFormat. An exception is thrown when setting Data if the length of the array passed is not Width * Height * PixelStride. | |
| int | PixelStride [get] |
| Gets how many bytes each pixel takes up in memory. | |
| int | Height [get] |
| Returns the height in pixels of the buffer. | |
| int | Width [get] |
| Returns the width in pixels of the buffer. | |
| Size | Size [get] |
| Returns the size (width, height) in pixels of the buffer. | |
| int | RowStride [get] |
| Returns how many bytes a single row takes up. This value can be used to increase an index to go from one line of pixels to the next. | |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelFormat | format, | |
| Size | size | |||
| ) |
Constructs a PixelBuffer object.
| size | The size of the image data in pixels. | |
| format | The raw data format of the pixels to be contained in the pixel buffer. PixelFormat.Any is not a valid parameter. |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelFormat | format, | |
| Size | size, | |||
| byte[] | data | |||
| ) |
Constructs a PixelBuffer object. Data passed is not copied; it is referenced.
| size | The size of the image data in pixels. | |
| format | The raw data format of the pixels to be contained in the pixel buffer. PixelFormat.Any is not a valid parameter. | |
| data | Raw pixel data. It must be the correct size for the format passed. This data will not be copied; it will be referenced. |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelFormat | format, | |
| Size | size, | |||
| byte[] | data, | |||
| PixelFormat | dataFormat | |||
| ) |
Constructs a PixelBuffer object. This overload performs automatic conversion of the data passed to match the format specified for the pixel buffer. The data is always copied in memory, even if it is of the same type as the format parameter.
| size | The size of the image data in pixels. | |
| format | The raw data format of the pixels to be contained in the pixel buffer. PixelFormat.Any is not a valid parameter. | |
| data | Raw pixel data. It must be the correct size for the format passed. | |
| dataFormat | Format of the raw pixel data. This data will be copied into the PixelBuffer. |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelFormat | format, | |
| Size | size, | |||
| byte[] | data, | |||
| bool | copyData | |||
| ) |
Constructs a PixelBuffer object. This overload allows you to specify whether or not the data parameter should be copied.
| size | The size of the image data in pixels. | |
| format | The raw data format of the pixels to be contained in the pixel buffer. PixelFormat.Any is not a valid parameter. | |
| data | Raw pixel data. It must be the correct size for the format passed. | |
| copyData | True if the data should be copied into the pixel buffer. |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelFormat | format, | |
| Size | size, | |||
| IntPtr | data, | |||
| PixelFormat | sourceFormat, | |||
| int | srcRowStride | |||
| ) |
Constructs a PixelBuffer object. Copies data from an unmanaged memory location in the specified format.
| format | The format the pixel buffer should be stored in. | |
| size | The size (width and height) in pixels the pixel buffer should contain. | |
| data | Pointer to an unmanaged memory location which contains the pixel data. This data must be the same size in pixels as the size parameter. | |
| sourceFormat | The pixelformat of the source data. | |
| srcRowStride | The number of bytes from the beginning of one row to the next. |
| AgateLib.DisplayLib.PixelBuffer.PixelBuffer | ( | PixelBuffer | buffer, | |
| Rectangle | srcRect | |||
| ) |
Constructs a PixelBuffer object, taking image data from a preexisting pixel buffer.
| buffer | The PixelBuffer object to copy image data from. | |
| srcRect | The source rectangle in the buffer to copy image data from. |
| static void AgateLib.DisplayLib.PixelBuffer.ConvertPixel | ( | byte[] | dest, | |
| int | destIndex, | |||
| PixelFormat | destFormat, | |||
| byte[] | src, | |||
| int | srcIndex, | |||
| PixelFormat | srcFormat | |||
| ) | [static] |
Converts a single pixel in the specified format at the specified location from the source array and writes it to the specified location in the destination array.
| dest | Destination array to write to. | |
| destIndex | Index in destination array to begin writing. | |
| destFormat | Pixel format to use when writing to destination array. | |
| src | Source array to read pixel data from | |
| srcIndex | Index in source array where pixel data should be read from. | |
| srcFormat | The format of the pixel data in the source array. |
| PixelBuffer AgateLib.DisplayLib.PixelBuffer.ConvertTo | ( | PixelFormat | pixelFormat, | |
| Size | mTextureSize, | |||
| Point | point | |||
| ) |
Creates a new PixelBuffer of the specified size, with the data in this PixelBuffer copied so that the upper left corner is specified by point.
| pixelFormat | PixelFormat that the newly created PixelBuffer should have. | |
| mTextureSize | ||
| point |
| PixelBuffer AgateLib.DisplayLib.PixelBuffer.ConvertTo | ( | PixelFormat | pixelFormat, | |
| Size | mTextureSize | |||
| ) |
Creates a new PixelBuffer of the specified size, with the data in this PixelBuffer copied to the upper left corner.
| pixelFormat | PixelFormat that the newly created PixelBuffer should have. | |
| mTextureSize |
| PixelBuffer AgateLib.DisplayLib.PixelBuffer.ConvertTo | ( | PixelFormat | pixelFormat | ) |
Creates a new PixelBuffer and copies the data in this PixelBuffer, performing automatic conversion.
| pixelFormat | PixelFormat that the newly created PixelBuffer should have. |
| void AgateLib.DisplayLib.PixelBuffer.CopyFrom | ( | PixelBuffer | buffer, | |
| Rectangle | srcRect, | |||
| Point | destPt, | |||
| bool | clip | |||
| ) |
Copies pixel data from the specified PixelBuffer.
| buffer | The pixel buffer to copy from. | |
| srcRect | ||
| destPt | ||
| clip | If true, the copied region will automatically be clipped. If false, this method will throw an exception if the area being copied to is out of range. |
| static bool AgateLib.DisplayLib.PixelBuffer.FormatHasAlpha | ( | PixelFormat | format | ) | [static] |
Returns true if the specified PixelFormat contains an alpha channel.
| format |
| static PixelBuffer AgateLib.DisplayLib.PixelBuffer.FromFile | ( | string | file | ) | [static] |
| Color AgateLib.DisplayLib.PixelBuffer.GetPixel | ( | int | x, | |
| int | y | |||
| ) |
Copies pixel data from the specified location to a Color structure.
| x | ||
| y |
| int AgateLib.DisplayLib.PixelBuffer.GetPixelIndex | ( | int | x, | |
| int | y | |||
| ) |
Gets the index of the first byte in the pixel in the Data array at the specified point.
| x | ||
| y |
| static int AgateLib.DisplayLib.PixelBuffer.GetPixelStride | ( | PixelFormat | format | ) | [static] |
Returns the number of bytes in memory used by a single pixel in the specified format.
| format | Which format to look up. |
| bool AgateLib.DisplayLib.PixelBuffer.IsBlank | ( | double | alphaTolerance | ) |
Checks to see if this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly.
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsBlank | ( | ) |
Checks to see if this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent.
| bool AgateLib.DisplayLib.PixelBuffer.IsColumnBlank | ( | int | col, | |
| int | top, | |||
| int | height, | |||
| double | alphaTolerance | |||
| ) |
Checks to see if a portion of the selected row of this PixelBuffer contains only transparent pixels.
| col | ||
| top | ||
| height | ||
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsColumnBlank | ( | int | col, | |
| int | top, | |||
| int | height | |||
| ) |
Checks to see if a portion of the selected row of this PixelBuffer contains only transparent pixels.
| col | ||
| top | ||
| height |
| bool AgateLib.DisplayLib.PixelBuffer.IsColumnBlank | ( | int | col, | |
| double | alphaTolerance | |||
| ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly.
| col | ||
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsColumnBlank | ( | int | col | ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent.
| col |
| bool AgateLib.DisplayLib.PixelBuffer.IsPointValid | ( | Point | pt | ) |
Returns true if the specified point is within the pixel buffer.
| pt |
| bool AgateLib.DisplayLib.PixelBuffer.IsPointValid | ( | int | x, | |
| int | y | |||
| ) |
Returns true if the specified point is within the pixel buffer.
| x | ||
| y |
| bool AgateLib.DisplayLib.PixelBuffer.IsRegionBlank | ( | Rectangle | rectangle, | |
| double | alphaTolerance | |||
| ) |
Returns true if all pixels within the passed rectangle are below the passed alpha tolerance value.
| rectangle | ||
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsRegionBlank | ( | Rectangle | rectangle | ) |
Checks to see if this region of the pixelbuffer only contains transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent.
| rectangle |
| bool AgateLib.DisplayLib.PixelBuffer.IsRowBlank | ( | int | row, | |
| int | left, | |||
| int | width, | |||
| double | alphaTolerance | |||
| ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly.
| row | ||
| left | ||
| width | ||
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsRowBlank | ( | int | row, | |
| int | left, | |||
| int | width | |||
| ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels.
| row | ||
| left | ||
| width |
| bool AgateLib.DisplayLib.PixelBuffer.IsRowBlank | ( | int | row, | |
| double | alphaTolerance | |||
| ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels. This overload allows the alpha tolerance to be specified explicitly.
| row | ||
| alphaTolerance |
| bool AgateLib.DisplayLib.PixelBuffer.IsRowBlank | ( | int | row | ) |
Checks to see if the selected row of this PixelBuffer contains only transparent pixels. Pixels with an alpha value of less than Display.AlphaThreshold are considered transparent.
| row |
Replaces all instances of the specified color.
| searchColor | The color to replace. | |
| newColor | The new color to overwrite searchColor. |
| void AgateLib.DisplayLib.PixelBuffer.SaveTo | ( | string | filename, | |
| ImageFileFormat | format | |||
| ) |
| void AgateLib.DisplayLib.PixelBuffer.SetData | ( | IntPtr | data, | |
| PixelFormat | srcFormat, | |||
| int | srcRowStride | |||
| ) |
Copies the data from the unmanaged memory pointer passed in into the internal pixel buffer array. Automatic conversion is performed if the format the data is in (indicated by format parameter) differs from the format the pixel buffer is in.
| data | ||
| srcFormat | ||
| srcRowStride |
| void AgateLib.DisplayLib.PixelBuffer.SetData | ( | byte[] | srcData, | |
| PixelFormat | srcFormat | |||
| ) |
Copies the data from the array passed in into the internal pixel buffer array. Automatic conversion is performed if the format the data is in (indicated by format parameter) differs from the format the pixel buffer is in.
| data | ||
| srcFormat |
| void AgateLib.DisplayLib.PixelBuffer.SetPixel | ( | int | x, | |
| int | y, | |||
| Color | clr | |||
| ) |
Sets the color at a particular pixel.
| x | ||
| y | ||
| clr |
byte [] AgateLib.DisplayLib.PixelBuffer.Data [get, set] |
Gets or sets the raw pixel data, in the format indicated by PixelFormat. An exception is thrown when setting Data if the length of the array passed is not Width * Height * PixelStride.
The data is not copied when set, it is only referenced, so changes to the array that is passed in will affect the data in the pixel buffer. It is assumed that the data passed in is of the same format as the pixel buffer. If you wish to copy data use the SetData method.
int AgateLib.DisplayLib.PixelBuffer.Height [get] |
Returns the height in pixels of the buffer.
PixelFormat AgateLib.DisplayLib.PixelBuffer.PixelFormat [get] |
Gets the format of the pixel data.
int AgateLib.DisplayLib.PixelBuffer.PixelStride [get] |
Gets how many bytes each pixel takes up in memory.
int AgateLib.DisplayLib.PixelBuffer.RowStride [get] |
Returns how many bytes a single row takes up. This value can be used to increase an index to go from one line of pixels to the next.
Size AgateLib.DisplayLib.PixelBuffer.Size [get] |
Returns the size (width, height) in pixels of the buffer.
int AgateLib.DisplayLib.PixelBuffer.Width [get] |
Returns the width in pixels of the buffer.
|
AgateLib Awesome Game and Tool Engine Library |
|