⚠️‼️ Error and/or exit() when things go bad.
asciichat_error_t
Error and exit codes - unified status values (0-255)
asciichat_error_t image_validate_buffer_size(size_t requested_size)
Validate buffer size against maximum allocation limit.
asciichat_error_t image_validate_dimensions(size_t width, size_t height)
Validate image dimensions (non-zero, within limits)
asciichat_error_t image_calc_pixel_buffer_size(size_t pixel_count, size_t bytes_per_pixel, size_t *out_size)
Calculate pixel buffer size with overflow checking.
asciichat_error_t image_calc_pixel_count(size_t width, size_t height, size_t *out_pixel_count)
Calculate pixel count with overflow checking.
asciichat_error_t image_calc_rgb_size(size_t width, size_t height, size_t *out_size)
Calculate total RGB buffer size from dimensions.
asciichat_error_t image_calc_total_allocation(size_t width, size_t height, size_t struct_size, size_t bytes_per_pixel, size_t *out_size)
Calculate combined size of image struct + pixel buffer.