Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RwRGBA
[Fundamental Types]


Data Structures

struct   RwRGBA
struct   RwRGBAReal

Functions

void  RwRGBARealAdd (RwRGBAReal *result, const RwRGBAReal *source1, const RwRGBAReal *source2)
void  RwRGBARealSub (RwRGBAReal *result, const RwRGBAReal *source1, const RwRGBAReal *source2)
void  RwRGBARealScale (RwRGBAReal *result, const RwRGBAReal *source, RwReal scalar)
void  RwRGBAFromRwRGBAReal (RwRGBA *result, const RwRGBAReal *source)
void  RwRGBARealFromRwRGBA (RwRGBAReal *result, RwRGBA *source)
RwUInt32  RwRGBAToPixel (RwRGBA *rgbIn, RwInt32 rasterFormat)
RwRGBA RwRGBASetFromPixel (RwRGBA *rgbOut, RwUInt32 pixelValue, RwInt32 rasterFormat)
RwRGBA RwRGBAGammaCorrect (RwRGBA *rgb)
RwRGBA RwRGBAGetRasterPixel (RwRGBA *rgbOut, RwRaster *raster, RwInt32 x, RwInt32 y)

Detailed Description

Color space functionality.

RwRGBA Overview

Requirements

Overview

This object represents color and alpha components.

The data is usually stored combined into a single 32-bit integer, with 8 bits per component, although this should not be assumed.

Functions are provided to convert to and from the RwRGBAReal format, which uses individual RwReals to store each component. (Other RenderWare objects usually use the RwRGBA form, but a real number variant is useful for some color processing tasks.)

Further functionality is provided for tasks like gamma correction, storing and retrieving RGBA data directly from a pixel.


Function Documentation

void RwRGBAFromRwRGBAReal RwRGBA   result,
const RwRGBAReal   source
 

RwRGBAFromRwRGBAReal is used to convert the specified real color to an RwRGBA. RwRGBA is an integer representation of the color.

Note:
Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
Parameters:
result  A pointer to the RwRGBA color which will receive the result
source  A pointer to the real color that will be converted.
Returns:
None.
See also:
RwRGBARealFromRwRGBA , RwRGBARealScale , RwRGBARealAdd , RwRGBARealSub
RwRGBA* RwRGBAGammaCorrect RwRGBA   rgb
 

RwRGBAGammaCorrect is used to gamma correct an individual RwRGBA pixel according to the current gamma correction value. The gamma value is specified using the function RwImageSetGamma.

Parameters:
rgb  A pinter to the RwRGBA value which is to be gamma corrected.
Returns:
Returns a pointer to the gamma corrected RwRGBA value.
See also:
RwImageSetGamma , RwImageGetGamma , RwRGBASetFromPixel , RwRGBAToPixel , RwRGBAGetRasterPixel
RwRGBA* RwRGBAGetRasterPixel RwRGBA   rgbOut,
RwRaster   raster,
RwInt32    x,
RwInt32    y
 

RwRGBAGetRasterPixel is used to query the value a pixel in the specified raster at the given location.

Parameters:
rgbOut  A pointer to an RwRGBA value which will receive the pixel value
raster  A pointer to the raster to query
x  An RwInt32 value equal to the pixels x-coordinate in the raster
y  An RwInt32 value equal to the pixels y-coordinate in the raster.
Returns:
Returns a pointer to the pixel value if successful or NULL if there an error.
See also:
RwRGBASetFromPixel , RwRGBAToPixel
void RwRGBARealAdd RwRGBAReal   result,
const RwRGBAReal   source1,
const RwRGBAReal   source2
 

RwRGBARealAdd is used to add together the specified real colors. The result of the addition is placed in a third real color.

Note:
Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
Parameters:
result  A pointer to the real color that will receive the result of the addition
source1  A pointer to the first real color
source2  A pointer to the second real color.
Returns:
None.
See also:
RwRGBARealSub , RwRGBARealScale
void RwRGBARealFromRwRGBA RwRGBAReal   result,
RwRGBA   source
 

RwRGBARealFromRwRGBA is used to convert the specified RwRGBA color to a real color. RwRGBA is an integer representation of the color.

Note:
Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
Parameters:
result  A pointer to the real color that will receive the result
source  A pointer to the RwRGBA color that will be converted.
Returns:
None.
See also:
RwRGBAFromRwRGBAReal , RwRGBARealScale , RwRGBARealAdd , RwRGBARealSub
void RwRGBARealScale RwRGBAReal   result,
const RwRGBAReal   source,
RwReal    scalar
 

RwRGBARealScale is used to multiply the specified real color by the given scalar. The result is placed in a second real color.

Note:
Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
Parameters:
result  A pointer to the real color that will receive the result
source  A pointer to the real color that will be scaled
scalar  An RwReal value equal to the scale factor.
Returns:
None.
See also:
RwRGBARealAdd , RwRGBARealSub
void RwRGBARealSub RwRGBAReal   result,
const RwRGBAReal   source1,
const RwRGBAReal   source2
 

RwRGBARealSub is used to subtract the specified real colors. The second color is subtracted from the first. The result of the subtraction is placed in a third real color.

Note:
Note that this function is used for debug purposes only and, for efficiency, is available as a macro for final release versions of an application.
Parameters:
result  A pointer to the real color that will receive the result of the subtraction
source1  A pointer to the first real color
source2  A pointer to the second real color.
Returns:
None.
See also:
RwRGBARealAdd , RwRGBARealScale
RwRGBA* RwRGBASetFromPixel RwRGBA   rgbOut,
RwUInt32    pixelValue,
RwInt32    rasterFormat
 

RwRGBASetFromPixel is used to convert a device dependent pixel value into an RwRGBA value.

Parameters:
rgbOut  A pointer to an RwRGBA that will receive the converted value
pixelValue  An RwInt32 value equal to the device dependent pixel value
rasterFormat  An RwInt32 value specifying the raster format to convert for.
Returns:
Returns pointer to the converted pixel value.
See also:
RwRGBAToPixel , RwRGBAGetRasterPixel , RwRasterCreate , RwRasterGetFormat
RwUInt32 RwRGBAToPixel RwRGBA   rgbIn,
RwInt32    rasterFormat
 

RwRGBAToPixel is used to convert an RwRGBA value into a device dependent pixel value.

Parameters:
rgbIn  A pointer to the RwRGBA value to convert
rasterFormat  An RwInt32 value specifying the raster format to convert for.
Returns:
Returns the device dependent pixel value if successful or zero is there is an error.
See also:
RwRGBASetFromPixel , RwRGBAGetRasterPixel , RwRasterCreate , RwRasterGetFormat

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:13 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)