ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
display.c File Reference

Display layout and rendering options. More...

Go to the source code of this file.

Variables

const registry_entry_t g_display_entries []

Detailed Description

Display layout and rendering options.

Options for controlling rendering modes, palettes, color filters, framerate, and snapshot mode.

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
January 2026

Definition in file lib/options/registry/display.c.

Variable Documentation

◆ g_display_entries

const registry_entry_t g_display_entries[]

Definition at line 105 of file lib/options/registry/display.c.

105 {
106 {.long_name = "zalgo",
107 .type = OPTION_TYPE_CALLBACK,
108 .offset = offsetof(options_t, zalgo),
109 .default_value_size = sizeof(int),
110 .help_text = "Add combining marks at intensity 1-10 (default when enabled: 7). Omit to disable. Terminal/text output only.",
111 .group = "DISPLAY",
112 .arg_placeholder = "LEVEL",
113 .env_var_name = "ASCII_CHAT_ZALGO",
114 .parse_fn = parse_zalgo,
115 .optional_arg = true,
117 .metadata = {.numeric_range = {1, 10, 1}, .input_type = OPTION_INPUT_NUMERIC}},
118 {"waveform",
119 '\0',
121 offsetof(options_t, waveform),
122 &default_waveform_value,
123 sizeof(bool),
124 "Replace the video image with a live waveform of the source selected by --audio-source.",
125 "DISPLAY",
126 NULL,
127 false,
128 "ASCII_CHAT_WAVEFORM",
129 NULL,
130 NULL,
131 false,
132 false,
134 {0},
135 NULL},
136 {"fft",
137 '\0',
139 offsetof(options_t, fft),
140 &default_fft_value,
141 sizeof(bool),
142 "Replace the video image with a live scrolling frequency display for the source selected by --audio-source.",
143 "DISPLAY",
144 NULL,
145 false,
146 "ASCII_CHAT_FFT",
147 NULL,
148 NULL,
149 false,
150 false,
152 {0},
153 NULL},
154 {"fft-scale",
155 '\0',
157 offsetof(options_t, fft_scale),
158 &default_fft_scale,
159 sizeof(((options_t *)0)->fft_scale),
160 "FFT amplitude scale: linear, log, or MIN:MAX dB (default -62:-6).",
161 "DISPLAY",
162 "SCALE",
163 false,
164 "ASCII_CHAT_FFT_SCALE",
165 NULL,
166 parse_fft_scale,
167 false,
168 false,
170 {.input_type = OPTION_INPUT_STRING},
171 NULL},
172 // DISPLAY GROUP (client, mirror, discovery)
173 {"color-filter",
174 '\0',
176 offsetof(options_t, color_filter),
177 &default_color_filter_value,
178 sizeof(color_filter_t),
179 "Apply a monochromatic color tint to grayscale video. Values: none, black, white, green, magenta, fuchsia, "
180 "orange, teal, cyan, pink, red, yellow, rainbow. Using --color-filter automatically sets --color-mode to mono.",
181 "DISPLAY",
182 NULL,
183 false,
184 "ASCII_CHAT_COLOR_FILTER",
185 NULL,
187 false,
188 false,
190 {.enum_values = g_color_filter_values, .enum_descriptions = g_color_filter_descs, .enum_integer_values = g_color_filter_integers, .input_type = OPTION_INPUT_ENUM},
191 NULL},
192 {"render-mode",
193 'M',
195 offsetof(options_t, render_mode),
196 &default_render_mode_value,
197 sizeof(terminal_render_mode_t),
198 "Render mode of text for your client to display. Values: foreground, background, half-block. Press 'r' during "
199 "rendering to cycle.",
200 "DISPLAY",
201 NULL,
202 false,
203 "ASCII_CHAT_RENDER_MODE",
204 NULL,
206 false,
207 false,
209 {.enum_values = g_render_values, .enum_descriptions = g_render_descs, .enum_integer_values = g_render_integers, .input_type = OPTION_INPUT_ENUM},
210 NULL},
211 {"palette",
212 'P',
214 offsetof(options_t, palette_type),
215 &default_palette_type_value,
216 sizeof(palette_type_t),
217 "Palette type with which to render images to text art. Values: standard, blocks, digital, minimal, cool, "
218 "custom. All but 'custom' are built-in presets that all look different and nice. Try them out.",
219 "DISPLAY",
220 NULL,
221 false,
222 "ASCII_CHAT_PALETTE",
223 NULL,
224 parse_explicit_palette,
225 false,
226 false,
228 {.enum_values = g_palette_values, .enum_descriptions = g_palette_descs, .enum_integer_values = g_palette_integers, .input_type = OPTION_INPUT_ENUM},
229 NULL},
230 {"palette-chars",
231 'C',
233 offsetof(options_t, palette_custom),
234 "",
235 0,
236 "Ordered sequence of characters from darkest to brightest to use with custom palette (--palette=custom) for "
237 "rendering images to text art for your client. These characters only will be used to create the rendered output. "
238 "Can be UTF-8 content (see --utf8).",
239 "DISPLAY",
240 "STRING",
241 false,
242 "ASCII_CHAT_PALETTE_CHARS",
243 NULL,
245 false,
246 false,
248 {0},
249 NULL},
250 {.long_name = "renderer",
251 .type = OPTION_TYPE_CALLBACK,
252 .offset = offsetof(options_t, renderer),
253 .default_value = &default_renderer,
254 .default_value_size = sizeof(ascii_renderer_t),
255 .help_text = "Character selection: glyph (default) or luminance matching. Glyph supports printable "
256 "ASCII and Unicode block elements; unsupported palette characters are rejected.",
257 .group = "DISPLAY",
258 .arg_placeholder = "luminance|glyph",
259 .env_var_name = "ASCII_CHAT_RENDERER",
260 .parse_fn = parse_ascii_renderer,
262 .metadata = {.enum_values = renderer_values, .enum_descriptions = renderer_descriptions, .enum_integer_values = renderer_integers, .input_type = OPTION_INPUT_ENUM}},
263 {.long_name = "stabilize",
264 .type = OPTION_TYPE_BOOL,
265 .offset = offsetof(options_t, stabilize),
266 .default_value = &default_stabilize_value,
267 .default_value_size = sizeof(bool),
268 .help_text = "Reduce character and color flicker between video frames in all render modes.",
269 .group = "DISPLAY",
270 .env_var_name = "ASCII_CHAT_STABILIZE",
272 {"stretch",
273 '\0',
275 offsetof(options_t, stretch),
276 &default_stretch_value,
277 sizeof(bool),
278 "Allow aspect ratio distortion of image for rendering ascii output. This can allow the rendered ascii to fill "
279 "your terminal.",
280 "DISPLAY",
281 NULL,
282 false,
283 "ASCII_CHAT_STRETCH",
284 NULL,
285 NULL,
286 false,
287 false,
289 {0},
290 NULL},
291 {"fps",
292 '\0',
294 offsetof(options_t, fps),
295 &default_fps_value,
296 sizeof(int),
297 "Target framerate for rendering (0 = auto, 1-144).",
298 "DISPLAY",
299 NULL,
300 false,
301 "ASCII_CHAT_FPS",
302 NULL,
303 NULL,
304 false,
305 false,
307 {.numeric_range = {0, 144, 1}, .examples = g_fps_examples, .input_type = OPTION_INPUT_NUMERIC},
308 NULL},
309 {"fps-counter",
310 '\0',
312 offsetof(options_t, fps_counter),
313 &default_fps_counter_value,
314 sizeof(bool),
315 "Show FPS counter overlay in top-right corner. Press '-' to toggle.",
316 "DISPLAY",
317 NULL,
318 false,
319 "ASCII_CHAT_FPS_COUNTER",
320 NULL,
321 NULL,
322 false,
323 false,
325 {0},
326 NULL},
327 {"snapshot",
328 'S',
330 offsetof(options_t, snapshot_mode),
331 &default_snapshot_mode_value,
332 sizeof(bool),
333 "Snapshot mode (one frame and exit).",
334 "DISPLAY",
335 NULL,
336 false,
337 "ASCII_CHAT_SNAPSHOT",
338 NULL,
339 NULL,
340 false,
341 false,
343 {0},
344 NULL},
345 {"snapshot-delay",
346 'D',
348 offsetof(options_t, snapshot_delay),
349 &default_snapshot_delay_value,
350 sizeof(double),
351 "Snapshot delay in seconds. The timer starts right before the client-side program prints the first frame. "
352 "--snapshot --snapshot-delay=0 will print the first frame and exit.",
353 "DISPLAY",
354 "SECONDS",
355 false,
356 "ASCII_CHAT_SNAPSHOT_DELAY",
357 NULL,
358 NULL,
359 false,
360 false,
362 {.numeric_range = {0, 3600, 0}, .input_type = OPTION_INPUT_NUMERIC},
363 NULL},
364 {"matrix",
365 '\0',
367 offsetof(options_t, matrix_rain),
368 &default_matrix_rain_value,
369 sizeof(bool),
370 "Enable Matrix-style digital rain effect. Works with --render-mode truecolor|256 and --color-filter [color].",
371 "DISPLAY",
372 NULL,
373 false,
374 "ASCII_CHAT_MATRIX",
375 NULL,
376 NULL,
377 false,
378 false,
380 {0},
381 NULL},
382 {"face-follow",
383 '\0',
385 offsetof(options_t, face_follow),
386 &default_face_follow_value,
387 sizeof(bool),
388 "Automatically zoom and pan to follow your face, with smooth full-frame fallback.",
389 "DISPLAY",
390 NULL,
391 false,
392 "ASCII_CHAT_FACE_FOLLOW",
393 NULL,
394 NULL,
395 false,
396 false,
398 {0},
399 NULL},
400 {"flip-x",
401 '\0',
403 offsetof(options_t, flip_x),
404 &default_flip_x_value,
405 sizeof(bool),
406 "Flip video horizontally (X-axis). Webcam defaults to mirrored; media and audio animations do not. Explicit "
407 "choices apply to all sources until exit.",
408 "DISPLAY",
409 NULL,
410 false,
411 "ASCII_CHAT_FLIP_X",
412 NULL,
413 NULL,
414 false,
415 false,
417 {0},
418 NULL},
419 {"flip-y",
420 '\0',
422 offsetof(options_t, flip_y),
423 &default_flip_y_value,
424 sizeof(bool),
425 "Flip video vertically (Y-axis). Works with webcam, files, and streams.",
426 "DISPLAY",
427 NULL,
428 false,
429 "ASCII_CHAT_FLIP_Y",
430 NULL,
431 NULL,
432 false,
433 false,
435 {0},
436 NULL},
437
@ OPTION_INPUT_STRING
Free-form text input.
Definition builder.h:189
@ OPTION_INPUT_NUMERIC
Numeric value with optional min/max/step.
Definition builder.h:188
@ OPTION_INPUT_ENUM
Choose from fixed set of enum values.
Definition builder.h:187
@ OPTION_TYPE_INT
Integer value (–count 42).
Definition builder.h:172
@ OPTION_TYPE_DOUBLE
Floating point (–ratio 1.5).
Definition builder.h:174
@ OPTION_TYPE_STRING
String value (–name foo).
Definition builder.h:173
@ OPTION_TYPE_CALLBACK
Custom parser function.
Definition builder.h:175
@ OPTION_TYPE_BOOL
Boolean flag (–flag, no value).
Definition builder.h:171
terminal_render_mode_t render_mode
Definition fft.c:27
struct options_state options_t
Immutable, RCU-published snapshot of the application's runtime configuration.
@ OPTION_MODE_CLIENT
Client mode (bit 1).
Definition options.h:936
@ OPTION_MODE_DISCOVERY
Discovery mode (bit 4).
Definition options.h:939
@ OPTION_MODE_MIRROR
Mirror mode (bit 2).
Definition options.h:937
palette_type_t
Built-in palette type enumeration.
Definition palette.h:96
#define REGISTRY_TERMINATOR()
Initialize a terminator entry (sentinel value for array end) Uses designated initializers to properly...
const int g_palette_integers[]
Definition metadata.c:87
const char * g_color_filter_descs[]
Definition metadata.c:67
const char * g_palette_descs[]
Definition metadata.c:88
const char * g_color_filter_values[]
Definition metadata.c:62
const char * g_render_descs[]
Definition metadata.c:104
const int g_render_integers[]
Definition metadata.c:101
const char * g_fps_examples[]
Definition metadata.c:143
const char * g_palette_values[]
Definition metadata.c:86
const int g_color_filter_integers[]
Definition metadata.c:65
const char * g_render_values[]
Definition metadata.c:100
bool parse_render_mode(const char *arg, void *dest, char **error_msg)
Parse render mode option.
Definition parsers.c:238
bool parse_color_filter(const char *arg, void *dest, char **error_msg)
Parse color filter option.
Definition parsers.c:207
bool parse_palette_chars(const char *arg, void *dest, char **error_msg)
Parse custom palette characters option.
Definition parsers.c:856