ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
palette.h File Reference

ASCII Palette Management for Video-to-ASCII Conversion. More...

Go to the source code of this file.

Data Structures

struct  palette_def_t
 Palette definition structure. More...
 
struct  utf8_capabilities_t
 UTF-8 capability detection structure. More...
 
struct  utf8_char_info_t
 UTF-8 character information structure. More...
 
struct  utf8_palette_t
 UTF-8 palette structure. More...
 

Macros

Built-in Palette Character Strings
#define PALETTE_CHARS_STANDARD   " ...',;:clodxkO0KXNWM"
 Standard ASCII palette character string.
 
#define PALETTE_CHARS_BLOCKS   " ░░▒▒▓▓██"
 Unicode block palette character string.
 
#define PALETTE_CHARS_DIGITAL   " -=≡≣▰▱◼"
 Digital/glitch palette character string.
 
#define PALETTE_CHARS_MINIMAL   " .-+*#"
 Minimal ASCII palette character string.
 
#define PALETTE_CHARS_COOL   " ▁▂▃▄▅▆▇█"
 Cool ascending blocks palette character string.
 

Enumerations

ASCII Palette Types
enum  palette_type_t {
  PALETTE_STANDARD = 0 , PALETTE_BLOCKS , PALETTE_DIGITAL , PALETTE_MINIMAL ,
  PALETTE_COOL , PALETTE_CUSTOM , PALETTE_COUNT
}
 Built-in palette type enumeration. More...
 

Functions

Palette Management Functions
const palette_def_tget_builtin_palette (palette_type_t type)
 Get built-in palette definition.
 
bool validate_palette_chars (const char *chars, size_t len)
 Validate palette character sequence.
 
bool palette_requires_utf8_encoding (const char *chars, size_t len)
 Check if palette requires UTF-8 encoding.
 
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.
 
int apply_palette_config (palette_type_t type, const char *custom_chars)
 Apply palette configuration (set global palette)
 
int build_client_luminance_palette (const char *palette_chars, size_t palette_len, char luminance_mapping[256])
 Build luminance mapping table from palette characters.
 
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.
 
UTF-8 Palette Functions
utf8_palette_tutf8_palette_create (const char *palette_string)
 Create a UTF-8 palette from string.
 
void utf8_palette_destroy (utf8_palette_t *palette)
 Destroy a UTF-8 palette and free resources.
 
const utf8_char_info_tutf8_palette_get_char (const utf8_palette_t *palette, size_t index)
 Get UTF-8 character information at index.
 
size_t utf8_palette_get_char_count (const utf8_palette_t *palette)
 Get number of characters in UTF-8 palette.
 
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.
 
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.
 
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.
 

Variables

Default Palette Constants
const char DEFAULT_ASCII_PALETTE []
 Default ASCII palette for legacy functions.
 
const size_t DEFAULT_ASCII_PALETTE_LEN
 Length of default ASCII palette.
 

Detailed Description

ASCII Palette Management for Video-to-ASCII Conversion.

Definition in file palette.h.