![]() |
MPLABĀ® Harmony Graphics Suite
|
Image functions and defintions. More...
#include "gfx/legato/common/legato_common.h"
#include "gfx/legato/common/legato_color.h"
#include "gfx/legato/common/legato_pixelbuffer.h"
#include "gfx/legato/core/legato_stream.h"
Go to the source code of this file.
Data Structures | |
struct | leImageMap |
This struct represents an image map. More... | |
struct | leImage |
struct | leImageDecoder |
This struct represents an image decoder. More... | |
Macros | |
#define | LE_IMAGE_FORMAT_COUNT (LE_IMAGE_FORMAT_RLE + 1) |
Typedefs | |
typedef struct lePalette | lePalette |
typedef enum leImageFormat | leImageFormat |
This enum represents an image format. More... | |
typedef enum leImageFlags | leImageFlags |
This enum represents image flags. More... | |
typedef enum leImageFilterMode | leImageFilterMode |
This enum represents image filter modes. More... | |
typedef struct leImageMap | leImageMap |
This struct represents an image map. More... | |
typedef struct leImage | leImage |
typedef struct leImageDecoder | leImageDecoder |
This struct represents an image decoder. More... | |
Enumerations | |
enum | leImageFormat { LE_IMAGE_FORMAT_RAW = 0, LE_IMAGE_FORMAT_RLE, LE_IMAGE_FORMAT_JPEG, LE_IMAGE_FORMAT_PNG } |
This enum represents an image format. More... | |
enum | leImageFlags { LE_IMAGE_USE_MASK_COLOR = 1 << 0, LE_IMAGE_USE_MASK_MAP = 1 << 1, LE_IMAGE_USE_ALPHA_MAP = 1 << 2, LE_IMAGE_INTERNAL_ALLOC = 1 << 3 } |
This enum represents image flags. More... | |
enum | leImageFilterMode { LE_IMAGEFILTER_NONE, LE_IMAGEFILTER_NEAREST_NEIGHBOR, LE_IMAGEFILTER_BILINEAR } |
This enum represents image filter modes. More... | |
Functions | |
LIB_EXPORT leResult | leImage_Create (leImage *img, uint32_t width, uint32_t height, leColorMode mode, void *data, uint32_t locationID) |
Create an image. More... | |
LIB_EXPORT leImage * | leImage_Allocate (uint32_t width, uint32_t height, leColorMode mode) |
Allocate an image buffer. More... | |
LIB_EXPORT leResult | leImage_Free (leImage *img) |
Free image buffer. More... | |
void | leImage_InitDecoders () |
Get Event Count. More... | |
LIB_EXPORT leResult | leImage_Draw (const leImage *img, const leRect *sourceRect, int32_t x, int32_t y, uint32_t a) |
Draw an Image. More... | |
LIB_EXPORT leResult | leImage_Resize (const leImage *src, const leRect *sourceRect, leImageFilterMode mode, uint32_t sizeX, uint32_t sizeY, leImage *target) |
Resize image. More... | |
LIB_EXPORT leResult | leImage_ResizeDraw (const leImage *src, const leRect *sourceRect, leImageFilterMode mode, uint32_t sizeX, uint32_t sizeY, int32_t x, int32_t y, uint32_t a) |
Resize draw image. More... | |
LIB_EXPORT leResult | leImage_Copy (const leImage *src, const leRect *sourceRect, int32_t x, int32_t y, leImage *dst) |
Copy image. More... | |
LIB_EXPORT leResult | leImage_Render (const leImage *src, const leRect *sourceRect, int32_t x, int32_t y, leBool ignoreMask, leBool ignoreAlpha, leImage *dst) |
Render image. More... | |
leResult | leImage_Rotate (const leImage *src, const leRect *sourceRect, leImageFilterMode mode, int32_t angle, leImage **dst, leBool alloc) |
Rotate image. More... | |
leResult | leImage_RotateDraw (const leImage *src, const leRect *sourceRect, leImageFilterMode mode, int32_t angle, int32_t x, int32_t y, uint32_t a) |
Rotate draw image. More... | |
Image functions and defintions.
Image drawing at specified coordinates.
typedef struct leImageDecoder leImageDecoder |
This struct represents an image decoder.
Structure defining a general image decoder object. Specific decoders will implement this in their own way.
typedef enum leImageFilterMode leImageFilterMode |
This enum represents image filter modes.
Image filter modes are used to list supported image filters.
typedef enum leImageFlags leImageFlags |
This enum represents image flags.
Image flags are used to describe an image asset.
typedef enum leImageFormat leImageFormat |
This enum represents an image format.
Image format is used to list supported image encodings.
typedef struct leImageMap leImageMap |
This struct represents an image map.
An image map is used to describe an image map buffer.
enum leImageFilterMode |
This enum represents image filter modes.
Image filter modes are used to list supported image filters.
enum leImageFlags |
This enum represents image flags.
Image flags are used to describe an image asset.
enum leImageFormat |
This enum represents an image format.
Image format is used to list supported image encodings.
LIB_EXPORT leImage* leImage_Allocate | ( | uint32_t | width, |
uint32_t | height, | ||
leColorMode | mode | ||
) |
Allocate an image buffer.
Dynamically allocates an image buffer in local memory using width and height color mode mode.
width | the width of the image in pixels |
height | the height of the image in pixels |
mode | the color mode of the image |
LIB_EXPORT leResult leImage_Copy | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
int32_t | x, | ||
int32_t | y, | ||
leImage * | dst | ||
) |
Copy image.
Copies img bounded by srcRect to location x and y.
src | pointer to source image asset to draw |
sourceRect | the source rectangle of the image to decode |
x | the x position |
y | the y position |
dst | the destination image to fill |
LIB_EXPORT leResult leImage_Create | ( | leImage * | img, |
uint32_t | width, | ||
uint32_t | height, | ||
leColorMode | mode, | ||
void * | data, | ||
uint32_t | locationID | ||
) |
Create an image.
Creates an image img given width, height, and mode. The image is located at data with locationID.
img | the image object to initialize |
width | the width of the image |
height | the height of the image |
mode | the color mode of the image |
data | the data address of the image |
locationID | the location ID of the image |
LIB_EXPORT leResult leImage_Draw | ( | const leImage * | img, |
const leRect * | sourceRect, | ||
int32_t | x, | ||
int32_t | y, | ||
uint32_t | a | ||
) |
Draw an Image.
Draws an image img bounded by sourceRect to location x and y.
img | is the image to draw. |
Free image buffer.
Frees an image buffer img.
img | the image to free |
void leImage_InitDecoders | ( | ) |
Get Event Count.
Returns the number of events listed in the current context.
void. |
LIB_EXPORT leResult leImage_Render | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
int32_t | x, | ||
int32_t | y, | ||
leBool | ignoreMask, | ||
leBool | ignoreAlpha, | ||
leImage * | dst | ||
) |
Render image.
Copies img bounded by srcRect to location x and y. The flag ignoreMask determines if the masking color should be performed. The flag ignoreAlpha determines if the alpha blending is performed.
src | is the image to render. |
sourceRect | the source rectangle |
x | the x position |
y | the y position |
ignoreMask | set to true to skip the mask stage for the source image |
ignoreAlpha | the destination image to fill |
dst | set to true to skip the blend stage for the source image |
LIB_EXPORT leResult leImage_Resize | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
leImageFilterMode | mode, | ||
uint32_t | sizeX, | ||
uint32_t | sizeY, | ||
leImage * | target | ||
) |
Resize image.
Resizes the source image src to destination image dst to location x and y. using the specified filter mode.
src | is the image to resize. |
LIB_EXPORT leResult leImage_ResizeDraw | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
leImageFilterMode | mode, | ||
uint32_t | sizeX, | ||
uint32_t | sizeY, | ||
int32_t | x, | ||
int32_t | y, | ||
uint32_t | a | ||
) |
Resize draw image.
Resizes the source image src to destination image dst to location x and y. using the specified filter mode.
src | is the image to resize. |
leResult leImage_Rotate | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
leImageFilterMode | mode, | ||
int32_t | angle, | ||
leImage ** | dst, | ||
leBool | alloc | ||
) |
Rotate image.
Rotate image src bounded by srcRect by angle degress. The resulting image is dst The result image is automatically allocated and should be freed by the caller.
src | is the image to render. |
sourceRect | the source rectangle |
mode | the the filter mode |
angle | the angle to rotate by (positive is counter clockwise) |
dst | the destination image to fill |
alloc | true if the decoder should automatically allocate the destination image |
leResult leImage_RotateDraw | ( | const leImage * | src, |
const leRect * | sourceRect, | ||
leImageFilterMode | mode, | ||
int32_t | angle, | ||
int32_t | x, | ||
int32_t | y, | ||
uint32_t | a | ||
) |
Rotate draw image.
Rotate image src bounded by srcRect around origin at angle degress. The resulting image is dst.
src | is the image to render. |
sourceRect | the source rectangle |
angle | set to true to skip the mask stage for the source image |
x | the destination image to fill |
y | is the image to resize. |
a | the alpha value to use |