MPLABĀ® Harmony Graphics Suite
Data Structures | Typedefs | Enumerations | Functions
legato_pixelbuffer.h File Reference

Pixel Buffer functions and definitions. More...

#include "gfx/legato/common/legato_color.h"
Include dependency graph for legato_pixelbuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lePixelBuffer
 

Typedefs

typedef struct lePixelBuffer lePixelBuffer
 

Enumerations

enum  BufferFlags { BF_NONE = 0, BF_LOCKED = 1 << 0 }
 leArray data structure definition.
 

Functions

LIB_EXPORT leResult lePixelBufferCreate (const int32_t width, const int32_t height, const leColorMode mode, const void *const address, lePixelBuffer *buffer)
 Create a pixelbuffer. More...
 
LIB_EXPORT leBuffer lePixelBufferOffsetGet (const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
 Get buffer at point. More...
 
LIB_EXPORT leBuffer lePixelBufferOffsetGet_Unsafe (const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
 Get buffer at point. More...
 
LIB_EXPORT leColor lePixelBufferGet (const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
 Get pixel at point. More...
 
LIB_EXPORT leColor lePixelBufferGet_Unsafe (const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
 Get pixel at point. More...
 
LIB_EXPORT leColor lePixelBufferGetIndex_Unsafe (const lePixelBuffer *const buffer, const uint32_t idx)
 Get color at index. More...
 
LIB_EXPORT leResult lePixelBufferClipRect (const lePixelBuffer *const buffer, const leRect *const rect, leRect *result)
 Clip rectangle. More...
 
LIB_EXPORT leResult lePixelBufferSet (const lePixelBuffer *const buffer, uint32_t x, uint32_t y, leColor color)
 Pixel set. More...
 
LIB_EXPORT leResult lePixelBufferSet_Unsafe (const lePixelBuffer *const buffer, uint32_t x, uint32_t y, leColor color)
 Pixel set. More...
 
leResult lePixelBufferAreaFill (const lePixelBuffer *const buffer, uint32_t x, uint32_t y, uint32_t w, uint32_t h, const leColor color)
 Area fill with checking. More...
 
LIB_EXPORT leResult lePixelBufferAreaFill_Unsafe (const lePixelBuffer *const buffer, uint32_t x, uint32_t y, uint32_t w, uint32_t h, leColor color)
 Area fill no checking. More...
 
leResult lePixelBufferCopy (lePixelBuffer *dest, uint32_t x, uint32_t y, const lePixelBuffer *src, const leRect *srcRect)
 
LIB_EXPORT leBool lePixelBuffer_IsLocked (const lePixelBuffer *const buffer)
 Determines the lock state. More...
 
LIB_EXPORT leResult lePixelBuffer_SetLocked (lePixelBuffer *buffer, leBool locked)
 Sets the lock. More...
 

Detailed Description

Pixel Buffer functions and definitions.

Pixel buffer generation and management functions.

Function Documentation

◆ lePixelBuffer_IsLocked()

LIB_EXPORT leBool lePixelBuffer_IsLocked ( const lePixelBuffer *const  buffer)

Determines the lock state.

Returns the lock state of buffer.

lePixelBuffer* buffer;
leResult res = lePixelBuffer_SetLocked(buffer, locked);
Parameters
param1buffer is the source color value.
Returns
true if the buffer locked, otherwse false.

◆ lePixelBuffer_SetLocked()

LIB_EXPORT leResult lePixelBuffer_SetLocked ( lePixelBuffer buffer,
leBool  locked 
)

Sets the lock.

Set the lock flag on buffer to the desired lock state specified by locked.

lePixelBuffer* buffer;
leBool locked;
leResult res = lePixelBuffer_SetLocked(buffer, locked);
Parameters
param1buffer is the source color value.
param2locked is the source color mode
Returns
leResult.

◆ lePixelBufferAreaFill()

leResult lePixelBufferAreaFill ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y,
uint32_t  w,
uint32_t  h,
const leColor  color 
)

Area fill with checking.

Fill buffer with color defined by the x, y w, h.

lePixelBuffer* buffer;
leResult res = lePixelBufferAreaFill_Unsafe(buffer, locked);
Parameters
param1buffer is the source color value.
Returns
true if the buffer locked, otherwse false.

◆ lePixelBufferAreaFill_Unsafe()

LIB_EXPORT leResult lePixelBufferAreaFill_Unsafe ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y,
uint32_t  w,
uint32_t  h,
leColor  color 
)

Area fill no checking.

Fill buffer with color defined by the x, y w, h.

lePixelBuffer* buffer;
leResult res = lePixelBufferAreaFill_Unsafe(buffer, locked);
Parameters
param1buffer is the source color value.
Returns
true if the buffer locked, otherwse false.
Here is the call graph for this function:

◆ lePixelBufferClipRect()

LIB_EXPORT leResult lePixelBufferClipRect ( const lePixelBuffer *const  buffer,
const leRect *const  rect,
leRect result 
)

Clip rectangle.

Clips a rectangle against a pixel buffer. The result is guaranteed to fit inside the buffer's area.

lePixelBuffer* buffer;
leResult res = lePixelBufferClipRect(buffer, x, y, color);
Parameters
param1buffer is the source color value.
Returns
leResult.

◆ lePixelBufferCreate()

LIB_EXPORT leResult lePixelBufferCreate ( const int32_t  width,
const int32_t  height,
const leColorMode  mode,
const void *const  address,
lePixelBuffer buffer 
)

Create a pixelbuffer.

lePixelBuffer* buffer;
leResult res = lePixelBufferCreate(buffer, x, y);
Parameters
param1buffer is the source color value.
Returns
leResult.

◆ lePixelBufferGet()

LIB_EXPORT leColor lePixelBufferGet ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y 
)

Get pixel at point.

Gets the value of the pixel that resides at the provided point in the given buffer

lePixelBuffer* buffer;
leColor color = lePixelBufferGet(buffer, x, y);
Parameters
param1buffer is the source color value.
Returns
leColor.
Here is the call graph for this function:

◆ lePixelBufferGet_Unsafe()

LIB_EXPORT leColor lePixelBufferGet_Unsafe ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y 
)

Get pixel at point.

Gets the value of the pixel that resides at the provided point in the given buffer. Like lePixelBufferGet but performs no bounds checking.

lePixelBuffer* buffer;
leColor color = lePixelBufferGetIndex_Unsafe(buffer, idx);
Parameters
param1buffer is the source color value.
Returns
leResult.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ lePixelBufferGetIndex_Unsafe()

LIB_EXPORT leColor lePixelBufferGetIndex_Unsafe ( const lePixelBuffer *const  buffer,
const uint32_t  idx 
)

Get color at index.

Pixel get.

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.

lePixelBuffer* buffer;
leColor color = lePixelBufferGetIndex_Unsafe(buffer, idx);
Parameters
param1buffer is the source color value.
Returns
leResult.

A faster less-safe version of lePixelBufferGetIndex.

lePixelBuffer* buffer;
leColor color = lePixelBufferGetIndex_Unsafe(buffer, idx);
Parameters
param1buffer is the source color value.
Returns
leResult.

Get color at index.

A faster less-safe version of lePixelBufferGetIndex.

lePixelBuffer* buffer;
leColor color = lePixelBufferGetIndex_Unsafe(buffer, idx);
Parameters
param1buffer is the source color value.
Returns
leResult.

◆ lePixelBufferOffsetGet()

LIB_EXPORT leBuffer lePixelBufferOffsetGet ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y 
)

Get buffer at point.

Gets the offset address of the pixel that resides at the provided point in the given buffer.

lePixelBuffer* buffer;
leColor color = lePixelBufferOffsetGet(buffer, x, y);
Parameters
param1buffer is the source color value.
Returns
leBuffer.
Here is the caller graph for this function:

◆ lePixelBufferOffsetGet_Unsafe()

LIB_EXPORT leBuffer lePixelBufferOffsetGet_Unsafe ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y 
)

Get buffer at point.

Gets the offset address of the pixel that resides at the provided point in the given buffer. Similar to lePixelBufferOffsetGet but performs no bounds checking.

lePixelBuffer* buffer;
leColor color = lePixelBufferOffsetGet_Unsafe(buffer, x, y);
Parameters
param1buffer is the source color value.
Returns
leBuffer.
Here is the caller graph for this function:

◆ lePixelBufferSet()

LIB_EXPORT leResult lePixelBufferSet ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y,
leColor  color 
)

Pixel set.

Sets a pixel in a pixel buffer at a point to a specified color. Caller is responsible for ensuring that the input color is in the same color format as the pixel buffer

lePixelBuffer* buffer;
leResult res = lePixelBufferSet(buffer, x, y, color);
Parameters
param1buffer is the source color value.
Returns
leResult.

◆ lePixelBufferSet_Unsafe()

LIB_EXPORT leResult lePixelBufferSet_Unsafe ( const lePixelBuffer *const  buffer,
uint32_t  x,
uint32_t  y,
leColor  color 
)

Pixel set.

Sets a pixel in a pixel buffer at a point to a specified color. Caller is responsible for ensuring that the input color is in the same color format as the pixel buffer. Like lePixelBufferSet but performs no bounds checking.

lePixelBuffer* buffer;
leResult res = lePixelBufferSet_Unsafe(buffer, x, y, color);
Parameters
param1buffer is the source color value.
Returns
leResult.
Here is the caller graph for this function:
lePixelBufferSet_Unsafe
LIB_EXPORT leResult lePixelBufferSet_Unsafe(const lePixelBuffer *const buffer, uint32_t x, uint32_t y, leColor color)
Pixel set.
Definition: legato_pixelbuffer.c:347
lePixelBuffer_SetLocked
LIB_EXPORT leResult lePixelBuffer_SetLocked(lePixelBuffer *buffer, leBool locked)
Sets the lock.
Definition: legato_pixelbuffer.c:478
leResult
leResult
This enum represents function call results.
Definition: legato_common.h:134
lePixelBufferGetIndex_Unsafe
LIB_EXPORT leColor lePixelBufferGetIndex_Unsafe(const lePixelBuffer *const buffer, const uint32_t idx)
Get color at index.
Definition: legato_pixelbuffer.c:326
lePixelBufferSet
LIB_EXPORT leResult lePixelBufferSet(const lePixelBuffer *const buffer, uint32_t x, uint32_t y, leColor color)
Pixel set.
Definition: legato_pixelbuffer.c:332
leBool
leBool
This enum represents booleans.
Definition: legato_common.h:157
lePixelBufferClipRect
LIB_EXPORT leResult lePixelBufferClipRect(const lePixelBuffer *const buffer, const leRect *const rect, leRect *result)
Clip rectangle.
Definition: legato_pixelbuffer.c:293
lePixelBufferOffsetGet_Unsafe
LIB_EXPORT leBuffer lePixelBufferOffsetGet_Unsafe(const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
Get buffer at point.
Definition: legato_pixelbuffer.c:256
lePixelBufferOffsetGet
LIB_EXPORT leBuffer lePixelBufferOffsetGet(const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
Get buffer at point.
Definition: legato_pixelbuffer.c:237
lePixelBufferGet
LIB_EXPORT leColor lePixelBufferGet(const lePixelBuffer *const buffer, uint32_t x, uint32_t y)
Get pixel at point.
Definition: legato_pixelbuffer.c:269
lePixelBufferAreaFill_Unsafe
LIB_EXPORT leResult lePixelBufferAreaFill_Unsafe(const lePixelBuffer *const buffer, uint32_t x, uint32_t y, uint32_t w, uint32_t h, leColor color)
Area fill no checking.
Definition: legato_pixelbuffer.c:395
lePixelBufferCreate
LIB_EXPORT leResult lePixelBufferCreate(const int32_t width, const int32_t height, const leColorMode mode, const void *const address, lePixelBuffer *buffer)
Create a pixelbuffer.
Definition: legato_pixelbuffer.c:184
lePixelBuffer
Definition: legato_pixelbuffer.h:91