Struct Image

Struct Documentation

struct Image

Decoded image representation.

Public Types

enum class Layout : uint8_t

Possible channel layout in of data buffer.

Values:

enumerator Grayscale

One channel.

enumerator RGB

Three channels (RGB order)

enumerator RGBA

Four channels (RGBA order)

enum class Format

Supported formats.

Values:

enumerator PNG

PNG.

enumerator JPEG

JPEG.

enumerator WebP

WebP.

enumerator TGA

TGA (Targa)

enumerator TIFF

TIFF.

Public Members

unsigned int w

Width of image in pixels.

unsigned int h

Height of image in pixels.

enum libcacaoimage::Image::Layout layout

Layout of data buffer.

uint8_t bitsPerChannel

How many bits are in each image channel (only 8 or 16)

std::vector<unsigned char> data

Image buffer.

enum libcacaoimage::Image::Format format

Original encoded format (set by decoder functions, useful for decoding and re-encoding)

int quality

0-100, image quality for encoding in supported formats

bool lossy

Whether to use lossy compression when encoding in supported formats.