Frame structure containing pixel data and drawing operations. More...
#include <runtime-pix/pix.h>
Data Fields | |
pix_point_t | offset |
Offset (in pixels) to the origin within the buffer. | |
pix_size_t | size |
Size of the buffer in pixels. | |
pix_format_t | format |
Pixel format of the buffer. | |
void * | buf |
Raw buffer holding pixel data. | |
size_t | stride |
Bytes per scanline. | |
bool(* | drawable )(void) |
Check if the framebuffer is currently drawable. More... | |
void(* | clear_rect )(struct pix_frame_t *frame, pix_color_t color, pix_point_t origin, pix_size_t size) |
Clear a rectangular region to a solid color. More... | |
pix_color_t(* | get )(struct pix_frame_t *frame, pix_point_t origin) |
Get a single pixel value at the specified point. More... | |
void(* | set )(struct pix_frame_t *frame, pix_color_t color, pix_point_t origin, pix_op_t op) |
Set a single pixel value at the specified point. More... | |
size_t(* | get_rect )(struct pix_frame_t *frame, pix_color_t *dst, pix_point_t origin, pix_size_t size) |
Get a rectangular region of pixels. More... | |
void(* | set_rect )(struct pix_frame_t *frame, pix_color_t *src, pix_point_t origin, pix_size_t size, pix_op_t op) |
Set a rectangular region of pixels from RGBA32 source data. More... | |
Frame structure containing pixel data and drawing operations.
A frame represents a rectangular region of pixels with associated drawing functions. The frame is not thread-safe for performance reasons - callers must provide their own synchronization if needed.
void(* pix_frame_t::clear_rect) (struct pix_frame_t *frame, pix_color_t color, pix_point_t origin, pix_size_t size) |
Clear a rectangular region to a solid color.
frame | Pointer to the frame to operate on |
color | Color to fill the rectangle with |
origin | Top-left corner of the rectangle to clear |
size | Dimensions of the rectangle to clear. If zero, clears the entire frame. |
Completely overwrites existing pixel data in the specified region.
bool(* pix_frame_t::drawable) (void) |
Check if the framebuffer is currently drawable.
This function is set by windowing or device systems that may be concurrently updating the rendered surface. If it is NULL, the frame is always considered drawable.
pix_color_t(* pix_frame_t::get) (struct pix_frame_t *frame, pix_point_t origin) |
size_t(* pix_frame_t::get_rect) (struct pix_frame_t *frame, pix_color_t *dst, pix_point_t origin, pix_size_t size) |
Get a rectangular region of pixels.
frame | Pointer to the frame to operate on |
dst | Destination buffer for pixel data (can be NULL for size query) |
origin | Top-left corner of the rectangle to retrieve |
size | Dimensions of the rectangle to retrieve |
If dst is NULL, only returns the expected buffer size needed.
void(* pix_frame_t::set) (struct pix_frame_t *frame, pix_color_t color, pix_point_t origin, pix_op_t op) |
void(* pix_frame_t::set_rect) (struct pix_frame_t *frame, pix_color_t *src, pix_point_t origin, pix_size_t size, pix_op_t op) |
Set a rectangular region of pixels from RGBA32 source data.
frame | Pointer to the frame to operate on |
src | Source buffer containing RGBA32 pixel data |
origin | Top-left corner where the rectangle should be placed |
size | Dimensions of the rectangle to set |
op | Pixel operation to perform for each pixel |