MPLABĀ® Harmony Graphics Suite
GFX v3.13.0
Legato API Documentation
|
Color definitions and functions. More...
#include "gfx/legato/common/legato_common.h"
Go to the source code of this file.
Data Structures | |
struct | leColorModeInfo |
This struct represents color mode information. More... | |
struct | leBlendLookupTable |
This struct represents a blend color lookup table. More... | |
Typedefs | |
typedef enum leColorMask | leColorMask |
This enum represents the color masks for color modes. More... | |
typedef enum leColorMode | leColorMode |
This enum represents the supported RGB color formats. More... | |
typedef enum leBitsPerPixel | leBitsPerPixel |
This enum represents the bits per pixel (bpp) options. More... | |
typedef struct leColorModeInfo | leColorModeInfo |
This struct represents color mode information. More... | |
typedef enum leColorName | leColorName |
This enum represents predefined color options. | |
typedef struct leBlendLookupTable | leBlendLookupTable |
This struct represents a blend color lookup table. More... | |
Enumerations | |
enum | leColorMask { LE_COLOR_MASK_GS_8 = 0x1, LE_COLOR_MASK_PALETTE = 0x1, LE_COLOR_MASK_RGB_332 = 0x4, LE_COLOR_MASK_RGB_565 = 0x8, LE_COLOR_MASK_RGBA_5551 = 0x10, LE_COLOR_MASK_RGB_888 = 0x20, LE_COLOR_MASK_RGBA_8888 = 0x40, LE_COLOR_MASK_ARGB_8888 = 0x80, LE_COLOR_MASK_ALL } |
This enum represents the color masks for color modes. More... | |
enum | leColorMode { LE_COLOR_MODE_GS_8 = 0, LE_COLOR_MODE_RGB_332 = 1, LE_COLOR_MODE_RGB_565 = 2, LE_COLOR_MODE_RGBA_5551 = 3, LE_COLOR_MODE_RGB_888 = 4, LE_COLOR_MODE_RGBA_8888 = 5, LE_COLOR_MODE_ARGB_8888 = 6, LE_COLOR_MODE_INDEX_1 = 7, LE_COLOR_MODE_INDEX_4 = 8, LE_COLOR_MODE_INDEX_8 = 9, LE_COLOR_MODE_PALETTE = LE_COLOR_MODE_INDEX_8, LE_COLOR_MODE_MONOCHROME = 10 } |
This enum represents the supported RGB color formats. More... | |
enum | leBitsPerPixel { LE_BPP1, LE_BPP4, LE_BPP8, LE_BPP16, LE_BPP24, LE_BPP32 } |
This enum represents the bits per pixel (bpp) options. More... | |
enum | leColorName { LE_COLOR_BLACK, LE_COLOR_WHITE, LE_COLOR_RED, LE_COLOR_LIME, LE_COLOR_BLUE, LE_COLOR_YELLOW, LE_COLOR_CYAN, LE_COLOR_MAGENTA, LE_COLOR_SILVER, LE_COLOR_DARKGRAY, LE_COLOR_GRAY, LE_COLOR_LIGHTGRAY, LE_COLOR_MAROON, LE_COLOR_OLIVE, LE_COLOR_GREEN, LE_COLOR_PURPLE, LE_COLOR_TEAL, LE_COLOR_NAVY, LE_COLOR_LAST } |
This enum represents predefined color options. | |
Functions | |
leColor | leColorValue (leColorMode mode, leColorName name) |
Get color by name and mode. More... | |
uint32_t | leColorChannelRed (leColor clr, leColorMode mode) |
Get red color channel. More... | |
uint32_t | leColorChannelGreen (leColor clr, leColorMode mode) |
Get green color channel. More... | |
uint32_t | leColorChannelBlue (leColor clr, leColorMode mode) |
Get blue color channel. More... | |
uint32_t | leColorChannelAlpha (leColor clr, leColorMode mode) |
Get alpha color channel. More... | |
leColor | leColorConvert (leColorMode mode_in, leColorMode mode_out, leColor color) |
Convert to color value. More... | |
leColor | leColorBlend_RGBA_8888 (leColor fore, leColor back) |
Get color from RGBA blend. More... | |
leColor | leColorBlend_ARGB_8888 (leColor fore, leColor back) |
Get color from ARGB blend. More... | |
leColor | leColorLerp (leColor l, leColor r, uint32_t percent, leColorMode mode) |
Get color from linear interpolate of two colors. More... | |
leColor | leColorBilerp (leColor c00, leColor c01, leColor c10, leColor c11, uint32_t xper, uint32_t yper, leColorMode mode) |
Get color from bi-linear interpolation of four colors. More... | |
leColor | leColorSwap (leColor clr, leColorMode mode) |
Swaps the red and blue channels for a given color value. More... | |
Variables | |
const leColorModeInfo | leColorInfoTable [] |
This array represents information reference table. More... | |
Color definitions and functions.
Contains functions for color information and manipulation operations. Color conversion and color channel management.
typedef enum leBitsPerPixel leBitsPerPixel |
This enum represents the bits per pixel (bpp) options.
The BPP controls the color depth and bit needed to hold a color. Higher bpp allows for more colours to be represented, however, more resources are required to store or display.
typedef struct leBlendLookupTable leBlendLookupTable |
This struct represents a blend color lookup table.
A blend color lookup table is allows for a fast blending result based on a lookup table versus having to perform the calculation mathematically.
typedef enum leColorMask leColorMask |
This enum represents the color masks for color modes.
typedef enum leColorMode leColorMode |
This enum represents the supported RGB color formats.
The pixels in a graphics buffer or supported display is represented by the pixel format. For embedded graphics this is limited by memory and hardware.
typedef struct leColorModeInfo leColorModeInfo |
This struct represents color mode information.
Color mode information keeps track of size, bpp, color channel mask and color.
enum leBitsPerPixel |
This enum represents the bits per pixel (bpp) options.
The BPP controls the color depth and bit needed to hold a color. Higher bpp allows for more colours to be represented, however, more resources are required to store or display.
enum leColorMask |
This enum represents the color masks for color modes.
enum leColorMode |
This enum represents the supported RGB color formats.
The pixels in a graphics buffer or supported display is represented by the pixel format. For embedded graphics this is limited by memory and hardware.
leColor leColorBilerp | ( | leColor | c00, |
leColor | c01, | ||
leColor | c10, | ||
leColor | c11, | ||
uint32_t | xper, | ||
uint32_t | yper, | ||
leColorMode | mode | ||
) |
Get color from bi-linear interpolation of four colors.
Gets a color from the bilinear interpolation of c00, c01, c10, and c11. The percentage of interpolation of x and y is specified by xper yper. The color format is mode.
c00 | is the top left color input. |
c01 | is the top right color input. |
c10 | is the bottom left color input. |
c11 | is the bottom right color input. |
xper | is the percentage of interpolation in x [0-100]. |
yper | is the percentage of interpolation in y [0-100]. |
mode | is the input color mode. |
leColor leColorBlend_ARGB_8888 | ( | leColor | fore, |
leColor | back | ||
) |
Get color from ARGB blend.
Gets a color from the blend of ARGB fore and RGBA back.
fore | is the foreground color. |
back | is the background color |
leColor leColorBlend_RGBA_8888 | ( | leColor | fore, |
leColor | back | ||
) |
Get color from RGBA blend.
Gets a color from the blend of RGBA fore and RGBA back.
fore | is the foreground color. |
back | is the background color |
uint32_t leColorChannelAlpha | ( | leColor | clr, |
leColorMode | mode | ||
) |
Get alpha color channel.
Gets the alpha color channel of type mode for the given color.
clr | is the source color value. |
mode | is the source color mode |
uint32_t leColorChannelBlue | ( | leColor | clr, |
leColorMode | mode | ||
) |
Get blue color channel.
Gets the blue color channel of type mode for the given color. leColor clr; leColorMode mode; uint32_t blue = leColorChannelBlue(clr, mode);
mode | is the colormode format. |
name | is the name to query. |
uint32_t leColorChannelGreen | ( | leColor | clr, |
leColorMode | mode | ||
) |
Get green color channel.
Gets the green color channel from color in the format mode.
is the color to query. is the format.
uint32_t leColorChannelRed | ( | leColor | clr, |
leColorMode | mode | ||
) |
Get red color channel.
Gets the red color channel from color in the format mode.
mode | is the colormode required. |
name | is the name to query |
leColor leColorConvert | ( | leColorMode | mode_in, |
leColorMode | mode_out, | ||
leColor | color | ||
) |
Convert to color value.
Converts the color value of color from mode_in to mode_out.
mode_in | is the the source color. |
mode_out | is the source color mode. |
color | is the color to convert. |
leColor leColorLerp | ( | leColor | l, |
leColor | r, | ||
uint32_t | percent, | ||
leColorMode | mode | ||
) |
Get color from linear interpolate of two colors.
Gets a color from the linear interpolation of l and r with percentage of interpolation specified by percent and color format mode
fore | is the foreground color. |
back | is the background color |
leColor leColorSwap | ( | leColor | clr, |
leColorMode | mode | ||
) |
Swaps the red and blue channels for a given color value.
Swaps the red and blue channels for a given color value. This can change an RGB color to BGR and vice versa.
clr | is the color value. |
mode | is the color value mode. |
leColor leColorValue | ( | leColorMode | mode, |
leColorName | name | ||
) |
Get color by name and mode.
Gets a color by name in the format mode.
is the colormode required. is the name to query
const leColorModeInfo leColorInfoTable[] |
This array represents information reference table.
The reference table is used to hold color information.