orcus
|
RGB. More...
#include <stdint.h>
Enumerations | |
enum | BlendingMode { NO_BLENDING = 0 , COLOUR_KEY = 1 , ALPHA = 2 } |
Blending modes for combining regions on-screen. More... | |
enum | RgbFormat { P4BPP = 0 , P8BPP = 1 , RGB565 = 2 , RGB888 = 3 , B1BPP = 4 } |
Bit formats in RGB region. More... | |
enum | RgbRegion { REGION1 = 1 , REGION2 = 2 , REGION3 = 3 , REGION4 = 4 , REGION5 = 5 } |
Regions available in RGB hardware. More... | |
Functions | |
void | rgbColourKey (uint8_t r, uint8_t g, uint8_t b) |
Set global colour key for blending. More... | |
void | rgbPrintf (uint16_t *fb, int x, int y, uint16_t colour, const char *format,...) |
printf directly to RGB565 framebuffer. More... | |
void | rgbPrintfBg (uint16_t *fb, int x, int y, uint16_t colour, uint16_t bgColour, const char *format,...) |
printf directly to RGB565 framebuffer with a background colour. More... | |
void | rgbPutc (uint16_t *fb, int x, int y, uint16_t colour, char c) |
Render a font character on the screen. More... | |
void | rgbPutcBg (uint16_t *fb, int x, int y, uint16_t colour, uint16_t bgColour, char c) |
Render a font character on the screen with a background colour. More... | |
void | rgbRegionBlendAlpha (RgbRegion region, uint4_t alpha) |
Enable alpha blending for this region. More... | |
void | rgbRegionBlendColourKey (RgbRegion region) |
Enable colour key blending for region. More... | |
void | rgbRegionNoBlend (RgbRegion region) |
Disable blending for a region. More... | |
void | rgbSetFbAddress (void *fb) |
Set RGB framebuffer address. More... | |
void | rgbSetFont (uint16_t *font, int charWidth, int charHeight) |
Set font data to use. More... | |
void | rgbSetPalette (uint32_t *colours, int count, uint8_t startIdx) |
Set colour palette for 4 or 8 bit modes. More... | |
void | rgbSetPixelFormat (RgbFormat format) |
Configure RGB pixel format for all regions. More... | |
void | rgbSetRegionPosition (RgbRegion region, int x, int y, int width, int height) |
Set region coordinates and size. More... | |
void | rgbSetScale (int srcW, int srcH) |
Set source with for scaling region. More... | |
void | rgbToggleRegion (RgbRegion region, bool onOff) |
Enable or disable an RGB region. More... | |
enum BlendingMode |
enum RgbFormat |
enum RgbRegion |
void rgbColourKey | ( | uint8_t | r, |
uint8_t | g, | ||
uint8_t | b | ||
) |
Set global colour key for blending RGB regions (all regions share the same key).
r | Red value to match |
g | Green value to match |
b | Blue value to match |
void rgbPrintf | ( | uint16_t * | fb, |
int | x, | ||
int | y, | ||
uint16_t | colour, | ||
const char * | format, | ||
... | |||
) |
printf directly to RGB565 framebuffer. Must have configured font first using rgbSetFont.
fb | Pointer to RGB565 framebuffer in which to render character |
x | X-coordinate at which to draw font |
y | Y-coordinate at which to draw font |
colour | RGB565 colour to draw character |
void rgbPrintfBg | ( | uint16_t * | fb, |
int | x, | ||
int | y, | ||
uint16_t | colour, | ||
uint16_t | bgColour, | ||
const char * | format, | ||
... | |||
) |
printf directly to RGB565 framebuffer with a background colour. Must have configured font first using rgbSetFont.
fb | Pointer to RGB565 framebuffer in which to render character |
x | X-coordinate at which to draw font |
y | Y-coordinate at which to draw font |
colour | RGB565 colour to draw character |
bgColour | RGB565 colour to use for background |
void rgbPutc | ( | uint16_t * | fb, |
int | x, | ||
int | y, | ||
uint16_t | colour, | ||
char | c | ||
) |
Render a font character on the screen. Must have configured font first using rgbSetFont.
fb | Pointer to RGB565 framebuffer in which to render character |
x | X-coordinate at which to draw font |
y | Y-coordinate at which to draw font |
colour | RGB565 colour to draw character |
c | Character to draw |
void rgbPutcBg | ( | uint16_t * | fb, |
int | x, | ||
int | y, | ||
uint16_t | colour, | ||
uint16_t | bgColour, | ||
char | c | ||
) |
Render a font character on the screen with a background colour. Must have configured font first using rgbSetFont.
fb | Pointer to RGB565 framebuffer in which to render character |
x | X-coordinate at which to draw font |
y | Y-coordinate at which to draw font |
colour | RGB565 colour to draw character |
bgColour | RGB565 colour to use for background |
c | Character to draw |
void rgbRegionBlendAlpha | ( | RgbRegion | region, |
uint4_t | alpha | ||
) |
Enable alpha blending for this region, and set alpha value.
region | Region to alter |
alpha | Alpha value (0 - 16) |
void rgbRegionBlendColourKey | ( | RgbRegion | region | ) |
Enable colour key blending for region.
region | Region to alter |
void rgbRegionNoBlend | ( | RgbRegion | region | ) |
Disable blending for a region.
region | Region to alter |
void rgbSetFbAddress | ( | void * | fb | ) |
Set RGB framebuffer address. The regions all share the same base pointer and are accessed sequentially from that location.
fb | Pointer to memory region which should be used as source of RGB data |
void rgbSetFont | ( | uint16_t * | font, |
int | charWidth, | ||
int | charHeight | ||
) |
Set font data to use for text drawing utility functions.
font | Pointer to font graphic data |
charWidth | Width of font character in pixels |
charHeight | Height of font character in pixels |
void rgbSetPalette | ( | uint32_t * | colours, |
int | count, | ||
uint8_t | startIdx | ||
) |
Set colour palette for 4 or 8 bit modes. A palette can be up to 256 entries long (only the first 16 are used in 4bpp mode).
colours | Pointer to array of colour data in RGB888x format |
count | Number of palette entries to set |
startIdx | First palette index to set |
void rgbSetPixelFormat | ( | RgbFormat | format | ) |
Configure RGB pixel format for all regions.
format | Format to use when interpreting RGB data |
void rgbSetRegionPosition | ( | RgbRegion | region, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Set region coordinates and size.
region | Region to alter |
x | X-coordinate of start of region |
y | Y-coordinate of start of region |
width | Width in pixels of region |
height | Height in pixels of region |
void rgbSetScale | ( | int | srcW, |
int | srcH | ||
) |
Sets source width for scaling region.
srcW | Source width in pixels, scaling in X dimension disabled if set to 0 |
srcH | Source height in pixels, scaling in Y dimension disabled if set to 0 |
void rgbToggleRegion | ( | RgbRegion | region, |
bool | onOff | ||
) |
Enable or disable an RGB region.
region | Region to alter |
onOff | true to enable a region, false to disable it |