Bsoft function
img_gray2color
Source:
src/img/img_colour.c
Description:
Converts an image from gray scale to RGB or RGBA.
Algorithm:
The image is first converted to byte format.
Each byte is then expanded to three with the same value.
The key variable that is changed is the number channels, going from
one for gray scale images to three for RGB.
If the alpha flag is nonzero the fourth channel (transparency or alpha)
is set to 0 if the input is zero and 255 otherwise.
Arguments:
| Bimage* p | image (replaced by new image).
|
| int alpha | flag to indicate alpha channel.
|
Returns:
int error code.
Prototype:
int img_gray2color(Bimage* p, int alpha)
Functions used:
balloc
bfree
Other objects included:
struct Bimage
Generated by bdoc.pl on Mon Jun 15 11:47:25 2009
Back to the Bsoft home