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

ANSI escape sequence utilities and fast color code generation with SIMD-accelerated terminal output. More...

Go to the source code of this file.

Macros

#define ANSI_16_SGR_BUFFER_SIZE   16

Functions

char * ansi_strip_escapes (const char *input, size_t input_len)
 When code needs to work with rgb error, it keeps r, g, b here instead of scattering it across globals. Initialization establishes the handles and sizes; teardown must release any allocation, lock, thread, or callback context recorded in those fields.
const char * ansi_skip_escape (const char *ptr, const char *end)
 Find the end of an ANSI CSI escape sequence.
bool ansi_is_already_colorized (const char *message, size_t pos)
 Check if a position in text is already colored.
char * append_truecolor_fg (char *dst, uint8_t r, uint8_t g, uint8_t b)
char * append_truecolor_bg (char *dst, uint8_t r, uint8_t g, uint8_t b)
char * append_truecolor_fg_bg (char *dst, uint8_t fr, uint8_t fg, uint8_t fb, uint8_t br, uint8_t bg, uint8_t bb)
void ansi_rle_init (ansi_rle_context_t *ctx, char *buffer, size_t capacity, ansi_color_mode_t mode)
void ansi_rle_add_pixel (ansi_rle_context_t *ctx, uint8_t r, uint8_t g, uint8_t b, char ascii_char)
void ansi_rle_finish (ansi_rle_context_t *ctx)
void ansi_fast_init (void)
void ansi_fast_init_256color (void)
char * append_256color_fg (char *dst, uint8_t index)
char * append_256color_bg (char *dst, uint8_t index)
uint8_t rgb_to_256color (uint8_t r, uint8_t g, uint8_t b)
void get_256color_rgb (uint8_t index, uint8_t *r, uint8_t *g, uint8_t *b)
void ansi_fast_init_16color (void)
char * append_16color_fg (char *dst, uint8_t color_index)
char * append_16color_bg (char *dst, uint8_t color_index)
uint8_t rgb_to_16color (uint8_t r, uint8_t g, uint8_t b)
void get_16color_rgb (uint8_t color_index, uint8_t *r, uint8_t *g, uint8_t *b)
uint8_t rgb_to_16color_dithered (int r, int g, int b, int x, int y, int width, int height, rgb_error_t *error_buffer)
char * append_color_fg_for_mode (char *dst, uint8_t r, uint8_t g, uint8_t b, terminal_color_mode_t mode)

Detailed Description

ANSI escape sequence utilities and fast color code generation with SIMD-accelerated terminal output.

Definition in file ansi.c.

Macro Definition Documentation

◆ ANSI_16_SGR_BUFFER_SIZE

#define ANSI_16_SGR_BUFFER_SIZE   16

Definition at line 8 of file ansi.c.