MPLABĀ® Harmony Graphics Suite
GFX v3.13.0
Legato API Documentation
|
GFX driver functions and definitions. More...
#include <stddef.h>
#include <assert.h>
#include <string.h>
#include <stdint.h>
Data Structures | |
struct | gfxPoint |
This struct represents a point. More... | |
struct | gfxSize |
This struct represents a size. More... | |
struct | gfxRect |
This struct represents a rectangle. More... | |
struct | gfxLayerState |
This struct represents a layer state. More... | |
struct | gfxColorModeInfo |
This struct represents color mode information. More... | |
struct | gfxPixelBuffer |
This struct represents a pixel buffer. More... | |
struct | gfxIOCTLArg_Value |
This struct represents a standard IOCTL value argument. More... | |
struct | gfxIOCTLArg_DisplaySize |
This struct represents a standard IOCTL size value argument. More... | |
struct | gfxIOCTLArg_Palette |
This struct represents an IOCTL palette argument. More... | |
struct | gfxIOCTLArg_LayerArg |
This struct represents a basic layer request argument. More... | |
struct | gfxIOCTLArg_LayerIRQCallback |
This struct represents layer IRQ callback. More... | |
struct | gfxIOCTLArg_LayerPosition |
This struct represents layer position. More... | |
struct | gfxIOCTLArg_LayerSize |
This struct represents layer size. More... | |
struct | gfxIOCTLArg_LayerRect |
This struct represents a layer rectangle. More... | |
struct | gfxIOCTLArg_LayerValue |
This struct represents a common layer value. More... | |
struct | gfxDisplayDriver |
This struct represents the display driver interface. More... | |
struct | gfxGraphicsProcessor |
This struct represents the graphics processor interface. More... | |
Typedefs | |
typedef uint32_t | gfxColor |
typedef enum gfxResult | gfxResult |
This enum represents function call results. More... | |
typedef enum gfxBool | gfxBool |
This enum represents booleans. More... | |
typedef struct gfxPoint | gfxPoint |
This struct represents a point. More... | |
typedef struct gfxSize | gfxSize |
This struct represents a size. More... | |
typedef struct gfxRect | gfxRect |
This struct represents a rectangle. More... | |
typedef struct gfxLayerState | gfxLayerState |
This struct represents a layer state. More... | |
typedef void * | gfxBuffer |
This type represents a buffer;. | |
typedef enum gfxColorMask | gfxColorMask |
This enum represents a color mask. More... | |
typedef enum gfxColorMode | gfxColorMode |
This enum represents color modes. More... | |
typedef enum gfxBitsPerPixel | gfxBitsPerPixel |
This enum represents bits per pixel (BPP). More... | |
typedef struct gfxColorModeInfo | gfxColorModeInfo |
This struct represents color mode information. More... | |
typedef enum gfxOrientation | gfxOrientation |
This enum represents orientation modes. More... | |
typedef enum gfxBlend | gfxBlend |
This enum represents blend modes. More... | |
typedef enum gfxAlpha | gfxAlpha |
This enum represents alpha modes. More... | |
typedef enum gfxTransparency | gfxTransparency |
This enum represents transparency modes. More... | |
typedef enum gfxPaletteSelect | gfxPaletteSelect |
typedef struct gfxPixelBuffer | gfxPixelBuffer |
This struct represents a pixel buffer. More... | |
typedef void(* | gfxBlitCallBack) (void) |
typedef void(* | gfxIRQCallBack) (uintptr_t layerID) |
typedef enum gfxDriverIOCTLRequest | gfxDriverIOCTLRequest |
This struct represents the possible IOCTL requests for a gfx driver. More... | |
typedef enum gfxDriverIOCTLResponse | gfxDriverIOCTLResponse |
This enum represents the possible IOCTL responses for a gfx driver. More... | |
typedef struct gfxIOCTLArg_Value | gfxIOCTLArg_Value |
This struct represents a standard IOCTL value argument. More... | |
typedef struct gfxIOCTLArg_DisplaySize | gfxIOCTLArg_DisplaySize |
This struct represents a standard IOCTL size value argument. More... | |
typedef struct gfxIOCTLArg_Palette | gfxIOCTLArg_Palette |
This struct represents an IOCTL palette argument. More... | |
typedef struct gfxDisplayDriver | gfxDisplayDriver |
This struct represents the display driver interface. More... | |
typedef struct gfxGraphicsProcessor | gfxGraphicsProcessor |
This struct represents the graphics processor interface. More... | |
Enumerations | |
enum | gfxResult { GFX_FAILURE = -1, GFX_SUCCESS = 0 } |
This enum represents function call results. More... | |
enum | gfxBool { GFX_FALSE = 0, GFX_TRUE } |
This enum represents booleans. More... | |
enum | gfxColorMask { GFX_COLOR_MASK_GS_8 = 0x1, GFX_COLOR_MASK_PALETTE = 0x1, GFX_COLOR_MASK_RGB_332 = 0x4, GFX_COLOR_MASK_RGB_565 = 0x8, GFX_COLOR_MASK_RGBA_5551 = 0x10, GFX_COLOR_MASK_RGB_888 = 0x20, GFX_COLOR_MASK_RGBA_8888 = 0x40, GFX_COLOR_MASK_ARGB_8888 = 0x80, GFX_COLOR_MASK_ALL } |
This enum represents a color mask. More... | |
enum | gfxColorMode { GFX_COLOR_MODE_GS_8 = 0, GFX_COLOR_MODE_PALETTE = GFX_COLOR_MODE_GS_8, GFX_COLOR_MODE_RGB_332 = 1, GFX_COLOR_MODE_RGB_565 = 2, GFX_COLOR_MODE_RGBA_5551 = 3, GFX_COLOR_MODE_RGB_888 = 4, GFX_COLOR_MODE_RGBA_8888 = 5, GFX_COLOR_MODE_ARGB_8888 = 6, GFX_COLOR_MODE_INDEX_1 = 7, GFX_COLOR_MODE_INDEX_4 = 8, GFX_COLOR_MODE_INDEX_8 = 9, GFX_COLOR_MODE_MONOCHROME = 10, GFX_COLOR_MODE_LAST = GFX_COLOR_MODE_MONOCHROME } |
This enum represents color modes. More... | |
enum | gfxBitsPerPixel { GFX_BPP1, GFX_BPP4, GFX_BPP8, GFX_BPP16, GFX_BPP24, GFX_BPP32 } |
This enum represents bits per pixel (BPP). More... | |
enum | gfxOrientation { GFX_ORIENT_0, GFX_ORIENT_90, GFX_ORIENT_180, GFX_ORIENT_270 } |
This enum represents orientation modes. More... | |
enum | gfxBlend { GFX_BLEND_NONE, GFX_BLEND_SRC_OVER, GFX_BLEND_DST_OVER, GFX_BLEND_SRC_IN, GFX_BLEND_DST_IN, GFX_BLEND_ADDITIVE, GFX_BLEND_SUBTRACT } |
This enum represents blend modes. More... | |
enum | gfxAlpha { GFX_GLOBAL_ALPHA_OFF, GFX_GLOBAL_ALPHA_ON, GFX_GLOBAL_ALPHA_SCALE } |
This enum represents alpha modes. More... | |
enum | gfxTransparency { GFX_TRANSPARENCY_NONE, GFX_TRANSPARENCY_SOURCE, GFX_TRANSPARENCY_DESTINATION } |
This enum represents transparency modes. More... | |
enum | gfxPaletteSelect { GFX_PALETTE_ONE, GFX_PALETTE_TWO } |
enum | gfxBufferFlags { GFX_BF_NONE = 0, GFX_BF_LOCKED = 1 << 0 } |
This enum represents buffer flags. More... | |
enum | gfxDriverIOCTLRequest { GFX_IOCTL_RESET, GFX_IOCTL_GET_COLOR_MODE, GFX_IOCTL_GET_BUFFER_COUNT, GFX_IOCTL_GET_DISPLAY_SIZE, GFX_IOCTL_GET_STATUS, GFX_IOCTL_ENABLE_GPU, GFX_IOCTL_LAYER_SWAP, GFX_IOCTL_FRAME_START, GFX_IOCTL_FRAME_END, GFX_IOCTL_GET_VSYNC_COUNT, GFX_IOCTL_GET_FRAMEBUFFER, GFX_IOCTL_SET_PALETTE, GFX_IOCTL_SET_VBLANK_SYNC, GFX_IOCTL_GET_LAYER_COUNT, GFX_IOCTL_GET_ACTIVE_LAYER, GFX_IOCTL_SET_ACTIVE_LAYER, GFX_IOCTL_SET_BRIGHTNESS, GFX_IOCTL_SET_LAYER_LOCK, GFX_IOCTL_GET_LAYER_ENABLED, GFX_IOCTL_SET_LAYER_ENABLED, GFX_IOCTL_SET_LAYER_UNLOCK, GFX_IOCTL_GET_LAYER_RECT, GFX_IOCTL_SET_LAYER_POSITION, GFX_IOCTL_SET_LAYER_SIZE, GFX_IOCTL_SET_LAYER_WINDOW_SIZE, GFX_IOCTL_SET_LAYER_ALPHA, GFX_IOCTL_SET_LAYER_BASE_ADDRESS, GFX_IOCTL_SET_LAYER_COLOR_MODE, GFX_IOCTL_SET_BLIT_CALLBACK, GFX_IOCTL_SET_IRQ_CALLBACK } |
This struct represents the possible IOCTL requests for a gfx driver. More... | |
enum | gfxDriverIOCTLResponse { GFX_IOCTL_UNSUPPORTED = -1, GFX_IOCTL_OK = 0, GFX_IOCTL_ERROR_UNKNOWN = 1 } |
This enum represents the possible IOCTL responses for a gfx driver. More... | |
Functions | |
uint32_t | gfxColorChannelRed (gfxColor clr, gfxColorMode mode) |
Get red channel. More... | |
uint32_t | gfxColorChannelGreen (gfxColor clr, gfxColorMode mode) |
Get green channel. More... | |
uint32_t | gfxColorChannelBlue (gfxColor clr, gfxColorMode mode) |
Get blue channel. More... | |
uint32_t | gfxColorChannelAlpha (gfxColor clr, gfxColorMode mode) |
Get alpha channel. More... | |
gfxColor | gfxColorConvert (gfxColorMode mode_in, gfxColorMode mode_out, gfxColor color) |
gfxResult | gfxPixelBufferCreate (const int32_t width, const int32_t height, const gfxColorMode mode, const void *const address, gfxPixelBuffer *buffer) |
Create pixel buffer. More... | |
gfxBuffer | gfxPixelBufferOffsetGet (const gfxPixelBuffer *const buffer, uint32_t x, uint32_t y) |
Get buffer offset. More... | |
gfxBuffer | gfxPixelBufferOffsetGet_Unsafe (const gfxPixelBuffer *const buffer, uint32_t x, uint32_t y) |
Get buffer offset. More... | |
gfxColor | gfxPixelBufferGet (const gfxPixelBuffer *const buffer, uint32_t x, uint32_t y) |
Get pixel. More... | |
gfxColor | gfxPixelBufferGet_Unsafe (const gfxPixelBuffer *const buffer, uint32_t x, uint32_t y) |
Get pixel. More... | |
gfxColor | gfxPixelBufferGetIndex (const gfxPixelBuffer *const buffer, const uint32_t idx) |
Get pixel at index. More... | |
gfxColor | gfxPixelBufferGetIndex_Unsafe (const gfxPixelBuffer *const buffer, const uint32_t idx) |
Get pixel at index. More... | |
gfxBool | gfxPixelBuffer_IsLocked (const gfxPixelBuffer *const buffer) |
Determine if buffer is locked. More... | |
gfxResult | gfxPixelBuffer_SetLocked (gfxPixelBuffer *buffer, gfxBool locked) |
Set locked state. More... | |
Variables | |
const gfxColorModeInfo | gfxColorInfoTable [] |
This array represents a color information reference table. | |
GFX driver functions and definitions.
This file defines the common macros and definitions used by the MPLAB Harmony Graphics Suite drivers
This enum represents alpha modes.
Global alpha modes are used to define the type of global alpha blending operations.
typedef enum gfxBitsPerPixel gfxBitsPerPixel |
This enum represents bits per pixel (BPP).
List of commonly BPP values to represent color depth.
This enum represents blend modes.
Blend modes are used to define the type of blend function.
This enum represents booleans.
Boolean are used to communicate true and false conditions.
typedef enum gfxColorMask gfxColorMask |
This enum represents a color mask.
Colormask is maskable list of color values to extract color components.
typedef enum gfxColorMode gfxColorMode |
This enum represents color modes.
Lists the common RGB color representations.
typedef struct gfxColorModeInfo gfxColorModeInfo |
This struct represents color mode information.
Color mode information is use to keep track of specific information about a color.
typedef struct gfxDisplayDriver gfxDisplayDriver |
This struct represents the display driver interface.
Establishes the interface for a Legato display driver. All drivers must, at a minimum, implement these interfaces. Interfaces with gfxResult can return unsuccessful if not supported.
typedef enum gfxDriverIOCTLRequest gfxDriverIOCTLRequest |
This struct represents the possible IOCTL requests for a gfx driver.
This struct represents the possible IOCTL requests for a gfx driver.
typedef enum gfxDriverIOCTLResponse gfxDriverIOCTLResponse |
This enum represents the possible IOCTL responses for a gfx driver.
This enum represents the possible IOCTL responses for a gfx driver.
typedef struct gfxGraphicsProcessor gfxGraphicsProcessor |
This struct represents the graphics processor interface.
Establishes the interface for a Legato GPU driver. All drivers must, at a minimum, implement these interfaces. Interfaces that return gfxResult can return unsuccessful if not supported.
typedef struct gfxIOCTLArg_DisplaySize gfxIOCTLArg_DisplaySize |
This struct represents a standard IOCTL size value argument.
This struct represents a standard IOCTL size value argument.
typedef struct gfxIOCTLArg_Palette gfxIOCTLArg_Palette |
This struct represents an IOCTL palette argument.
This struct represents an IOCTL palette value argument.
typedef struct gfxIOCTLArg_Value gfxIOCTLArg_Value |
This struct represents a standard IOCTL value argument.
This struct represents a standard IOCTL value argument.
typedef struct gfxLayerState gfxLayerState |
This struct represents a layer state.
This structure is provided by the driver to describe layer state.
typedef enum gfxOrientation gfxOrientation |
This enum represents orientation modes.
List of buffer orientations. Orientation is orthogonal. Rotation which is not parallel to the x or y axis is not supported.
typedef struct gfxPixelBuffer gfxPixelBuffer |
This struct represents a pixel buffer.
A pixel buffer is a wrapper around a basic data pointer. A pixel buffer has a color mode, a pixel count, a rectangular dimension, a pixel count, and a length in bytes.
This struct represents a point.
A point is used to define a two dimensional Cartesian coordinate.
This struct represents a rectangle.
A rectangle defines a rectangle boundary.
This enum represents function call results.
Results are used to report success and failure conditions. These are the various success and failure codes.
This struct represents a size.
A size is use to communicate the width and height of objects.
typedef enum gfxTransparency gfxTransparency |
This enum represents transparency modes.
Transparency modes are used to define the target of transparency to perform.
enum gfxAlpha |
This enum represents alpha modes.
Global alpha modes are used to define the type of global alpha blending operations.
enum gfxBitsPerPixel |
This enum represents bits per pixel (BPP).
List of commonly BPP values to represent color depth.
enum gfxBlend |
This enum represents blend modes.
Blend modes are used to define the type of blend function.
enum gfxBool |
This enum represents booleans.
Boolean are used to communicate true and false conditions.
enum gfxBufferFlags |
This enum represents buffer flags.
List of buffer status conditions.
enum gfxColorMask |
This enum represents a color mask.
Colormask is maskable list of color values to extract color components.
enum gfxColorMode |
This enum represents color modes.
Lists the common RGB color representations.
This struct represents the possible IOCTL requests for a gfx driver.
This struct represents the possible IOCTL requests for a gfx driver.
This enum represents the possible IOCTL responses for a gfx driver.
This enum represents the possible IOCTL responses for a gfx driver.
enum gfxOrientation |
This enum represents orientation modes.
List of buffer orientations. Orientation is orthogonal. Rotation which is not parallel to the x or y axis is not supported.
Enumerator | |
---|---|
GFX_ORIENT_0 | Buffer is 0 degrees rotated. |
GFX_ORIENT_90 | Buffer is 90 degrees rotated. |
GFX_ORIENT_180 | Buffer is 180 degrees rotated. |
GFX_ORIENT_270 | Buffer is 270 degrees rotated. |
enum </#if ><#if setTransFunc !="NULL"> gfxResult |
This enum represents function call results.
Results are used to report success and failure conditions. These are the various success and failure codes.
enum gfxTransparency |
This enum represents transparency modes.
Transparency modes are used to define the target of transparency to perform.
uint32_t gfxColorChannelAlpha | ( | gfxColor | clr, |
gfxColorMode | mode | ||
) |
Get alpha channel.
Returns the alpha channel from clr using mode.
clr | is an rgb color. |
mode | is an rgb colormode. |
uint32_t gfxColorChannelBlue | ( | gfxColor | clr, |
gfxColorMode | mode | ||
) |
Get blue channel.
Returns the blue channel from clr using mode.
clr | is an rgb color. |
mode | is an rgb colormode. |
uint32_t gfxColorChannelGreen | ( | gfxColor | clr, |
gfxColorMode | mode | ||
) |
Get green channel.
Returns the green channel from clr using mode.
clr | is an rgb color. |
mode | is an rgb colormode. |
uint32_t gfxColorChannelRed | ( | gfxColor | clr, |
gfxColorMode | mode | ||
) |
Get red channel.
Returns the red channel from clr using mode.
clr | is an rgb color. |
mode | is an rgb colormode. |
gfxBool gfxPixelBuffer_IsLocked | ( | const gfxPixelBuffer *const | buffer | ) |
Determine if buffer is locked.
Returns locked status of buffer.
buffer | is pixel buffer. |
gfxResult gfxPixelBuffer_SetLocked | ( | gfxPixelBuffer * | buffer, |
gfxBool | locked | ||
) |
Set locked state.
Sets the lock state of buffer.
buffer | is pixel buffer to modify. |
locked | is new lock state. |
gfxResult gfxPixelBufferCreate | ( | const int32_t | width, |
const int32_t | height, | ||
const gfxColorMode | mode, | ||
const void *const | address, | ||
gfxPixelBuffer * | buffer | ||
) |
Create pixel buffer.
Initializes a rectangular pixel buffer buffer with size x by y using mode at optional address address.
width | is the horizonal width. |
height | is the vertical height. |
mode | is an rgb colormode. |
address | is an optional address location. |
buffer | is buffer to initialize. |
gfxColor gfxPixelBufferGet | ( | const gfxPixelBuffer *const | buffer, |
uint32_t | x, | ||
uint32_t | y | ||
) |
Get pixel.
Gets the pixel from buffer at location x and y.
buffer | is pixel buffer. |
x | is a x coordinate. |
y | is a y coordinate. |
gfxColor gfxPixelBufferGet_Unsafe | ( | const gfxPixelBuffer *const | buffer, |
uint32_t | x, | ||
uint32_t | y | ||
) |
Get pixel.
Gets the pixel from buffer at location x and y.
buffer | is pixel buffer. |
x | is a x coordinate. |
y | is a y coordinate. |
gfxColor gfxPixelBufferGetIndex | ( | const gfxPixelBuffer *const | buffer, |
const uint32_t | idx | ||
) |
Get pixel at index.
Gets the pixel from buffer at index idx. Interprets the pixel buffer as a table of indices and looks up a specific index at position 'idx'. Indices may be 1bpp, 4bpp, or 8bpp in size and are indicated by the color mode of the pixel buffer.
buffer | is pixel buffer. |
idx | is a location. |
gfxColor gfxPixelBufferGetIndex_Unsafe | ( | const gfxPixelBuffer *const | buffer, |
const uint32_t | idx | ||
) |
Get pixel at index.
Gets the pixel from buffer at index idx. Interprets the pixel buffer as a table of indices and looks up a specific index at position 'idx'. Indices may be 1bpp, 4bpp, or 8bpp in size and are indicated by the color mode of the pixel buffer. A faster less-safe version of gfxPixelBufferGetIndex;
buffer | is pixel buffer. |
idx | is a location. |
gfxBuffer gfxPixelBufferOffsetGet | ( | const gfxPixelBuffer *const | buffer, |
uint32_t | x, | ||
uint32_t | y | ||
) |
Get buffer offset.
Gets the buffer offset of buffer at location x and y.
buffer | is pixel buffer. |
x | is a x coordinate. |
y | is a y coordinate. |
gfxBuffer gfxPixelBufferOffsetGet_Unsafe | ( | const gfxPixelBuffer *const | buffer, |
uint32_t | x, | ||
uint32_t | y | ||
) |
Get buffer offset.
Gets the buffer offset of buffer at location x and y.
buffer | is pixel buffer. |
x | is a x coordinate. |
y | is a y coordinate. |