Miscellaneous utilities for the PVR API.
More...
#include <stdint.h>
#include <sys/cdefs.h>
Go to the source code of this file.
|
#define | PVR_PACK_COLOR(a, r, g, b) |
| Pack four floating point color values into a 32-bit integer form.
|
|
Miscellaneous utilities for the PVR API.
- Author
- Megan Potter
-
Roger Cattermole
-
Paul Boese
-
Brian Paul
-
Lawrence Sebald
-
Benoit Miller
-
Ruslan Rostovtsev
-
Falco Girgis
◆ PVR_PACK_COLOR
#define PVR_PACK_COLOR |
( |
| a, |
|
|
| r, |
|
|
| g, |
|
|
| b ) |
Value: ( \
( ((uint8_t)( (a) * 255 ) ) << 24 ) | \
( ((uint8_t)( (r) * 255 ) ) << 16 ) | \
( ((uint8_t)( (g) * 255 ) ) << 8 ) | \
( ((uint8_t)( (b) * 255 ) ) << 0 ) )
Pack four floating point color values into a 32-bit integer form.
All of the color values should be between 0 and 1.
- Parameters
-
a | Alpha value |
r | Red value |
g | Green value |
b | Blue value |
- Returns
- The packed color value
◆ PVR_PACK_16BIT_UV()
static uint32_t PVR_PACK_16BIT_UV |
( |
float | u, |
|
|
float | v ) |
|
inlinestatic |
Pack two floating point coordinates into one 32-bit value, truncating them to 16-bits each.
- Parameters
-
u | First coordinate to pack |
v | Second coordinate to pack |
- Returns
- The packed coordinates