ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
foreground.c File Reference

Go to the source code of this file.

Macros

#define VIDEO_ASCII_SCALAR_FOREGROUND_COLOR_CODE_BUFFER_SIZE   20

Functions

char * image_print (const image_t *image, const char *palette)
 Print image as ASCII art (monochrome).
char * image_print_color (const image_t *image, const char *palette)
 Print image as ASCII art with color.
char * image_print_color_utf8 (const image_t *image, const char *palette)
char * image_print_256color (const image_t *image, const char *palette)
 Print image using 256-color ANSI mode.
char * image_print_16color (const image_t *image, const char *palette)
 Print image using 16-color ANSI mode.
char * image_print_16color_dithered (const image_t *image, const char *palette)
 Print image using 16-color ANSI mode with dithering.
char * image_print_16color_dithered_with_background (const image_t *image, bool background, const char *palette)
 Print image using 16-color ANSI mode with dithering and background colors.
void quantize_color (int *r, int *g, int *b, int levels)
 Quantize color to specified number of levels.
char * rgb_to_ansi_fg (int r, int g, int b)
 Convert RGB to ANSI foreground color code.
char * rgb_to_ansi_bg (int r, int g, int b)
 Convert RGB to ANSI background color code.
void rgb_to_ansi_8bit (int r, int g, int b, int *fg_code, int *bg_code)
 Convert RGB to 8-bit ANSI color codes.

Detailed Description

Foreground rendering compatibility entry points and color utilities.

Definition in file foreground.c.

Macro Definition Documentation

◆ VIDEO_ASCII_SCALAR_FOREGROUND_COLOR_CODE_BUFFER_SIZE

#define VIDEO_ASCII_SCALAR_FOREGROUND_COLOR_CODE_BUFFER_SIZE   20

Definition at line 6 of file foreground.c.

Referenced by rgb_to_ansi_bg(), and rgb_to_ansi_fg().

Function Documentation

◆ image_print_color_utf8()

char * image_print_color_utf8 ( const image_t * image,
const char * palette )

Definition at line 20 of file foreground.c.

20 {
21 return ascii_render(image, palette, ASCII_COLOR_TRUE, false, false, simd_cells_backend());
22}
const simd_cells_t * simd_cells_backend(void)
Definition cells.c:70
char * ascii_render(const image_t *image, const char *palette, ascii_color_t mode, bool background, bool dither, const simd_cells_t *ops)

References ASCII_COLOR_TRUE, ascii_render(), and simd_cells_backend().