ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
image.h File Reference

Go to the source code of this file.

Data Structures

struct  rgb_pixel_t
 RGB pixel structure. More...
 
struct  rgb_pixel_simd_t
 SIMD-aligned RGB pixel structure for optimal NEON/AVX performance. More...
 
struct  image_t
 Image structure. More...
 

Macros

#define IMAGE_MAX_WIDTH   3840
 Maximum image width (4K resolution)
 
#define IMAGE_MAX_HEIGHT   2160
 Maximum image height (4K resolution)
 
#define IMAGE_MAX_PIXELS_SIZE   (IMAGE_MAX_WIDTH * IMAGE_MAX_HEIGHT * sizeof(rgb_pixel_t))
 Maximum pixel data size in bytes.
 

Enumerations

enum  image_alloc_method_t { IMAGE_ALLOC_SIMD = 0 , IMAGE_ALLOC_POOL = 1 }
 Pixel allocation method tracking. More...
 

Functions

asciichat_error_t image_render_test_pattern (image_t *image, unsigned int *frame_counter)
 Render animated color bars and grid lines into an existing image.
 
image_t * image_new (size_t width, size_t height)
 Create a new image with standard allocation.
 
void image_destroy (image_t *p)
 Destroy an image allocated with image_new()
 
image_t * image_new_from_pool (size_t width, size_t height)
 Create a new image from buffer pool.
 
void image_destroy_to_pool (image_t *image)
 Destroy an image allocated from buffer pool.
 
void image_clear (image_t *p)
 Clear image (set all pixels to black)
 
image_t * image_new_copy (const image_t *source)
 Create a copy of an existing image.
 
char * image_print (const image_t *p, const char *palette)
 Print image as ASCII art (monochrome)
 
char * image_print_color (const image_t *p, const char *palette)
 Print image as ASCII art with color.
 
char * image_print_with_capabilities (const image_t *image, const terminal_capabilities_t *caps, const char *palette)
 Convert image to ASCII art with terminal capabilities.
 
char * image_print_256color (const image_t *image, const char *palette)
 Print image using 256-color ANSI mode.
 
char * image_print_16color (const image_t *image, const char *palette)
 Print image using 16-color ANSI mode.
 
char * image_print_16color_dithered (const image_t *image, const char *palette)
 Print image using 16-color ANSI mode with dithering.
 
char * image_print_16color_dithered_with_background (const image_t *image, bool use_background, const char *palette)
 Print image using 16-color ANSI mode with dithering and background colors.
 
void quantize_color (int *r, int *g, int *b, int levels)
 Quantize color to specified number of levels.
 
void precalc_rgb_palettes (const float red, const float green, const float blue)
 Precalculate RGB palettes with color adjustment.
 
void image_resize (const image_t *source, image_t *dest)
 Resize image using nearest-neighbor interpolation.
 
void image_resize_interpolation (const image_t *source, image_t *dest)
 Resize image using bilinear interpolation.
 
char * rgb_to_ansi_fg (int r, int g, int b)
 Convert RGB to ANSI foreground color code.
 
char * rgb_to_ansi_bg (int r, int g, int b)
 Convert RGB to ANSI background color code.
 
void rgb_to_ansi_8bit (int r, int g, int b, int *fg_code, int *bg_code)
 Convert RGB to 8-bit ANSI color codes.