CImage *CImageRGBtoYCbCr(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 = RGB2YCbCr(i); ncimg->C[0]->val[p]=t0(i); ncimg->C[1]->val[p]=t1(i); ncimg->C[2]->val[p]=t2(i); } return(ncimg); }
// // In case the user already provided a tone-mapped version of the image, this call already // takes the LDR version of the image, performs no tone-mapping but only a color // decorrelation transformation and injects it as LDR image. virtual void LDRRGB2YCbCr(const RectAngle<LONG> &r,const struct ImageBitMap *const *source, Buffer target) { // There is no tonemapping anyhow... RGB2YCbCr(r,source,target); }