GRRLIB_pixel.h File Reference

Inline functions for manipulating pixels in textures. More...

Functions

INLINE u32 GRRLIB_GetPixelFromtexImg (const int x, const int y, const GRRLIB_texImg *tex)
 Return the color value of a pixel from a GRRLIB_texImg.
INLINE void GRRLIB_SetPixelTotexImg (const int x, const int y, GRRLIB_texImg *tex, const u32 color)
 Set the color value of a pixel to a GRRLIB_texImg.
INLINE u32 GRRLIB_GetColor (const u8 r, const u8 g, const u8 b, const u8 a)
 Converts RGBA values to u32 color.
INLINE void GRRLIB_GetPixelFromFB (int x, int y, u8 *R1, u8 *G1, u8 *B1, u8 *R2, u8 *G2, u8 *B2)
 Reads a pixel directly from the FrontBuffer.

Detailed Description

Inline functions for manipulating pixels in textures.


Function Documentation

INLINE u32 GRRLIB_GetColor ( const u8  r,
const u8  g,
const u8  b,
const u8  a 
)

Converts RGBA values to u32 color.

Parameters:
r Amount of red (0 - 255).
g Amount of green (0 - 255).
b Amount of blue (0 - 255).
a Amount of alpha (0 - 255).
Returns:
Returns the color in u32 format.
INLINE void GRRLIB_GetPixelFromFB ( int  x,
int  y,
u8 *  R1,
u8 *  G1,
u8 *  B1,
u8 *  R2,
u8 *  G2,
u8 *  B2 
)

Reads a pixel directly from the FrontBuffer.

Since the FB is stored in YCbCr,

Parameters:
x The x-coordinate within the FB.
y The y-coordinate within the FB.
R1 A pointer to a variable receiving the first Red value.
G1 A pointer to a variable receiving the first Green value.
B1 A pointer to a variable receiving the first Blue value.
R2 A pointer to a variable receiving the second Red value.
G2 A pointer to a variable receiving the second Green value.
B2 A pointer to a variable receiving the second Blue value.

Color channel: Colors[0] = Y1 Colors[1] = Cb Colors[2] = Y2 Colors[3] = Cr

INLINE u32 GRRLIB_GetPixelFromtexImg ( const int  x,
const int  y,
const GRRLIB_texImg tex 
)

Return the color value of a pixel from a GRRLIB_texImg.

Parameters:
x Specifies the x-coordinate of the pixel in the texture.
y Specifies the y-coordinate of the pixel in the texture.
tex The texture to get the color from.
Returns:
The color of a pixel in RGBA format.
INLINE void GRRLIB_SetPixelTotexImg ( const int  x,
const int  y,
GRRLIB_texImg tex,
const u32  color 
)

Set the color value of a pixel to a GRRLIB_texImg.

See also:
GRRLIB_FlushTex
Parameters:
x Specifies the x-coordinate of the pixel in the texture.
y Specifies the y-coordinate of the pixel in the texture.
tex The texture to set the color to.
color The color of the pixel in RGBA format.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Fri Sep 25 14:44:35 2009 for GRRLIB by  doxygen 1.6.1