Device that renders using ANSI terminal colors.
More...
#include <assert.h>
#include <gvc/gvplugin.h>
#include <gvc/gvplugin_device.h>
#include <limits.h>
#include <stddef.h>
#include <gvc/gvio.h>
Go to the source code of this file.
|
static unsigned | distance (const color_t base, unsigned red, unsigned green, unsigned blue) |
| a metric of “closeness” to a given color
|
|
static unsigned | get_color (unsigned red, unsigned green, unsigned blue) |
| find closest ANSI color
|
|
static void | process (GVJ_t *job, int color_depth) |
|
static void | process3 (GVJ_t *job) |
|
static void | process24 (GVJ_t *job) |
|
◆ GVPLUGIN_VT_API
◆ distance()
static unsigned distance |
( |
const color_t |
base, |
|
|
unsigned |
red, |
|
|
unsigned |
green, |
|
|
unsigned |
blue |
|
) |
| |
|
static |
◆ get_color()
static unsigned get_color |
( |
unsigned |
red, |
|
|
unsigned |
green, |
|
|
unsigned |
blue |
|
) |
| |
|
static |
◆ process()
static void process |
( |
GVJ_t * |
job, |
|
|
int |
color_depth |
|
) |
| |
|
static |
◆ process24()
static void process24 |
( |
GVJ_t * |
job | ) |
|
|
static |
◆ process3()
static void process3 |
( |
GVJ_t * |
job | ) |
|
|
static |
◆ apis
Initial value:= {
}
static gvplugin_installed_t device_types[]
Definition at line 138 of file gvplugin_vt.c.
◆ COLORS
Initial value:= {
{0, 0x00, 0x00, 0x00},
{1, 0xff, 0x00, 0x00},
{2, 0x00, 0xff, 0x00},
{3, 0xff, 0xff, 0x00},
{4, 0x00, 0x00, 0xff},
{5, 0xff, 0x00, 0xff},
{6, 0x00, 0xff, 0xff},
{7, 0xff, 0xff, 0xff},
}
Definition at line 22 of file gvplugin_vt.c.
Referenced by get_color().
◆ device_features
Initial value:= {
.default_dpi = {96, 96},
}
Definition at line 128 of file gvplugin_vt.c.
◆ device_types
Initial value:= {
{0},
}
static gvdevice_features_t device_features
static gvdevice_engine_t engine24
static gvdevice_engine_t engine3
Definition at line 132 of file gvplugin_vt.c.
◆ engine24
Initial value:= {
}
static void process24(GVJ_t *job)
Definition at line 124 of file gvplugin_vt.c.
◆ engine3
Initial value:= {
}
static void process3(GVJ_t *job)
Definition at line 120 of file gvplugin_vt.c.
◆ gvplugin_vt_LTX_library