MPLAB® Harmony Graphics Suite > Graphics Library > Aria Graphics Library > Aria Hardware Abstraction Layer (HAL) > Library Interface > b) Data Types and Constants > GFX_Layer Structure
MPLAB® Harmony Graphics Suite
GFX_Layer Structure

Structure: GFX_Layer_t 

Graphics controllers will typically offer at least one drawing layer for drawing purposes. More advanced controllers may offer several. Layers are often configurable, offering independent positioning, sizing, color formats, and drawing features. 

uint32_t id - the unique id of the layer 

struct { GFX_Rect display - represents area in display space GFX_Rect local - represents position in local space } rect; 

uint32_t pixel_size - size of a layer pixel in bytes 

GFX_Bool alphaEnable - indicates if layer alpha blending is enabled uint32_t alphaAmount - indicates the amount of alpha blending 

GFX_Bool maskEnable - indicates if layer masking/transparency is enabled uint32_t maskColor - the color to mask 

uint32_t buffer_count - the number of buffers this layer owns uint32_t buffer_read_idx - the index of the current read buffer uint32_t buffer_write_idx - the index of the current write buffer GFX_FrameBuffer buffers[GFX_MAX_BUFFER_COUNT] - the layer buffer array 

GFX_Bool enabled - indicates if the layer is enabled GFX_Bool visible - indicates if the layer is visible 

GFX_Bool swap - indicates if the layer is waiting to advance its buffer chain 

GFX_Bool locked - indicates if the layer's buffers are locked for manipulation. this is typically meant to prevent things like swapping before drawing operations have been completed 

GFX_Bool vsync - indicates if this layer should swap during the display driver's blanking period. if this is true then it is the responsibility of the display driver to call GFX_LayerSwap on this layer during vblank. If this is false then the layer will swap immediately upon application request. 

void* driver_data - this is a pointer that may be allocated by the display driver to store driver-specific per layer data. the driver is responsible for the management of this pointer during the application life cycle

C
typedef struct GFX_Layer_t {
  uint32_t id;
  struct {
    GFX_Rect display;
    GFX_Rect local;
  } rect;
  uint32_t pixel_size;
  GFX_Bool alphaEnable;
  uint32_t alphaAmount;
  GFX_Bool maskEnable;
  uint32_t maskColor;
  uint32_t buffer_count;
  uint32_t buffer_read_idx;
  uint32_t buffer_write_idx;
  GFX_FrameBuffer buffers[GFX_MAX_BUFFER_COUNT];
  GFX_Bool enabled;
  GFX_Bool visible;
  GFX_Bool swap;
  uint32_t swapCount;
  GFX_Bool locked;
  GFX_Bool invalid;
  GFX_Bool vsync;
  void* driver_data;
} GFX_Layer;
Members
Members 
Description 
GFX_Rect display; 
represents area in display space 
GFX_Rect local; 
represents position in local space 
Remarks

None.

MPLAB® Harmony Graphics Suite