60#include "../platform/abstraction.h"
164#define IMAGE_MAX_WIDTH 3840
177#define IMAGE_MAX_HEIGHT 2160
191#define IMAGE_MAX_PIXELS_SIZE (IMAGE_MAX_WIDTH * IMAGE_MAX_HEIGHT * sizeof(rgb_pixel_t))
351#include "../platform/terminal.h"
379 const char luminance_palette[256]);
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_interpolation(const image_t *source, image_t *dest)
Resize image using bilinear interpolation.
char * image_print_16color_dithered(const image_t *image, const char *palette)
Print image using 16-color ANSI mode with dithering.
char * image_print(const image_t *p, const char *palette)
Print image as ASCII art (monochrome)
void image_destroy_to_pool(image_t *image)
Destroy an image allocated from buffer pool.
char * image_print_color(const image_t *p, const char *palette)
Print image as ASCII art with color.
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.
image_alloc_method_t
Pixel allocation method tracking.
char * image_print_16color(const image_t *image, const char *palette)
Print image using 16-color ANSI mode.
char * rgb_to_ansi_fg(int r, int g, int b)
Convert RGB to ANSI foreground color code.
void image_clear(image_t *p)
Clear image (set all pixels to black)
void image_resize(const image_t *source, image_t *dest)
Resize image using nearest-neighbor interpolation.
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.
char * image_print_with_capabilities(const image_t *image, const terminal_capabilities_t *caps, const char *palette, const char luminance_palette[256])
Print image with terminal capability awareness.
char * image_print_256color(const image_t *image, const char *palette)
Print image using 256-color ANSI mode.
image_t * image_new_from_pool(size_t width, size_t height)
Create a new image from buffer pool.
void image_destroy(image_t *p)
Destroy an image allocated with image_new()
image_t * image_new(size_t width, size_t height)
Create a new image with standard allocation.
@ IMAGE_ALLOC_POOL
Pixels allocated with buffer_pool_alloc()
@ IMAGE_ALLOC_SIMD
Pixels allocated with SAFE_MALLOC_SIMD()
uint8_t g
Green color component (0-255)
uint8_t padding
Padding byte to align to 4-byte boundary (SIMD alignment)
uint8_t r
Red color component (0-255)
uint8_t b
Blue color component (0-255)
int w
Image width in pixels (must be > 0)
uint8_t alloc_method
Allocation method (image_alloc_method_t) for correct deallocation.
int h
Image height in pixels (must be > 0)
rgb_pixel_t * pixels
Pixel data array (width * height RGB pixels, row-major order)
Complete terminal capabilities structure.