void RGB2Lab3ub( unsigned char R, unsigned char G, unsigned char B, unsigned char& L, unsigned char& a, unsigned char& b )
{
	float x, y, z;
	float lt, at, bt;
	RGB2XYZ(R, G, B, x, y, z);
	XYZ2Lab(x, y, z, lt, at, bt);
	L = lt;
	a = at + 128;
	b = bt + 128;
}
void RGB2Lab3f(int R, int G, int B, float& L, float& a, float& b)
{
	float x, y, z;
	RGB2XYZ(R, G, B, x, y, z);
	XYZ2Lab(x, y, z, L, a, b);
}
예제 #3
0
파일: Color.cpp 프로젝트: BeepC/libavg
LchColor RGB2Lch(const Color& rgb)
{
    XYZColor xyz = RGB2XYZ(rgb);
    LabColor lab = XYZ2Lab(xyz);
    return Lab2Lch(lab);
}