validateImageData

Checks if the data for the image is valid.

@safe nothrow pure
bool
validateImageData
(
int format
)
(
ubyte[] data
,
uint w
,
uint h
)

Parameters

format

Pixel format.

data ubyte[]

Image data (in fact, it only learns the length from it).

w uint

Image width.

h uint

Image height.

Examples

Let's check the performance:

immutable simpleImageWidth  = 32;
immutable simpleImageHeight = 32;
ubyte[] data = new ubyte[](simpleImageWidth * simpleImageHeight * bytesPerColor!(PixelFormat.RGBA));

assert(validateImageData!(PixelFormat.RGBA)(data, simpleImageWidth, simpleImageHeight));

Meta