|
void | serdisp_setsdcol (serdisp_t *dd, int x, int y, SDCol sdcol) |
| set a colour in the display buffer More...
|
|
void | serdisp_setsdgrey (serdisp_t *dd, int x, int y, byte grey) |
| set grey value in the display buffer More...
|
|
SDCol | serdisp_getsdcol (serdisp_t *dd, int x, int y) |
| gets colour value at position (x/y) More...
|
|
byte | serdisp_getsdgrey (serdisp_t *dd, int x, int y) |
| gets grey value at position (x/y) More...
|
|
int | serdisp_setarea (serdisp_t *dd, int x, int y, int w, int h, int inpmode, byte *content) |
| copies an external buffer into the screen buffer More...
|
|
int | serdisp_cliparea (serdisp_t *dd, int x, int y, int w, int h, int sx, int sy, int cw, int ch, int inpmode, byte *content) |
| copies a clip from an external buffer into the screen buffer More...
|
|
|
int | serdisp_sdcol_init (serdisp_t *dd) |
| initialises colour conversion function pointers More...
|
|
SDCol | serdisp_transsdcol (serdisp_t *dd, SDCol sdcol) |
| translates a colour value to the hardware dependent value More...
|
|
SDCol | serdisp_transsdgrey (serdisp_t *dd, byte greyvalue) |
| translates a grey value to the hardware dependent value More...
|
|
SDCol | serdisp_lookupsdcol (serdisp_t *dd, SDCol sdcol) |
| looks up hardware independent colour value to the hardware dependent value More...
|
|
byte | serdisp_lookupsdgrey (serdisp_t *dd, SDCol sdcol) |
| looks up hardware independent grey value to the hardware dependent colour value More...
|
|
void | serdisp_setsdcoltabentry (serdisp_t *dd, int idx, SDCol sdcol) |
|
SDCol | serdisp_getsdcoltabentry (serdisp_t *dd, int idx) |
|
|
void | serdisp_setcolour (serdisp_t *dd, int x, int y, long colour) |
| set a colour in the display buffer More...
|
|
void | serdisp_setgrey (serdisp_t *dd, int x, int y, byte grey) |
| set grey value in the display buffer More...
|
|
long | serdisp_getcolour (serdisp_t *dd, int x, int y) |
| gets colour value at position (x/y) More...
|
|
byte | serdisp_getgrey (serdisp_t *dd, int x, int y) |
| gets grey value at position (x/y) More...
|
|
long | serdisp_transcolour (serdisp_t *dd, long colour) |
| translates a colour value to the hardware dependent value More...
|
|
long | serdisp_transgrey (serdisp_t *dd, byte greyvalue) |
| translates a grey value to the hardware dependent value More...
|
|
long | serdisp_lookupcolour (serdisp_t *dd, long colour) |
| looks up hardware independent colour value to the hardware dependent value More...
|
|
byte | serdisp_lookupgrey (serdisp_t *dd, long colour) |
| looks up hardware independent grey value to the hardware dependent colour value More...
|
|
void | serdisp_setcoltabentry (serdisp_t *dd, int idx, long colour) |
|
long | serdisp_getcoltabentry (serdisp_t *dd, int idx) |
|
Introduction
All hardware-independend pixel manipulating functions are defined here.
- Attention
- serdisp_getpixel() / serdisp_setpixel() are hardware dependend functions, and serdisp_getcolour() / serdisp_setcolour() are architecture dependend functions.
To obtain hardware and architecture independend code, serdisp_getsdcol() / serdisp_setsdcol(), which are defined in here, should be used!
No descriptor fields or internal functions should be accessed directly as these are subject to change.
#define serdisp_ARGB2GREY |
( |
|
_col | ) |
|
Converts an 0xAARRGGBB
colour value to a grey value
- Parameters
-
_col | colour value, format: 0xAARRGGBB , AA .. alpha, RR .. red, GG .. green, BB .. blue |
- Returns
- grey value, format:
[0 .. 255]
#define serdisp_GREY2ARGB |
( |
|
_grey | ) |
|
Converts a grey value to a 0xAARRGGBB
colour value
- Parameters
-
_grey | colour value, format: [0 .. 255] |
- Returns
- colour value, format:
0xAARRGGBB
, AA
.. alpha, RR
.. red, GG
.. green, BB
.. blue
#define serdisp_pack2ARGB |
( |
|
_a, |
|
|
|
_r, |
|
|
|
_g, |
|
|
|
_b |
|
) |
| |
Packs an alpha/red/green/blue-representation to a colour representation suitable for serdisplib.
- Parameters
-
_a | alpha-channel |
_r | red-channel |
_g | green-channel |
_b | blue-channel |
- Returns
- hardware independend colour value,
format: 0xAARRGGBB
, AA
.. alpha, RR
.. red, GG
.. green, BB
.. blue
Examples:
set a red pixel in the display buffer at position
(10/20)
4 serdisp_setsdcol(dd, 10, 20, serdisp_pack2ARGB("0xFF", r, g, b));
int serdisp_cliparea |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
sx, |
|
|
int |
sy, |
|
|
int |
cw, |
|
|
int |
ch, |
|
|
int |
inpmode, |
|
|
byte * |
content |
|
) |
| |
- Parameters
-
dd | device descriptor |
x | x start position in display buffer |
y | y start position in display buffer |
w | width of clip section to copy |
h | height of clip section to copy |
sx | x start position in source clip |
sy | y start position in source clip |
cw | total width of source clip |
ch | total height of source clip |
inpmode | (inpmode & 0x00FF): input depth (either 24 or 32 bit)
(inpmode & 0xFF00): flags:
bit 0:
|
content | image data to fill into given area |
- Return values
-
0 | no error occured |
-1 | inpmode not supported |
-2 | not initialised or erraneous parameters |
-3 | position / dimension parameters out of bounds |
Example:
copy a clip from <content> starting at position 50/50, size 100x100 into the screen buffer of <dd> at position 10/10. the dimension of the image stored in <content> is 200x200 (altogether), its depth is 24 and colour scheme is BGR.
1 byte* content = <some image byte stream>;
2 serdisp_cliparea(dd, 10, 10, 100, 100, 50, 50, 200, 200, (1 << 8) | 24, content);
- Since
- 1.97.9
long serdisp_getcolour |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Gets the hardware independent colour value at position (x/y)
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
- Returns
- hardware independent colour value at (x/y)
format: 0xAARRGGBB
, AA
.. alpha, RR
.. red, GG
.. green, BB
.. blue
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_getsdcol() should be used instead.
byte serdisp_getgrey |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Gets the grey value at position (x/y). colour values are converted to the corresponding greyscale values.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
- Returns
- grey value ,format:
[0 .. 255]
- Deprecated:
- Old naming scheme for architecture dependent colour functions.
serdisp_getsdgrey() should be used instead.
SDCol serdisp_getsdcol |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Gets the hardware independent colour value at position (x/y)
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
- Returns
- hardware independent colour value at (x/y)
format: 0xAARRGGBB
, AA
.. alpha, RR
.. red, GG
.. green, BB
.. blue
- Since
- 1.98.0
byte serdisp_getsdgrey |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
Gets the grey value at position (x/y). colour values are converted to the corresponding greyscale values.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
- Returns
- grey value ,format:
[0 .. 255]
- Since
- 1.98.0
long serdisp_lookupcolour |
( |
serdisp_t * |
dd, |
|
|
long |
colour |
|
) |
| |
Looks up the corresponding 0xAARRGGBB
colour value to a serdisp_setpixel()-compliant colour value.
- Parameters
-
- Returns
- translated hardware independent colour value, format:
0xAARRGGBB
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_lookupsdcol() should be used instead.
byte serdisp_lookupgrey |
( |
serdisp_t * |
dd, |
|
|
long |
colour |
|
) |
| |
Looks up the corresponding grey value to a serdisp_setpixel()-compliant colour value.
- Parameters
-
- Returns
- translated grey value, format
[0 .. 255]
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_lookupsdgrey() should be used instead.
SDCol serdisp_lookupsdcol |
( |
serdisp_t * |
dd, |
|
|
SDCol |
sdcol |
|
) |
| |
Looks up the corresponding 0xAARRGGBB
colour value to a serdisp_setpixel()-compliant colour value.
- Parameters
-
- Returns
- translated hardware independent colour value, format:
0xAARRGGBB
- Since
- 1.98.0
byte serdisp_lookupsdgrey |
( |
serdisp_t * |
dd, |
|
|
SDCol |
sdcol |
|
) |
| |
Looks up the corresponding grey value to a serdisp_setsdpixel()-compliant colour value.
- Parameters
-
- Returns
- translated grey value, format
[0 .. 255]
- Since
- 1.98.0
int serdisp_sdcol_init |
( |
serdisp_t * |
dd | ) |
|
- Parameters
-
- Return values
-
0 | no error occured |
-1 | depth/colour-space combination not supported |
- Since
- 1.97.9
int serdisp_setarea |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
int |
w, |
|
|
int |
h, |
|
|
int |
inpmode, |
|
|
byte * |
content |
|
) |
| |
- Parameters
-
dd | device descriptor |
x | x start position |
y | y start position |
w | width |
h | height |
inpmode | (inpmode & 0x00FF): input depth (either 24 or 32 bit)
(inpmode & 0xFF00): flags:
bit 0:
|
content | image data to fill into given area |
- Return values
-
0 | no error occured |
-1 | inpmode not supported |
-2 | not initialised or erraneous parameters |
-3 | position / dimension parameters out of bounds |
Example:
copy the image data from <content> into the screen buffer of <dd> at position 10/10, dimension 50x50. Its depth is 32 and colour scheme is RGB.
The dimension of the image stored in <content> must match parameters w and h!
1 byte* content = <some image byte stream>;
2 serdisp_setarea(dd, 10, 10, 50, 50, 32, content);
- Since
- 1.97.9
void serdisp_setcolour |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
long |
colour |
|
) |
| |
This function sets the colour information hardware independently.
The information is changed in the display buffer only.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
colour | colour
format: 0xAARRGGBB , AA .. alpha, RR .. red, GG .. green, BB .. blue |
Examples:
both set a red pixel in the display buffer at position
(10/20)
1 serdisp_setcolour(dd, 10, 20, 0xFFFF0000);
2 serdisp_setcolour(dd, 10, 20, SD_COL_RED);
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_setsdcol() should be used instead.
void serdisp_setgrey |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
byte |
grey |
|
) |
| |
This function sets the grey value hardware independently.
The information is changed in the display buffer only.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
grey | grey value; format: [0 .. 255] |
Examples:
set a grey value in the display buffer at position
(10/20)
1 serdisp_setgrey(dd, 10, 20, 0xCC);
- Deprecated:
- Old naming scheme for architecture dependent colour functions.
serdisp_setsdgrey() should be used instead.
void serdisp_setsdcol |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SDCol |
sdcol |
|
) |
| |
This function sets the colour information hardware independently.
The information is changed in the display buffer only.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
sdcol | colour
format: 0xAARRGGBB , AA .. alpha, RR .. red, GG .. green, BB .. blue |
Examples:
both set a red pixel in the display buffer at position
(10/20)
1 serdisp_setsdcol(dd, 10, 20, 0xFFFF0000);
2 serdisp_setsdcol(dd, 10, 20, SD_COL_RED);
- Since
- 1.98.0
void serdisp_setsdgrey |
( |
serdisp_t * |
dd, |
|
|
int |
x, |
|
|
int |
y, |
|
|
byte |
grey |
|
) |
| |
This function sets the grey value hardware independently.
The information is changed in the display buffer only.
- Parameters
-
dd | device descriptor |
x | x-position |
y | y-position |
grey | grey value; format: [0 .. 255] |
Examples:
set a grey value in the display buffer at position
(10/20)
1 serdisp_setgrey(dd, 10, 20, 0xCC);
- Since
- 1.98.0
long serdisp_transcolour |
( |
serdisp_t * |
dd, |
|
|
long |
colour |
|
) |
| |
Translates an 0xAARRGGBB
colour value to a hardware dependent value that is suitable for serdisp_setpixel().
- Parameters
-
dd | device descriptor |
colour | 0xAARRGGBB colour value |
- Returns
- translated, serdisp_setpixel()-compliant, hardware dependent colour value
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_transsdcol() should be used instead.
long serdisp_transgrey |
( |
serdisp_t * |
dd, |
|
|
byte |
greyvalue |
|
) |
| |
Translates a grey value to a hardware dependent value that is suitable for serdisp_setpixel()
- Parameters
-
dd | device descriptor |
greyvalue | grey value |
- Returns
- translated, serdisp_setpixel()-compliant, hardware dependent colour value
- Deprecated:
- The byte size of colour is architecture dependent.
Architecture independent function serdisp_transsdgrey() should be used instead.
SDCol serdisp_transsdcol |
( |
serdisp_t * |
dd, |
|
|
SDCol |
sdcol |
|
) |
| |
Translates an 0xAARRGGBB
colour value to a hardware dependent value that is suitable for serdisp_setsdpixel().
- Parameters
-
dd | device descriptor |
sdcol | 0xAARRGGBB colour value |
- Returns
- translated, serdisp_setsdpixel()-compliant, hardware dependent colour value
- Since
- 1.98.0
SDCol serdisp_transsdgrey |
( |
serdisp_t * |
dd, |
|
|
byte |
greyvalue |
|
) |
| |
Translates a grey value to a hardware dependent value that is suitable for serdisp_setsdpixel()
- Parameters
-
dd | device descriptor |
greyvalue | grey value |
- Returns
- translated, serdisp_setsdpixel()-compliant, hardware dependent colour value
- Since
- 1.98.0