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
232
238typedef enum GHOSTTY_ENUM_TYPED {
241
250
270 GHOSTTY_KITTY_GRAPHICS_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
272
278typedef enum GHOSTTY_ENUM_TYPED {
281
288
295
309
316
323
330
337
344
351
358
365
372
373 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
375
389typedef enum GHOSTTY_ENUM_TYPED {
392
395
399
402 GHOSTTY_KITTY_PLACEMENT_LAYER_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
404
410typedef enum GHOSTTY_ENUM_TYPED {
417 GHOSTTY_KITTY_GRAPHICS_PLACEMENT_ITERATOR_OPTION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
419
431typedef enum GHOSTTY_ENUM_TYPED {
432 GHOSTTY_KITTY_IMAGE_FORMAT_RGB = 0,
433 GHOSTTY_KITTY_IMAGE_FORMAT_RGBA = 1,
434 GHOSTTY_KITTY_IMAGE_FORMAT_PNG = 2,
435 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY_ALPHA = 3,
436 GHOSTTY_KITTY_IMAGE_FORMAT_GRAY = 4,
437 GHOSTTY_KITTY_IMAGE_FORMAT_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
439
451typedef enum GHOSTTY_ENUM_TYPED {
452 GHOSTTY_KITTY_IMAGE_COMPRESSION_NONE = 0,
453 GHOSTTY_KITTY_IMAGE_COMPRESSION_ZLIB_DEFLATE = 1,
454 GHOSTTY_KITTY_IMAGE_COMPRESSION_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
456
462typedef enum GHOSTTY_ENUM_TYPED {
465
472
479
486
493
501
510
531
541
566
567 GHOSTTY_KITTY_IMAGE_DATA_MAX_VALUE = GHOSTTY_ENUM_MAX_VALUE,
569
597typedef struct {
599 size_t size;
601 uint32_t pixel_width;
603 uint32_t pixel_height;
605 uint32_t grid_cols;
607 uint32_t grid_rows;
621 uint32_t source_x;
623 uint32_t source_y;
625 uint32_t source_width;
629
646 GhosttyKittyGraphics graphics,
648 void* out);
649
688 GhosttyKittyGraphics graphics,
689 uint64_t now_ms,
690 uint64_t* next_ms);
691
705 GhosttyKittyGraphics graphics,
706 uint32_t image_id);
707
724 void* out);
725
755 size_t count,
757 void** values,
758 size_t* out_written);
759
775 const GhosttyAllocator* allocator,
777
787
809 const void* value);
810
825
843 void* out);
844
874 size_t count,
876 void** values,
877 size_t* out_written);
878
900 GhosttyTerminal terminal,
901 GhosttySelection* out_selection);
902
924 GhosttyTerminal terminal,
925 uint32_t* out_width,
926 uint32_t* out_height);
927
950 GhosttyTerminal terminal,
951 uint32_t* out_cols,
952 uint32_t* out_rows);
953
987 GhosttyTerminal terminal,
988 int32_t* out_col,
989 int32_t* out_row);
990
1013 uint32_t* out_x,
1014 uint32_t* out_y,
1015 uint32_t* out_width,
1016 uint32_t* out_height);
1017
1049 GhosttyTerminal terminal,
1051
1053
1054#ifdef __cplusplus
1055}
1056#endif
1057
1058#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_animation_tick(GhosttyKittyGraphics graphics, uint64_t now_ms, uint64_t *next_ms)
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_PLACEMENT_LAYER_BELOW_BG
@ GHOSTTY_KITTY_PLACEMENT_LAYER_ALL
@ GHOSTTY_KITTY_PLACEMENT_LAYER_BELOW_TEXT
@ GHOSTTY_KITTY_PLACEMENT_LAYER_ABOVE_TEXT
@ 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