![]() |
libghostty
|
#include <ghostty/vt/sys.h>
Data Fields | |
| uint32_t | width |
| uint32_t | height |
| uint8_t * | data |
| size_t | data_len |
A decoded image, filled in by a decode callback such as GhosttySysDecodePngFn.
Pixels are 8-bit RGBA: four bytes per pixel, stored row by row starting at the top-left corner, with no padding between rows. A complete image is therefore width * height * 4 bytes long.
The pixel buffer must be allocated with the allocator passed to the decode callback. When the callback returns true, the library takes ownership of the buffer and frees it with that same allocator.
| uint8_t* data |
The decoded RGBA pixels, allocated with the allocator passed to the decode callback.
| size_t data_len |
Length of data in bytes. This must be the exact size that was requested from the allocator, because the library uses it to free the buffer.
| uint32_t height |
Image height in pixels.
| uint32_t width |