PixelSpace

public sealed class PixelSpace
Provides fast mapping between pixel coordinates and bitnap array offsets.

Constructors

PixelSpace

#
public PixelSpace(BitmapData data)
Constuct a new coordinate mapper.
data (BitmapData)Data to construct from.

Properties

Height

#
public int Height { get; }
Gets the height of the bitmap (in pixels).

LineSize

#
public int LineSize { get; }
Gets the number of bytes for every line in the bitmap.

PixelSize

#
public int PixelSize { get; }
Gets the number of bytes per pixel.

Width

#
public int Width { get; }
Gets the width of the bitmap (in pixels).

Methods

IndexCoordinates

#
public void IndexCoordinates(int index, out int x, out int y)
Gets the pixel coordinates associated with the specific byte offset. This function does not perform any bounds checking.
index (int)Index to offset.
x (out int)Associated x coordinate.
y (out int)Associated y coordinate.

Offset

#
public int Offset(int x, int y)
Gets the byte offset for the given x, y coordinate. This function does not perform any bounds checking.
x (int)X coordinate.
y (int)Y coordinate.
Offset. Number of bytes from the bitmap data start.