ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches
image_t Struct Reference

Image structure. More...

#include <lib/video/image.h>

Data Fields

int w
 Image width in pixels (must be > 0)
 
int h
 Image height in pixels (must be > 0)
 
rgb_pixel_t * pixels
 Pixel data array (width * height RGB pixels, row-major order)
 
uint8_t alloc_method
 Allocation method (image_alloc_method_t) for correct deallocation.
 

Detailed Description

Image structure.

Complete image structure containing dimensions and pixel data. Pixel data is stored as a contiguous array of RGB pixels in row-major order. Compatible with webcam capture and image processing pipeline.

MEMORY LAYOUT:

  • pixels array is allocated separately from image structure (except for pool alloc)
  • pixels array size: width * height * sizeof(rgb_pixel_t)
  • Pixel access: pixels[row * width + col]
  • Row-major order (first row, then second row, etc.)
Note
Pixel array must be allocated (by image_new() or image_new_from_pool()).
Image structure and pixels array can be freed separately if needed.
Compatible with webcam capture functions (webcam_read()).
alloc_method tracks allocation source for correct deallocation.

Definition at line 141 of file video/image.h.

Field Documentation

◆ alloc_method

uint8_t image_t::alloc_method

Allocation method (image_alloc_method_t) for correct deallocation.

Definition at line 145 of file video/image.h.

Referenced by image_destroy(), image_new(), and image_new_from_pool().

◆ h

◆ pixels

◆ w


The documentation for this struct was generated from the following file: