141 char terminal_type[32];
143 char locale_encoding[16];
159#define PALETTE_CHARS_STANDARD " ...',;:clodxkO0KXNWM"
168#define PALETTE_CHARS_BLOCKS " ░░▒▒▓▓██"
177#define PALETTE_CHARS_DIGITAL " -=≡≣▰▱◼"
186#define PALETTE_CHARS_MINIMAL " .-+*#"
195#define PALETTE_CHARS_COOL " ▁▂▃▄▅▆▇█"
422 size_t *client_palette_len,
char client_luminance_palette[256]);
553 size_t *indices,
size_t max_indices);
uint8_t byte_len
Number of bytes in UTF-8 encoding (1-4)
void utf8_palette_destroy(utf8_palette_t *palette)
Destroy a UTF-8 palette and free resources.
size_t utf8_palette_find_all_char_indices(const utf8_palette_t *palette, const char *utf8_char, size_t char_bytes, size_t *indices, size_t max_indices)
Find all indices of UTF-8 character in palette.
int initialize_client_palette(palette_type_t palette_type, const char *custom_chars, char client_palette_chars[256], size_t *client_palette_len, char client_luminance_palette[256])
Initialize client palette with full configuration.
size_t char_count
Number of characters (not bytes!)
bool palette_requires_utf8_encoding(const char *chars, size_t len)
Check if palette requires UTF-8 encoding.
size_t utf8_palette_get_char_count(const utf8_palette_t *palette)
Get number of characters in UTF-8 palette.
const char * name
Human-readable palette name.
bool detect_client_utf8_support(utf8_capabilities_t *caps)
Detect client UTF-8 support capabilities.
palette_type_t select_compatible_palette(palette_type_t requested, bool client_utf8)
Select compatible palette based on client capabilities.
bool utf8_support
True if terminal supports UTF-8 (detected automatically)
const size_t DEFAULT_ASCII_PALETTE_LEN
Length of default ASCII palette.
utf8_char_info_t * chars
Array of UTF-8 character information.
const char DEFAULT_ASCII_PALETTE[]
Default ASCII palette for legacy functions.
uint8_t display_width
Terminal display width in character cells (1-2)
const palette_def_t * get_builtin_palette(palette_type_t type)
Get built-in palette definition.
palette_type_t
Built-in palette type enumeration.
int apply_palette_config(palette_type_t type, const char *custom_chars)
Apply palette configuration (set global palette)
bool requires_utf8
True if palette contains UTF-8 multi-byte characters.
int build_client_luminance_palette(const char *palette_chars, size_t palette_len, char luminance_mapping[256])
Build luminance mapping table from palette characters.
size_t total_bytes
Total byte length of palette string.
bool is_validated
True if palette passed validation checks.
size_t utf8_palette_find_char_index(const utf8_palette_t *palette, const char *utf8_char, size_t char_bytes)
Find index of UTF-8 character in palette.
bool validate_palette_chars(const char *chars, size_t len)
Validate palette character sequence.
const char * chars
Character sequence (ordered from dark to light)
const utf8_char_info_t * utf8_palette_get_char(const utf8_palette_t *palette, size_t index)
Get UTF-8 character information at index.
char * raw_string
Original palette string (for reference/debugging)
bool forced_utf8
True if user forced UTF-8 via –utf8 flag.
size_t length
Number of characters in sequence.
bool utf8_palette_contains_char(const utf8_palette_t *palette, const char *utf8_char, size_t char_bytes)
Check if UTF-8 palette contains a specific character.
utf8_palette_t * utf8_palette_create(const char *palette_string)
Create a UTF-8 palette from string.
@ PALETTE_COUNT
Number of palette types (not a valid palette)
@ PALETTE_BLOCKS
Unicode block characters: " ░░▒▒▓▓██".
@ PALETTE_CUSTOM
User-defined via –palette-chars.
@ PALETTE_COOL
Ascending blocks: " ▁▂▃▄▅▆▇█".
@ PALETTE_STANDARD
Standard ASCII palette: " ...',;:clodxkO0KXNWM".
@ PALETTE_DIGITAL
Digital/glitch aesthetic: " -=≡≣▰▱◼".
@ PALETTE_MINIMAL
Simple ASCII: " .-+*#".
Palette definition structure.
UTF-8 capability detection structure.
UTF-8 character information structure.