PicoVGA  1.0-cmake
VGA/TV display on Raspberry Pico
Utility Functions

Description

Utility functions.

Functions

void Attr8Conv (u8 *dst, u8 *attr, const u8 *src, int w, int h, const u8 *pal)
 Convert image from 16-color to 8x8 attribute format. More...
 
void Plane2Conv (u8 *plane0, u8 *plane1, const u8 *src, int w, int h)
 Convert image from 4-color to 2-plane format (width must be multiply of 8) More...
 
void ImgInvert (u8 *dst, int num)
 Invert image. More...
 
int DecUNum (char *buf, u32 num)
 Decode unsigned number into ASCIIZ text buffer. More...
 
int DecNum (char *buf, s32 num)
 Decode signed number into ASCIIZ text buffer. More...
 
void CopyWhiteImg (u8 *dst, const u8 *src, int num)
 Prepare image with white key transparency (copy and increment pixels) More...
 

Function Documentation

◆ Attr8Conv()

void Attr8Conv ( u8 *  dst,
u8 *  attr,
const u8 *  src,
int  w,
int  h,
const u8 *  pal 
)

Convert image from 16-color to 8x8 attribute format.

Parameters
dstDestination image
attrDestination attribute data
srcSource image
wImage width
hImage height
palPalette

◆ Plane2Conv()

void Plane2Conv ( u8 *  plane0,
u8 *  plane1,
const u8 *  src,
int  w,
int  h 
)

Convert image from 4-color to 2-plane format (width must be multiply of 8)

Parameters
plane0First plane destination
plane1Second plane destionation
srcSoure image
wImage width
hImage height

◆ ImgInvert()

void ImgInvert ( u8 *  dst,
int  num 
)

Invert image.

Parameters
dstImage data
numLength of image in bytes

◆ DecUNum()

int DecUNum ( char *  buf,
u32  num 
)

Decode unsigned number into ASCIIZ text buffer.

Parameters
bufDestination buffer
numNumber to decode
Returns
Number of digits

◆ DecNum()

int DecNum ( char *  buf,
s32  num 
)

Decode signed number into ASCIIZ text buffer.

Parameters
bufDestination buffer
numNumber to decode
Returns
Number of digits

◆ CopyWhiteImg()

void CopyWhiteImg ( u8 *  dst,
const u8 *  src,
int  num 
)

Prepare image with white key transparency (copy and increment pixels)

Parameters
dstDestination image
srcSource image
numNumber of bytes to copy