libghostty
Loading...
Searching...
No Matches
kitty_graphics.h
Go to the documentation of this file.
1
8
9#ifndef GHOSTTY_VT_KITTY_GRAPHICS_H
10#define GHOSTTY_VT_KITTY_GRAPHICS_H
11
12#include <stdbool.h>
13#include <stdint.h>
16#include <ghostty/vt/types.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
104
110typedef enum GHOSTTY_ENUM_TYPED {
113
122 GHOSTTY_KITTY_GRAPHICS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
124
130typedef enum GHOSTTY_ENUM_TYPED {
133
140
147
154
161
168
175
182
189
196
203
210
217
218 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
220
232typedef enum GHOSTTY_ENUM_TYPED {
233 GHOSTTY_KITTY_PLACEMENT_LAYER_ALL = 0,
234 GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_BG = 1,
235 GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_TEXT = 2,
236 GHOSTTY_KITTY_PLACEMENT_LAYER_ABOVE_TEXT = 3,
237 GHOSTTY_KITTY_PLACEMENT_LAYER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
239
245typedef enum GHOSTTY_ENUM_TYPED {
252 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
254
260typedef enum GHOSTTY_ENUM_TYPED {
261 GHOSTTY_KITTY_IMAGE_FORMAT_RGB = 0,
262 GHOSTTY_KITTY_IMAGE_FORMAT_RGBA = 1,
263 GHOSTTY_KITTY_IMAGE_FORMAT_PNG = 2,
264 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY_ALPHA = 3,
265 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY = 4,
266 GHOSTTY_KITTY_IMAGE_FORMAT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
268
274typedef enum GHOSTTY_ENUM_TYPED {
275 GHOSTTY_KITTY_IMAGE_COMPRESSION_NONE = 0,
276 GHOSTTY_KITTY_IMAGE_COMPRESSION_ZLIB_DEFLATE = 1,
277 GHOSTTY_KITTY_IMAGE_COMPRESSION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
279
285typedef enum GHOSTTY_ENUM_TYPED {
288
295
302
309
316
323
330
338
345
346 GHOSTTY_KITTY_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
348
366typedef struct {
368 size_t size;
370 uint32_t pixel_width;
372 uint32_t pixel_height;
374 uint32_t grid_cols;
376 uint32_t grid_rows;
384 uint32_t source_x;
386 uint32_t source_y;
388 uint32_t source_width;
392
409 GhosttyKittyGraphics graphics,
411 void* out);
412
426 GhosttyKittyGraphics graphics,
427 uint32_t image_id);
428
445 void* out);
446
476 size_t count,
478 void** values,
479 size_t* out_written);
480
496 const GhosttyAllocator* allocator,
498
508
530 const void* value);
531
546
564 void* out);
565
595 size_t count,
597 void** values,
598 size_t* out_written);
599
621 GhosttyTerminal terminal,
622 GhosttySelection* out_selection);
623
645 GhosttyTerminal terminal,
646 uint32_t* out_width,
647 uint32_t* out_height);
648
671 GhosttyTerminal terminal,
672 uint32_t* out_cols,
673 uint32_t* out_rows);
674
713 GhosttyTerminal terminal,
714 int32_t* out_col,
715 int32_t* out_row);
716
739 uint32_t* out_x,
740 uint32_t* out_y,
741 uint32_t* out_width,
742 uint32_t* out_height);
743
766 GhosttyTerminal terminal,
768
770
771#ifdef __cplusplus
772}
773#endif
774
775#endif /* GHOSTTY_VT_KITTY_GRAPHICS_H */
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_pixel_size(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, GhosttyTerminal terminal, uint32_t *out_width, uint32_t *out_height)
GHOSTTY_API void ghostty_kitty_graphics_placement_iterator_free(GhosttyKittyGraphicsPlacementIterator iterator)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_viewport_pos(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, GhosttyTerminal terminal, int32_t *out_col, int32_t *out_row)
struct GhosttyKittyGraphicsImpl * GhosttyKittyGraphics
Definition types.h:107
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_iterator_set(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsPlacementIteratorOption option, const void *value)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_get(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsPlacementData data, void *out)
GhosttyKittyGraphicsPlacementData
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_source_rect(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, uint32_t *out_x, uint32_t *out_y, uint32_t *out_width, uint32_t *out_height)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_iterator_new(const GhosttyAllocator *allocator, GhosttyKittyGraphicsPlacementIterator *out_iterator)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_get_multi(GhosttyKittyGraphicsPlacementIterator iterator, size_t count, const GhosttyKittyGraphicsPlacementData *keys, void **values, size_t *out_written)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_rect(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, GhosttyTerminal terminal, GhosttySelection *out_selection)
GhosttyKittyPlacementLayer
GhosttyKittyImageFormat
struct GhosttyKittyGraphicsPlacementIteratorImpl * GhosttyKittyGraphicsPlacementIterator
Definition types.h:125
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_get(GhosttyKittyGraphics graphics, GhosttyKittyGraphicsData data, void *out)
GHOSTTY_API GhosttyKittyGraphicsImage ghostty_kitty_graphics_image(GhosttyKittyGraphics graphics, uint32_t image_id)
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_grid_size(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, GhosttyTerminal terminal, uint32_t *out_cols, uint32_t *out_rows)
GhosttyKittyImageCompression
GhosttyKittyGraphicsImageData
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_image_get_multi(GhosttyKittyGraphicsImage image, size_t count, const GhosttyKittyGraphicsImageData *keys, void **values, size_t *out_written)
GhosttyKittyGraphicsPlacementIteratorOption
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_image_get(GhosttyKittyGraphicsImage image, GhosttyKittyGraphicsImageData data, void *out)
GHOSTTY_API bool ghostty_kitty_graphics_placement_next(GhosttyKittyGraphicsPlacementIterator iterator)
GhosttyKittyGraphicsData
GHOSTTY_API GhosttyResult ghostty_kitty_graphics_placement_render_info(GhosttyKittyGraphicsPlacementIterator iterator, GhosttyKittyGraphicsImage image, GhosttyTerminal terminal, GhosttyKittyGraphicsPlacementRenderInfo *out_info)
const struct GhosttyKittyGraphicsImageImpl * GhosttyKittyGraphicsImage
Definition types.h:118
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Z
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_X_OFFSET
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_WIDTH
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_COLUMNS
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IMAGE_ID
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_X
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_PLACEMENT_ID
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_Y_OFFSET
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_ROWS
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_HEIGHT
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_IS_VIRTUAL
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_SOURCE_Y
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_INVALID
@ GHOSTTY_KITTY_IMAGE_DATA_ID
@ GHOSTTY_KITTY_IMAGE_DATA_NUMBER
@ GHOSTTY_KITTY_IMAGE_DATA_INVALID
@ GHOSTTY_KITTY_IMAGE_DATA_DATA_PTR
@ GHOSTTY_KITTY_IMAGE_DATA_COMPRESSION
@ GHOSTTY_KITTY_IMAGE_DATA_HEIGHT
@ GHOSTTY_KITTY_IMAGE_DATA_WIDTH
@ GHOSTTY_KITTY_IMAGE_DATA_DATA_LEN
@ GHOSTTY_KITTY_IMAGE_DATA_FORMAT
@ GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_LAYER
@ GHOSTTY_KITTY_GRAPHICS_DATA_PLACEMENT_ITERATOR
@ GHOSTTY_KITTY_GRAPHICS_DATA_INVALID
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:95
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67