Fake 16bit bitmap mode


Defines

#define PA_LoadFake16bitBitmap(screen, bitmap)   DMA_Copy(bitmap, (void*)PA_DrawFake16[screen], 256*192, DMA_16NOW)
 Load a 16 bit bitmap into a fake 16 bit background.
#define PA_ClearFake16bitBg(screen)   DMA_Copy(Blank, (void*)PA_DrawFake16[screen], 256*192, DMA_16NOW)
#define PA_PutFake16bitPixel(screen, x, y, color)   PA_DrawFake16[screen][(x) + 256 * (y)] = color
 Plots a pixel into a fake 16 bit background.
#define PA_GetFake16bitPixel(screen, x, y)   PA_DrawFake16[screen][(x) + 256 * (y)]
 Gets the color of a specified pixel of a fake 16 bit background.
#define PA_DrawFake16bitRect(screen, x1, y1, x2, y2, color)
 Draws a rectangle on a fake 16 bit background.
#define PA_Fake16bitLoadBmpEx(screen, bmp, x, y)   PA_LoadBmpToBuffer(PA_DrawFake16[screen], x, y, bmp, 256)
 Load a BMP on a fake 16 bit background... Don't forget to Init the background !
#define PA_Fake16bitLoadBmp(screen, bmp)   PA_Fake16bitLoadBmpEx(screen, bmp, 0, 0)
 Load a BMP on a fake 16 bit background... Don't forget to Init the background !
#define PA_Fake16bitLoadGifXY(screen, gif, x, y)   DecodeGif((const u8*)gif, (u8*)(PA_DrawFake16[screen] + x + (y<<8)), (u16*)0x05000000, 1, 256);
#define PA_Fake16bitLoadGif(screen, gif)   PA_Fake16bitLoadGifXY(screen, gif, 0, 0)
 Load a Gif on a fake 16 bit background... Don't forget to Init the background !
#define PA_Fake16bitLoadJpeg(screen, jpeg)   JPEG_DecompressImage((u8*)jpeg, PA_DrawFake16[screen], 256, 192)
 Load a jpeg on a fake 16 bit background... Don't forget to Init the background !

Functions

void PA_InitFake16bitBg (u8 screen, u8 prio)
 Initialize a fake 16 bit background.
void PA_DrawFake16bitLine (u8 screen, u16 x1, u16 y1, u16 x2, u16 y2, u16 color)
 Draws a line on a fake 16 bit background.

Detailed Description

Functions to handle fake 16 bit backgrounds that take up less memory than real ones!

Define Documentation

#define PA_ClearFake16bitBg ( screen   )     DMA_Copy(Blank, (void*)PA_DrawFake16[screen], 256*192, DMA_16NOW)

#define PA_DrawFake16bitRect ( screen,
x1,
y1,
x2,
y2,
color   ) 

Value:

{PA_DrawFake16bitLine(screen, x1, y1, x2, y1, color);\
        PA_DrawFake16bitLine(screen, x1, y1, x1, y2, color);\
        PA_DrawFake16bitLine(screen, x2, y1, x2, y2, color);\
        PA_DrawFake16bitLine(screen, x1, y2, x2, y2, color);}
Draws a rectangle on a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
x1 X position of the first point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y1 Y position of the first point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
x2 X position of the second point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y2 Y position of the second point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color 15 bits color. You can use the PA_RGB macro to set the RGB values...

#define PA_Fake16bitLoadBmp ( screen,
bmp   )     PA_Fake16bitLoadBmpEx(screen, bmp, 0, 0)

Load a BMP on a fake 16 bit background... Don't forget to Init the background !

Parameters:
screen Choose the screen (0 or 1)
bmp BMP image...

#define PA_Fake16bitLoadBmpEx ( screen,
bmp,
x,
 )     PA_LoadBmpToBuffer(PA_DrawFake16[screen], x, y, bmp, 256)

Load a BMP on a fake 16 bit background... Don't forget to Init the background !

Parameters:
screen Chose de screen (0 or 1)
x X position of the top left corner
y Y position of the top left corner
bmp BMP image...

#define PA_Fake16bitLoadGif ( screen,
gif   )     PA_Fake16bitLoadGifXY(screen, gif, 0, 0)

Load a Gif on a fake 16 bit background... Don't forget to Init the background !

Parameters:
screen Chose de screen (0 or 1)
gif Gif image...

#define PA_Fake16bitLoadGifXY ( screen,
gif,
x,
 )     DecodeGif((const u8*)gif, (u8*)(PA_DrawFake16[screen] + x + (y<<8)), (u16*)0x05000000, 1, 256);

#define PA_Fake16bitLoadJpeg ( screen,
jpeg   )     JPEG_DecompressImage((u8*)jpeg, PA_DrawFake16[screen], 256, 192)

Load a jpeg on a fake 16 bit background... Don't forget to Init the background !

Parameters:
screen Chose de screen (0 or 1)
jpeg jpeg image...

#define PA_GetFake16bitPixel ( screen,
x,
 )     PA_DrawFake16[screen][(x) + 256 * (y)]

Gets the color of a specified pixel of a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
x X position of the point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y Y position of the point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results

#define PA_LoadFake16bitBitmap ( screen,
bitmap   )     DMA_Copy(bitmap, (void*)PA_DrawFake16[screen], 256*192, DMA_16NOW)

Load a 16 bit bitmap into a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
bitmap Bitmap name

#define PA_PutFake16bitPixel ( screen,
x,
y,
color   )     PA_DrawFake16[screen][(x) + 256 * (y)] = color

Plots a pixel into a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
x X position of the point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y Y position of the point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color 15 bits color. You can use the PA_RGB macro to set the RGB values...


Function Documentation

void PA_DrawFake16bitLine ( u8  screen,
u16  x1,
u16  y1,
u16  x2,
u16  y2,
u16  color 
)

Draws a line on a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
x1 X position of the first point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y1 Y position of the first point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
x2 X position of the second point. Be carefull, if X is not between 0 and 255, it'll give unwanted results
y2 Y position of the second point. Be carefull, if Y is not between 0 and 191, it'll give unwanted results
color 15 bits color. You can use the PA_RGB macro to set the RGB values...

void PA_InitFake16bitBg ( u8  screen,
u8  prio 
)

Initialize a fake 16 bit background.

Parameters:
screen Choose the screen (0 or 1)
prio Background priority (from 0 to 3, being 0 the highest)


Generated on Sat Jun 13 12:55:14 2009 for PAlib - Programmer's Arsenal by  doxygen 1.5.8