|
From: Petr M. <mi...@ph...> - 2003-11-05 15:38:38
|
In summary:
**************** color.h **************
*** this we keep:
/* Contains a colour in RGB scheme.
Values of r, g and b are all in range [0;1] */
typedef struct {
double r, g, b;
} rgb_color;
*** new structure:
/* Contains a colour in RGB scheme.
Values of r, g and b are all in range [0;255] */
typedef struct {
unsigned char r, g, b;
} rgb255_color;
**************** getcolor.h **************
void color_from_gray( double gray, rgb_color *color )
=> will be renamed to
void rgb1_from_gray( double gray, rgb_color *color )
New routine:
void rgb255_from_rgb1( rgb_color *color1, rgb255_color *color255 )
{
*color255.r = (unsigned char)(255 * color1.r + 0.5);
*color255.g = (unsigned char)(255 * color1.g + 0.5);
*color255.b = (unsigned char)(255 * color1.b + 0.5);
}
void rgb_from_gray( double gray,
unsigned char *r, unsigned char *g, unsigned char *b )
=> will be renamed and changed to
void rgb255_from_gray( double gray, rgb255_color *color )
{
rgb_color color1;
color_from_gray( gray, &color1 );
rgb255_from_rgb1( &color1, color );
}
> I think it should be bundled up into a separate patch so that it can be
> tested independent of your pixel/image stuff.
It is code cleanup, so I will put it directly into cvs (sending you the
patch in advance for test).
Further, I remember: the other candidate for rename is
set_pm3d_zminmax() => set_cbminmax()
---
Petr Mikulik
|