libghostty
Loading...
Searching...
No Matches
GhosttySysImage Struct Reference

#include <ghostty/vt/sys.h>

Data Fields

uint32_t width
uint32_t height
uint8_t * data
size_t data_len

Detailed Description

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.

Examples
c-vt-kitty-graphics/src/main.c.

Definition at line 58 of file sys.h.

Field Documentation

◆ data

uint8_t* data

The decoded RGBA pixels, allocated with the allocator passed to the decode callback.

Examples
c-vt-kitty-graphics/src/main.c.

Definition at line 69 of file sys.h.

◆ data_len

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.

Examples
c-vt-kitty-graphics/src/main.c.

Definition at line 76 of file sys.h.

◆ height

uint32_t height

Image height in pixels.

Examples
c-vt-kitty-graphics/src/main.c.

Definition at line 63 of file sys.h.

◆ width

uint32_t width

Image width in pixels.

Examples
c-vt-kitty-graphics/src/main.c.

Definition at line 60 of file sys.h.


The documentation for this struct was generated from the following file: