XYZ to RGB color conversion.
More...
|
NppStatus |
nppiXYZToRGB_8u_C3R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
3 channel 8-bit unsigned packed XYZ to 3 channel 8-bit unsigned packed RGB color conversion. More...
|
|
NppStatus |
nppiXYZToRGB_8u_C3R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
NppStatus |
nppiXYZToRGB_8u_AC4R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
4 channel 8-bit unsigned packed XYZ with alpha to 4 channel 8-bit unsigned packed RGB with alpha color conversion. More...
|
|
NppStatus |
nppiXYZToRGB_8u_AC4R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
XYZ to RGB color conversion.
Here is how NPP converts XYZ to gamma corrected RGB or BGR. The code assumes that X,Y, and Z values are in the range [0..1].
*
Npp32f nR = 3.240479F * nNormalizedX - 1.53715F * nNormalizedY - 0.498535F * nNormalizedZ;
* if (nR > 1.0F)
* nR = 1.0F;
*
Npp32f nG = -0.969256F * nNormalizedX + 1.875991F * nNormalizedY + 0.041556F * nNormalizedZ;
* if (nG > 1.0F)
* nG = 1.0F;
*
Npp32f nB = 0.055648F * nNormalizedX - 0.204043F * nNormalizedY + 1.057311F * nNormalizedZ;
* if (nB > 1.0F)
* nB = 1.0F;
* R = (
Npp8u)(nR * 255.0F);
* G = (
Npp8u)(nG * 255.0F);
* B = (
Npp8u)(nB * 255.0F);
*