nCine::PngImage struct

An image as PngCodec::Decode() reads and PngCodec::Encode() writes it.

Either palette indices, a byte per pixel, with the palette, or RGBA, four bytes per pixel. Colors of the palette are R | G << 8 | B << 16 | A << 24, as the palettes of the game have them; the entries the file doesn't list are zero, transparent black.

Public functions

void Create(std::int32_t width, std::int32_t height, bool indexed)
Makes an empty image of a size, all of its pixels zero.
auto GetColor(std::int32_t x, std::int32_t y) const -> std::uint32_t
Returns the color of a pixel as RGBA, an indexed one from the palette.

Public variables

std::int32_t Width
Width in pixels.
std::int32_t Height
Height in pixels.
bool Indexed
Whether the pixels are palette indices instead of RGBA.
Death::Containers::SmallVector<std::uint8_t, 0> Pixels
Pixels row by row.
std::uint32_t Palette
Colors of the palette, only of an indexed image.
std::int32_t PaletteSize
Number of colors of the palette.