40#if defined(_WIN32) && defined(__clang__) && __clang_major__ >= 20
45#if defined(__ARM_FEATURE_SVE) && !defined(SIMD_SUPPORT_SVE)
46#define SIMD_SUPPORT_SVE 1
49#if defined(__AVX2__) && !defined(SIMD_SUPPORT_AVX2)
50#define SIMD_SUPPORT_AVX2 1
53#if defined(__SSE2__) && !defined(SIMD_SUPPORT_SSE2)
54#define SIMD_SUPPORT_SSE2 1
57#if defined(__SSSE3__) && !defined(SIMD_SUPPORT_SSSE3)
58#define SIMD_SUPPORT_SSSE3 1
61#if defined(__ARM_NEON) && !defined(SIMD_SUPPORT_NEON)
62#define SIMD_SUPPORT_NEON 1
78#define LUMA_THRESHOLD 128
252void convert_pixels_scalar(
const rgb_pixel_t *pixels,
char *ascii_chars,
int count,
const char luminance_palette[256]);
318 const image_t *source_image,
bool use_256color);
333 bool background_mode,
const image_t *source_image,
447 const uint8_t *fg_idx,
const uint8_t *bg_idx,
const char *ascii_chars,
448 int width,
char *dst,
size_t cap,
bool is_truecolor);
454#if SIMD_SUPPORT_SSSE3
AVX2-optimized ASCII rendering functions.
simd_benchmark_t benchmark_simd_color_conversion(int width, int height, int iterations, bool background_mode)
Benchmark SIMD color conversion methods.
global_dec3_cache_t g_dec3_cache
Global decimal cache instance.
char * get_sgr256_fg_bg_string(uint8_t fg, uint8_t bg, uint8_t *len_out)
Get 256-color foreground/background ANSI sequence string.
void set_color_quality_mode(bool high_quality)
Set color quality mode.
simd_benchmark_t benchmark_simd_conversion(int width, int height, int iterations)
Benchmark SIMD conversion methods (monochrome)
char * convert_pixels_scalar_with_newlines(image_t *image, const char luminance_palette[256])
Convert image to ASCII with newlines (scalar fallback)
void init_dec3(void)
Initialize decimal lookup table.
void str_reserve(Str *s, size_t need)
Reserve space in string buffer.
void str_printf(Str *s, const char *fmt,...)
Append formatted string to buffer.
void str_free(Str *s)
Free string buffer.
size_t write_row_rep_from_arrays_enhanced(const uint8_t *fg_r, const uint8_t *fg_g, const uint8_t *fg_b, const uint8_t *bg_r, const uint8_t *bg_g, const uint8_t *bg_b, const uint8_t *fg_idx, const uint8_t *bg_idx, const char *ascii_chars, int width, char *dst, size_t cap, bool is_truecolor)
Enhanced REP compression writer.
void str_append_c(Str *s, char c)
Append character to string buffer.
void str_init(Str *s)
Initialize string buffer.
simd_benchmark_t benchmark_simd_color_conversion_with_source(int width, int height, int iterations, bool background_mode, const image_t *source_image, bool use_256color)
Benchmark SIMD color conversion with source image.
void prewarm_sgr256_cache(void)
Prewarm 256-color foreground/background cache for benchmarks.
void print_simd_capabilities(void)
Print detected SIMD capabilities.
simd_benchmark_t benchmark_simd_conversion_with_source(int width, int height, int iterations, bool background_mode, const image_t *source_image, bool use_256color)
Benchmark SIMD conversion with source image.
void convert_pixels_scalar(const rgb_pixel_t *pixels, char *ascii_chars, int count, const char luminance_palette[256])
Convert pixels to ASCII (scalar fallback)
bool get_256_color_fast_path(void)
Get 256-color fast path setting.
char g_default_luminance_palette[256]
Default luminance palette (256 characters)
void prewarm_sgr256_fg_cache(void)
Prewarm 256-color foreground cache for benchmarks.
ImageRGB alloc_image(int w, int h)
Allocate a new ImageRGB (RGB8 format)
char * get_sgr256_fg_string(uint8_t fg, uint8_t *len_out)
Get 256-color foreground ANSI sequence string.
char * image_print_simd(image_t *image, const char *ascii_chars)
Print image as ASCII using SIMD (monochrome)
void init_default_luminance_palette(void)
Initialize default luminance palette.
void str_append_bytes(Str *s, const void *src, size_t n)
Append bytes to string buffer.
void ascii_simd_init(void)
Initialize SIMD subsystem.
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.
NEON-optimized ASCII rendering functions.
SSE2-optimized ASCII rendering functions.
SSSE3-optimized ASCII rendering functions.
ImageRGB structure for NEON renderers.
Run-length encoding state for ANSI color optimization.
Dynamic string buffer structure.
Decimal conversion cache structure (1-3 digits)
Global decimal cache for digit conversion.
SIMD benchmark results structure.
SVE-optimized ASCII rendering functions.
Common SIMD utilities and structures.