|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🖼️ Image-to-ASCII conversion with SIMD acceleration, color matching, and terminal optimization More...
Go to the source code of this file.
Functions | |
| asciichat_error_t | ascii_read_init (unsigned short int webcam_index) |
| asciichat_error_t | ascii_write_init (int fd, bool reset_terminal) |
| char * | ascii_convert (image_t *original, const ssize_t width, const ssize_t height, const bool color, const bool _aspect_ratio, const bool stretch, const char *palette_chars, const char luminance_palette[256]) |
| char * | ascii_convert_with_capabilities (image_t *original, const ssize_t width, const ssize_t height, const terminal_capabilities_t *caps, const bool use_aspect_ratio, const bool stretch, const char *palette_chars) |
| asciichat_error_t | ascii_write (const char *frame) |
| void | ascii_write_destroy (int fd, bool reset_terminal) |
| void | ascii_read_destroy (void) |
| char * | ascii_pad_frame_width (const char *frame, size_t pad_left) |
| char * | ascii_create_grid (ascii_frame_source_t *sources, int source_count, int width, int height, size_t *out_size) |
| char * | ascii_pad_frame_height (const char *frame, size_t pad_top) |
🖼️ Image-to-ASCII conversion with SIMD acceleration, color matching, and terminal optimization
Definition in file ascii.c.
| char * ascii_convert | ( | image_t * | original, |
| const ssize_t | width, | ||
| const ssize_t | height, | ||
| const bool | color, | ||
| const bool | _aspect_ratio, | ||
| const bool | stretch, | ||
| const char * | palette_chars, | ||
| const char | luminance_palette[256] | ||
| ) |
Definition at line 69 of file ascii.c.
References ascii_pad_frame_height(), ascii_pad_frame_width(), aspect_ratio(), image_clear(), image_destroy(), image_new(), image_print(), image_print_color(), image_print_color_simd(), image_print_simd(), and image_resize().
Referenced by benchmark_simd_color_conversion_with_source(), and convert_frame_to_ascii().
| char * ascii_convert_with_capabilities | ( | image_t * | original, |
| const ssize_t | width, | ||
| const ssize_t | height, | ||
| const terminal_capabilities_t * | caps, | ||
| const bool | use_aspect_ratio, | ||
| const bool | stretch, | ||
| const char * | palette_chars | ||
| ) |
Definition at line 190 of file ascii.c.
References ascii_pad_frame_height(), ascii_pad_frame_width(), aspect_ratio(), image_clear(), image_destroy(), image_new(), image_print_with_capabilities(), image_resize(), time_elapsed_ns(), and time_get_ns().
Referenced by mirror_convert_frame(), and session_display_convert_to_ascii().
| char * ascii_create_grid | ( | ascii_frame_source_t * | sources, |
| int | source_count, | ||
| int | width, | ||
| int | height, | ||
| size_t * | out_size | ||
| ) |
Creates a grid layout from multiple ASCII frame sources with | and _ separators.
Parameters: sources Array of ASCII frame sources to combine source_count Number of sources in the array width Target width of the output grid height Target height of the output grid out_size Output parameter for the size of the returned buffer
Returns: A newly allocated, null-terminated string containing the grid layout, or NULL on error. Caller must free the returned buffer.
Definition at line 542 of file ascii.c.
| char * ascii_pad_frame_height | ( | const char * | frame, |
| size_t | pad_top | ||
| ) |
Adds vertical padding (blank lines) to center a frame vertically.
Parameters: frame The input ASCII frame to pad vertically. pad_top Number of blank lines to add at the top.
Returns: A newly allocated, null-terminated string with vertical padding, or NULL if frame is NULL.
NOTE: Uses plain newlines instead of ANSI escape sequences to support both TTY and piped/redirected output. TTY flicker prevention is handled by the display layer (e.g., display.c) when appropriate.
Definition at line 842 of file ascii.c.
Referenced by ascii_convert(), and ascii_convert_with_capabilities().
| char * ascii_pad_frame_width | ( | const char * | frame, |
| size_t | pad_left | ||
| ) |
Definition at line 398 of file ascii.c.
Referenced by ascii_convert(), and ascii_convert_with_capabilities().
| void ascii_read_destroy | ( | void | ) |
Definition at line 378 of file ascii.c.
References webcam_destroy().
| asciichat_error_t ascii_read_init | ( | unsigned short int | webcam_index | ) |
Definition at line 35 of file ascii.c.
References webcam_init().
| asciichat_error_t ascii_write | ( | const char * | frame | ) |
Definition at line 333 of file ascii.c.
References platform_write_all(), terminal_flush(), and terminal_should_use_control_sequences().
| void ascii_write_destroy | ( | int | fd, |
| bool | reset_terminal | ||
| ) |
Definition at line 355 of file ascii.c.
References terminal_should_use_control_sequences().
Referenced by session_display_destroy().
| asciichat_error_t ascii_write_init | ( | int | fd, |
| bool | reset_terminal | ||
| ) |
Definition at line 41 of file ascii.c.
References terminal_should_use_control_sequences().
Referenced by session_display_create().