Graphviz 13.0.0~dev.20241225.0935
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
gvdevice_kitty.c File Reference
#include "config.h"
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <common/types.h>
#include <gvc/gvio.h>
#include <gvc/gvplugin_device.h>
#include <util/alloc.h>
Include dependency graph for gvdevice_kitty.c:

Go to the source code of this file.

Functions

static void fix_colors (unsigned char *imagedata, size_t imagedata_size)
 
static size_t div_up (size_t dividend, size_t divisor)
 
static size_t base64_encoded_size (size_t original_size)
 
static char * base64_encode (const unsigned char *data, size_t size)
 
static void kitty_write (unsigned char *data, size_t data_size, unsigned width, unsigned height, bool is_compressed)
 
static void kitty_format (GVJ_t *job)
 

Variables

static const char base64_alphabet []
 
static gvdevice_features_t device_features_kitty
 
static gvdevice_engine_t device_engine_kitty = {.format = kitty_format}
 
gvplugin_installed_t gvdevice_types_kitty []
 

Function Documentation

◆ base64_encode()

static char * base64_encode ( const unsigned char *  data,
size_t  size 
)
static

Definition at line 47 of file gvdevice_kitty.c.

References base64_alphabet, base64_encoded_size(), and gv_alloc().

Referenced by kitty_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ base64_encoded_size()

static size_t base64_encoded_size ( size_t  original_size)
static

Definition at line 43 of file gvdevice_kitty.c.

References div_up().

Referenced by base64_encode(), and kitty_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ div_up()

static size_t div_up ( size_t  dividend,
size_t  divisor 
)
static

Definition at line 36 of file gvdevice_kitty.c.

Referenced by base64_encoded_size().

Here is the caller graph for this function:

◆ fix_colors()

static void fix_colors ( unsigned char *  imagedata,
size_t  imagedata_size 
)
static

Definition at line 27 of file gvdevice_kitty.c.

Referenced by kitty_format().

Here is the caller graph for this function:

◆ kitty_format()

static void kitty_format ( GVJ_t job)
static

Definition at line 115 of file gvdevice_kitty.c.

References fix_colors(), GVJ_s::height, GVJ_s::imagedata, kitty_write(), and GVJ_s::width.

Here is the call graph for this function:

◆ kitty_write()

static void kitty_write ( unsigned char *  data,
size_t  data_size,
unsigned  width,
unsigned  height,
bool  is_compressed 
)
static

Definition at line 89 of file gvdevice_kitty.c.

References base64_encode(), base64_encoded_size(), free(), and offset.

Referenced by kitty_format().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ base64_alphabet

const char base64_alphabet[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="

Definition at line 40 of file gvdevice_kitty.c.

Referenced by base64_encode().

◆ device_engine_kitty

gvdevice_engine_t device_engine_kitty = {.format = kitty_format}
static

Definition at line 130 of file gvdevice_kitty.c.

◆ device_features_kitty

gvdevice_features_t device_features_kitty
static
Initial value:
= {
{0., 0.},
{0., 0.},
{96., 96.},
}
#define GVDEVICE_DOES_TRUECOLOR
Definition gvcjob.h:90

Definition at line 123 of file gvdevice_kitty.c.

◆ gvdevice_types_kitty

gvplugin_installed_t gvdevice_types_kitty[]
Initial value:
= {
{0, "kitty:cairo", 0, &device_engine_kitty, &device_features_kitty},
{0, NULL, 0, NULL, NULL}}
node NULL
Definition grammar.y:163
static gvdevice_engine_t device_engine_kitty
static gvdevice_features_t device_features_kitty

Definition at line 169 of file gvdevice_kitty.c.