DecodedImage

class DecodedImage

Decoded in-memory image. Owns the pixel buffer via std::vector.

Methods

DecodedImage::DecodedImage() = default

Default constructor — empty image.

DecodedImage::DecodedImage(unsigned char const *png_data, size_t png_size)

Construct by decoding a PNG blob from memory. On failure, pixels is empty and dimensions are zero.

Parameters

png_data: Pointer to the PNG file bytes.

png_size: Number of bytes in png_data.

DecodedImage::~DecodedImage() = default
bool DecodedImage::IsValid() const

const

Returns

true if the image was decoded successfully.
DecodedImage::DecodedImage(DecodedImage const&) = delete
DecodedImage &DecodedImage::operator=(DecodedImage const&) = delete
DecodedImage::DecodedImage(DecodedImage&&) = default
DecodedImage &DecodedImage::operator=(DecodedImage&&) = default

Variables

std::vector<unsigned char> DecodedImage::pixels
std::vector< unsigned char >

Pixel data. Empty on failure.

unsigned int DecodedImage::width
unsigned int

Image width in pixels.

unsigned int DecodedImage::height
unsigned int

Image height in pixels.

int DecodedImage::channels
int

Bytes per pixel: 1 = grayscale, 3 = RGB, 4 = RGBA.