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
126
132typedef enum GHOSTTY_ENUM_TYPED {
135
144
167 GHOSTTY_KITTY_GRAPHICS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
169
175typedef enum GHOSTTY_ENUM_TYPED {
178
185
192
199
206
213
220
227
234
241
248
255
262
263 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
265
277typedef enum GHOSTTY_ENUM_TYPED {
278 GHOSTTY_KITTY_PLACEMENT_LAYER_ALL = 0,
279 GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_BG = 1,
280 GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_TEXT = 2,
281 GHOSTTY_KITTY_PLACEMENT_LAYER_ABOVE_TEXT = 3,
282 GHOSTTY_KITTY_PLACEMENT_LAYER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
284
290typedef enum GHOSTTY_ENUM_TYPED {
297 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
299
311typedef enum GHOSTTY_ENUM_TYPED {
312 GHOSTTY_KITTY_IMAGE_FORMAT_RGB = 0,
313 GHOSTTY_KITTY_IMAGE_FORMAT_RGBA = 1,
314 GHOSTTY_KITTY_IMAGE_FORMAT_PNG = 2,
315 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY_ALPHA = 3,
316 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY = 4,
317 GHOSTTY_KITTY_IMAGE_FORMAT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
319
331typedef enum GHOSTTY_ENUM_TYPED {
332 GHOSTTY_KITTY_IMAGE_COMPRESSION_NONE = 0,
333 GHOSTTY_KITTY_IMAGE_COMPRESSION_ZLIB_DEFLATE = 1,
334 GHOSTTY_KITTY_IMAGE_COMPRESSION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
336
342typedef enum GHOSTTY_ENUM_TYPED {
345
352
359
366
373
381
390
411
421
441
442 GHOSTTY_KITTY_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
444
462typedef struct {
464 size_t size;
466 uint32_t pixel_width;
468 uint32_t pixel_height;
470 uint32_t grid_cols;
472 uint32_t grid_rows;
480 uint32_t source_x;
482 uint32_t source_y;
484 uint32_t source_width;
488
505 GhosttyKittyGraphics graphics,
507 void* out);
508
522 GhosttyKittyGraphics graphics,
523 uint32_t image_id);
524
541 void* out);
542
572 size_t count,
574 void** values,
575 size_t* out_written);
576
592 const GhosttyAllocator* allocator,
594
604
626 const void* value);
627
642
660 void* out);
661
691 size_t count,
693 void** values,
694 size_t* out_written);
695
717 GhosttyTerminal terminal,
718 GhosttySelection* out_selection);
719
741 GhosttyTerminal terminal,
742 uint32_t* out_width,
743 uint32_t* out_height);
744
767 GhosttyTerminal terminal,
768 uint32_t* out_cols,
769 uint32_t* out_rows);
770
809 GhosttyTerminal terminal,
810 int32_t* out_col,
811 int32_t* out_row);
812
835 uint32_t* out_x,
836 uint32_t* out_y,
837 uint32_t* out_width,
838 uint32_t* out_height);
839
862 GhosttyTerminal terminal,
864
866
867#ifdef __cplusplus
868}
869#endif
870
871#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:150
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:168
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:161
@ 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_GENERATION
@ 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_GENERATION
@ GHOSTTY_KITTY_GRAPHICS_DATA_INVALID
struct GhosttyTerminalImpl * GhosttyTerminal
Definition types.h:119
GhosttyResult
Definition types.h:88
#define GHOSTTY_ENUM_TYPED
Definition types.h:81