![]() |
![]() |
![]() |
![]() |
ChafaCanvasConfig — Describes a configuration for ChafaCanvas
A ChafaCanvasConfig describes a set of parameters for ChafaCanvas, such as its geometry, color space and other output characteristics.
To create a new ChafaCanvasConfig, use chafa_canvas_config_new()
. You
can then modify it using its setters, e.g. chafa_canvas_config_set_canvas_mode()
before assigning it to a new ChafaCanvas with chafa_canvas_new()
.
Note that it is not possible to change a canvas' configuration after the canvas is created.
ChafaCanvasConfig *
chafa_canvas_config_new (void
);
Creates a new ChafaCanvasConfig with default settings. This object can later be used in the creation of a ChafaCanvas.
void
chafa_canvas_config_ref (ChafaCanvasConfig *config
);
Adds a reference to config
.
void
chafa_canvas_config_unref (ChafaCanvasConfig *config
);
Removes a reference from config
.
void chafa_canvas_config_get_geometry (const ChafaCanvasConfig *config
,gint *width_out
,gint *height_out
);
Returns config
's width and height in character cells in the
provided output locations.
void chafa_canvas_config_set_geometry (ChafaCanvasConfig *config
,gint width
,gint height
);
Sets config
's width and height in character cells to width
x height
.
ChafaCanvasMode
chafa_canvas_config_get_canvas_mode (const ChafaCanvasConfig *config
);
Returns config
's ChafaCanvasMode.
void chafa_canvas_config_set_canvas_mode (ChafaCanvasConfig *config
,ChafaCanvasMode mode
);
Sets config
's stored ChafaCanvasMode to mode
.
ChafaColorSpace
chafa_canvas_config_get_color_space (const ChafaCanvasConfig *config
);
Returns config
's ChafaColorSpace.
void chafa_canvas_config_set_color_space (ChafaCanvasConfig *config
,ChafaColorSpace color_space
);
Sets config
's stored ChafaColorSpace to color_space
.
const ChafaSymbolMap *
chafa_canvas_config_peek_symbol_map (const ChafaCanvasConfig *config
);
Returns a pointer to the symbol map belonging to config
.
This can be inspected using the ChafaSymbolMap getter
functions, but not changed.
void chafa_canvas_config_set_symbol_map (ChafaCanvasConfig *config
,const ChafaSymbolMap *symbol_map
);
Assigns a copy of symbol_map
to config
.
gfloat
chafa_canvas_config_get_transparency_threshold
(const ChafaCanvasConfig *config
);
Returns the threshold above which full transparency will be used.
void chafa_canvas_config_set_transparency_threshold (ChafaCanvasConfig *config
,gfloat alpha_threshold
);
Sets the threshold above which full transparency will be used.
guint32
chafa_canvas_config_get_fg_color (const ChafaCanvasConfig *config
);
Gets the assumed foreground color of the output device. This is used to determine how to apply the foreground pen in FGBG modes.
void chafa_canvas_config_set_fg_color (ChafaCanvasConfig *config
,guint32 fg_color_packed_rgb
);
Sets the assumed foreground color of the output device. This is used to determine how to apply the foreground pen in FGBG modes.
guint32
chafa_canvas_config_get_bg_color (const ChafaCanvasConfig *config
);
Gets the assumed background color of the output device. This is used to determine how to apply the background pen in FGBG modes.
void chafa_canvas_config_set_bg_color (ChafaCanvasConfig *config
,guint32 bg_color_packed_rgb
);
Sets the assumed background color of the output device. This is used to determine how to apply the background and transparency pens in FGBG modes, and will also be substituted for partial transparency.
gfloat
chafa_canvas_config_get_work_factor (const ChafaCanvasConfig *config
);
Gets the work/quality tradeoff factor. A higher value means more time and memory will be spent towards a higher quality output.
void chafa_canvas_config_set_work_factor (ChafaCanvasConfig *config
,gfloat work_factor
);
Sets the work/quality tradeoff factor. A higher value means more time and memory will be spent towards a higher quality output.
Truecolor. |
||
256 colors. |
||
256 colors, but avoid using the lower 16 whose values vary between terminal environments. |
||
16 colors using the aixterm ANSI extension. |
||
Default foreground and background colors, plus inversion. |
||
Default foreground and background colors. No ANSI codes will be used. |
||
Last supported canvas mode plus one. |