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
404
412
429
430 GHOSTTY_KITTY_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
432
450typedef struct {
452 size_t size;
454 uint32_t pixel_width;
456 uint32_t pixel_height;
458 uint32_t grid_cols;
460 uint32_t grid_rows;
468 uint32_t source_x;
470 uint32_t source_y;
472 uint32_t source_width;
476
493 GhosttyKittyGraphics graphics,
495 void* out);
496
510 GhosttyKittyGraphics graphics,
511 uint32_t image_id);
512
529 void* out);
530
560 size_t count,
562 void** values,
563 size_t* out_written);
564
580 const GhosttyAllocator* allocator,
582
592
614 const void* value);
615
630
648 void* out);
649
679 size_t count,
681 void** values,
682 size_t* out_written);
683
705 GhosttyTerminal terminal,
706 GhosttySelection* out_selection);
707
729 GhosttyTerminal terminal,
730 uint32_t* out_width,
731 uint32_t* out_height);
732
755 GhosttyTerminal terminal,
756 uint32_t* out_cols,
757 uint32_t* out_rows);
758
797 GhosttyTerminal terminal,
798 int32_t* out_col,
799 int32_t* out_row);
800
823 uint32_t* out_x,
824 uint32_t* out_y,
825 uint32_t* out_width,
826 uint32_t* out_height);
827
850 GhosttyTerminal terminal,
852
854
855#ifdef __cplusplus
856}
857#endif
858
859#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:119
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:137
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:130
@ 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:95
GhosttyResult
Definition types.h:74
#define GHOSTTY_ENUM_TYPED
Definition types.h:67