![]() |
libghostty-vt 0.0.0
|
#include <ghostty/vt/kitty_graphics.h>
Data Fields | |
| size_t | size |
| uint32_t | pixel_width |
| uint32_t | pixel_height |
| uint32_t | grid_cols |
| uint32_t | grid_rows |
| int32_t | viewport_col |
| int32_t | viewport_row |
| bool | viewport_visible |
| uint32_t | source_x |
| uint32_t | source_y |
| uint32_t | source_width |
| uint32_t | source_height |
The geometry of a storage placement, filled in by ghostty_kitty_graphics_placement_render_info().
It holds the results of ghostty_kitty_graphics_placement_pixel_size(), ghostty_kitty_graphics_placement_grid_size(), ghostty_kitty_graphics_placement_viewport_pos() and ghostty_kitty_graphics_placement_source_rect(), so you can get all of them in one call. That helps most when each call is expensive, such as through FFI or Cgo.
This is for inspecting the storage. To draw, use the render state's image list, which gives the same values for every image on screen. See Drawing images.
This is a sized struct. Initialize it with GHOSTTY_INIT_SIZED() before each call. See Sized Structs.
Definition at line 425 of file kitty_graphics.h.
| uint32_t grid_cols |
The number of columns of cells the placement covers.
Definition at line 433 of file kitty_graphics.h.
| uint32_t grid_rows |
The number of rows of cells the placement covers.
Definition at line 435 of file kitty_graphics.h.
| uint32_t pixel_height |
The height to draw the image at, in pixels.
Definition at line 431 of file kitty_graphics.h.
| uint32_t pixel_width |
The width to draw the image at, in pixels.
Definition at line 429 of file kitty_graphics.h.
| size_t size |
The size of this struct in bytes. Set it with GHOSTTY_INIT_SIZED.
Definition at line 427 of file kitty_graphics.h.
| uint32_t source_height |
The height of the part of the image to draw, in image pixels.
Definition at line 455 of file kitty_graphics.h.
| uint32_t source_width |
The width of the part of the image to draw, in image pixels.
Definition at line 453 of file kitty_graphics.h.
| uint32_t source_x |
The left edge of the part of the image to draw, in image pixels.
Definition at line 449 of file kitty_graphics.h.
| uint32_t source_y |
The top edge of the part of the image to draw, in image pixels.
Definition at line 451 of file kitty_graphics.h.
| int32_t viewport_col |
The column of the top-left cell, where 0 is the leftmost column of the viewport. Only meaningful when viewport_visible is true.
Definition at line 438 of file kitty_graphics.h.
| int32_t viewport_row |
The row of the top-left cell, where 0 is the top row of the viewport. It is negative when the top of the placement scrolled above the viewport. Only meaningful when viewport_visible is true.
Definition at line 443 of file kitty_graphics.h.
| bool viewport_visible |
True when any part of the placement is in the viewport. False when it is entirely outside the viewport, or when the storage can't find its position: a virtual placement, or a placement relative to one.
Definition at line 447 of file kitty_graphics.h.