RGB to PhotoYCC color conversion.
More...
|
NppStatus |
nppiRGBToYCC_8u_C3R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
3 channel 8-bit unsigned packed RGB to 3 channel 8-bit unsigned packed YCC color conversion. More...
|
|
NppStatus |
nppiRGBToYCC_8u_C3R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
NppStatus |
nppiRGBToYCC_8u_AC4R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
4 channel 8-bit unsigned packed RGB with alpha to 4 channel 8-bit unsigned packed YCC with alpha color conversion. More...
|
|
NppStatus |
nppiRGBToYCC_8u_AC4R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
RGB to PhotoYCC color conversion.
This is how NPP converts gamma corrected BGR or RGB to PhotoYCC. The computed Y, C1, C2 values are then quantized and converted to fit in the range [0..1] before expanding to 8 bits.
*
Npp32f nY = 0.299F * nNormalizedR + 0.587F * nNormalizedG + 0.114F * nNormalizedB;
*
Npp32f nC1 = nNormalizedB - nY;
* nC1 = 111.4F * 0.003921569F * nC1 + 156.0F * 0.003921569F;
*
Npp32f nC2 = nNormalizedR - nY;
* nC2 = 135.64F * 0.003921569F * nC2 + 137.0F * 0.003921569F;
* nY = 1.0F * 0.713267F * nY;
* Y = (
Npp8u)(nY * 255.0F);
* C1 = (
Npp8u)(nC1 * 255.0F);
* C2 = (
Npp8u)(nC2 * 255.0F);
*