class PixelDataEx

Extension class for PixelData, for adding additional functionality for the script version of PixelData.

Public

Methods

staticCreate

static SPtr<PixelData> Create(const PixelVolume &volume, PixelFormat format = PF_BGRA8)

staticCreate

static SPtr<PixelData> Create(u32 width, u32 height, u32 depth = 1, PixelFormat pixelFormat = PF_BGRA8)

staticGetPixel

static Color GetPixel(const SPtr<PixelData> &thisPtr, int x, int y, int z = 0)

Returns a pixel at the specified location in the buffer.

x
X coordinate of the pixel.
y
Y coordinate of the pixel.
z
Z coordinate of the pixel.

Returns: Value of the pixel, or undefined value if coordinates are out of range.

staticSetPixel

static void SetPixel(const SPtr<PixelData> &thisPtr, const Color &value, int x, int y, int z = 0)

Sets a pixel at the specified location in the buffer.

value
Color of the pixel to set.
x
X coordinate of the pixel.
y
Y coordinate of the pixel.
z
Z coordinate of the pixel.

staticGetPixels

static Vector<Color> GetPixels(const SPtr<PixelData> &thisPtr)

Returns values of all pixels.

Returns: All pixels in the buffer ordered consecutively. Pixels are stored as a succession of "depth" slices, each containing "height" rows of "width" pixels.

staticSetPixels

static void SetPixels(const SPtr<PixelData> &thisPtr, const Vector<Color> &value)

Sets all pixels in the buffer.Caller must ensure that number of pixels match the extends of the buffer.

value
All pixels in the buffer ordered consecutively. Pixels are stored as a succession of "depth" slices, each containing "height" rows of "width" pixels.

staticGetRawPixels

static Vector<char> GetRawPixels(const SPtr<PixelData> &thisPtr)

Returns all pixels in the buffer as raw bytes.

Returns: Raw pixel bytes. It is up to the caller to interpret the pixel format and account for potential row and slice pitch values.

staticSetRawPixels

static void SetRawPixels(const SPtr<PixelData> &thisPtr, const Vector<char> &value)

Sets all pixels in the buffer as raw bytes.

value
Raw pixel bytes. It is up to the caller to interpret the pixel format and account for potential row and slice pitch values.

staticCheckIsLocked

static bool CheckIsLocked(const SPtr<PixelData> &thisPtr)