objc

Data Fields
pix_frame_t Struct Reference

Frame structure containing pixel data and drawing operations. More...

#include <runtime-pix/pix.h>

Collaboration diagram for pix_frame_t:
Collaboration graph
[legend]

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...
 

Detailed Description

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.

Definition at line 21 of file frame.h.

Field Documentation

◆ clear_rect

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.

Parameters
framePointer to the frame to operate on
colorColor to fill the rectangle with
originTop-left corner of the rectangle to clear
sizeDimensions of the rectangle to clear. If zero, clears the entire frame.

Completely overwrites existing pixel data in the specified region.

Definition at line 48 of file frame.h.

◆ drawable

bool(* pix_frame_t::drawable) (void)

Check if the framebuffer is currently drawable.

Returns
true if the framebuffer can be safely drawn to, false otherwise.

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.

Definition at line 36 of file frame.h.

◆ get

pix_color_t(* pix_frame_t::get) (struct pix_frame_t *frame, pix_point_t origin)

Get a single pixel value at the specified point.

Parameters
framePointer to the frame to operate on
originCoordinates of the pixel to retrieve
Returns
Color value of the pixel in RGBA32 format

Definition at line 57 of file frame.h.

◆ get_rect

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.

Parameters
framePointer to the frame to operate on
dstDestination buffer for pixel data (can be NULL for size query)
originTop-left corner of the rectangle to retrieve
sizeDimensions of the rectangle to retrieve
Returns
Size in bytes of the retrieved data, or required buffer size if dst is NULL

If dst is NULL, only returns the expected buffer size needed.

Definition at line 79 of file frame.h.

◆ set

void(* pix_frame_t::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.

Parameters
framePointer to the frame to operate on
colorColor value to set (RGBA32 format)
originCoordinates of the pixel to set
opPixel operation to perform (e.g., set, blend, etc.)

Definition at line 66 of file frame.h.

◆ set_rect

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.

Parameters
framePointer to the frame to operate on
srcSource buffer containing RGBA32 pixel data
originTop-left corner where the rectangle should be placed
sizeDimensions of the rectangle to set
opPixel operation to perform for each pixel

Definition at line 90 of file frame.h.


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