31#ifndef BGASCII_LUMA_THRESHOLD
32#define BGASCII_LUMA_THRESHOLD 128
35#ifndef CUBE_GRAY_THRESHOLD
36#define CUBE_GRAY_THRESHOLD 10
49static inline char *build_sgr256_fg(
char *buf,
uint8_t fg,
uint8_t *len_out) {
98 static __thread
char buf[16];
99 return build_sgr256_fg(buf, fg, len_out);
103 static __thread
char buf[32];
104 return build_sgr256_fgbg(buf, fg, bg, len_out);
109 static const char RESET[] =
"\033[0m";
110 memcpy(dst, RESET,
sizeof(RESET) - 1);
111 return dst + (
sizeof(RESET) - 1);
131 }
else if (rd->
len == 2) {
146 }
else if (gd->
len == 2) {
161 }
else if (bd->
len == 2) {
192 }
else if (rd->
len == 2) {
207 }
else if (gd->
len == 2) {
222 }
else if (bd->
len == 2) {
254 }
else if (d->
len == 2) {
269 }
else if (d->
len == 2) {
284 }
else if (d->
len == 2) {
307 }
else if (d->
len == 2) {
322 }
else if (d->
len == 2) {
337 }
else if (d->
len == 2) {
355 return (
int)(result - dst);
360 return (
int)(result - dst);
379 (void)use_background_mode;
383#elif SIMD_SUPPORT_SSSE3
384 return render_ascii_ssse3_unified_optimized(image, use_background_mode, use_256color, ascii_chars);
385#elif SIMD_SUPPORT_SSE2
386 return render_ascii_sse2_unified_optimized(image, use_background_mode, use_256color, ascii_chars);
387#elif SIMD_SUPPORT_NEON
388 return render_ascii_neon_unified_optimized(image, use_background_mode, use_256color, ascii_chars);
392 (void)use_background_mode;
🔌 Cross-platform abstraction layer umbrella header for ascii-chat
SIMD-optimized ASCII conversion interface.
global_dec3_cache_t g_dec3_cache
Global decimal cache instance.
char * append_sgr_reset(char *dst)
Append ANSI reset sequence.
char * append_sgr_truecolor_fg_bg(char *dst, uint8_t fr, uint8_t fg, uint8_t fb, uint8_t br, uint8_t bg, uint8_t bb)
Append truecolor foreground and background SGR sequence.
char * get_sgr256_fg_bg_string(uint8_t fg, uint8_t bg, uint8_t *len_out)
Get 256-color foreground/background ANSI sequence string.
char * image_print_color(const image_t *p, const char *palette)
Print image as ASCII art with color.
void prewarm_sgr256_cache(void)
Prewarm 256-color foreground/background cache for benchmarks.
void prewarm_sgr256_fg_cache(void)
Prewarm 256-color foreground cache for benchmarks.
char * append_sgr_truecolor_bg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Append truecolor background SGR sequence.
char * get_sgr256_fg_string(uint8_t fg, uint8_t *len_out)
Get 256-color foreground ANSI sequence string.
char * append_sgr_truecolor_fg(char *dst, uint8_t r, uint8_t g, uint8_t b)
Append truecolor foreground SGR sequence.
char * image_print_color_simd(image_t *image, bool use_background_mode, bool use_256color, const char *ascii_chars)
Print image as ASCII with color using SIMD.
🔢 Number Formatting and Conversion Utilities
ASCII Palette Management for Video-to-ASCII Conversion.
Decimal conversion cache structure (1-3 digits)
⏱️ High-precision timing utilities using sokol_time.h and uthash
Common SIMD utilities and structures.