CImage *CImageXYZtoRGB(CImage *cimg) { CImage *ncimg=NULL; int p,n,i; ncimg = CreateCImage(cimg->C[0]->ncols,cimg->C[0]->nrows); n = ncimg->C[0]->ncols*ncimg->C[0]->nrows; for (p=0; p < n; p++){ i = triplet(cimg->C[0]->val[p],cimg->C[1]->val[p],cimg->C[2]->val[p]); i = XYZ2RGB(i); ncimg->C[0]->val[p]=t0(i); ncimg->C[1]->val[p]=t1(i); ncimg->C[2]->val[p]=t2(i); } return(ncimg); }
void Lab3f2RGB3ub( float L, float a, float b, unsigned char& R, unsigned char& G, unsigned char& B ) { float x, y, z; Lab2XYZ(L, a, b, x, y, z); XYZ2RGB(x, y, z, R, G, B); }
Color Lch2RGB(const LchColor& lch) { LabColor lab = Lch2Lab(lch); XYZColor xyz = Lab2XYZ(lab); return XYZ2RGB(xyz); }