NVIDIA 2D Image And Signal Performance Primitives (NPP)  Version 11.3.0.*
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions

RGB to XYZ color conversion. More...

Functions

NppStatus  nppiRGBToXYZ_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 XYZ color conversion. More...
 
NppStatus  nppiRGBToXYZ_8u_C3R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI)
 
NppStatus  nppiRGBToXYZ_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 XYZ with alpha color conversion. More...
 
NppStatus  nppiRGBToXYZ_8u_AC4R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI)
 

Detailed Description

RGB to XYZ color conversion.

Here is how NPP converts gamma corrected RGB or BGR to XYZ.

* Npp32f nNormalizedR = (Npp32f)R * 0.003921569F; // / 255.0F
* Npp32f nNormalizedG = (Npp32f)G * 0.003921569F;
* Npp32f nNormalizedB = (Npp32f)B * 0.003921569F;
* Npp32f nX = 0.412453F * nNormalizedR + 0.35758F * nNormalizedG + 0.180423F * nNormalizedB;
* if (nX > 1.0F)
* nX = 1.0F;
* Npp32f nY = 0.212671F * nNormalizedR + 0.71516F * nNormalizedG + 0.072169F * nNormalizedB;
* if (nY > 1.0F)
* nY = 1.0F;
* Npp32f nZ = 0.019334F * nNormalizedR + 0.119193F * nNormalizedG + 0.950227F * nNormalizedB;
* if (nZ > 1.0F)
* nZ = 1.0F;
* X = (Npp8u)(nX * 255.0F);
* Y = (Npp8u)(nY * 255.0F);
* Z = (Npp8u)(nZ * 255.0F);
*

Function Documentation

NppStatus nppiRGBToXYZ_8u_AC4R ( const Npp8u pSrc,
int  nSrcStep,
Npp8u pDst,
int  nDstStep,
NppiSize  oSizeROI 
)
NppStatus nppiRGBToXYZ_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 XYZ with alpha color conversion.

Parameters
pSrc Source-Image Pointer.
nSrcStep Source-Image Line Step.
pDst Destination-Image Pointer.
nDstStep Destination-Image Line Step.
oSizeROI Region-of-Interest (ROI).
nppStreamCtx Application Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes
NppStatus nppiRGBToXYZ_8u_C3R ( const Npp8u pSrc,
int  nSrcStep,
Npp8u pDst,
int  nDstStep,
NppiSize  oSizeROI 
)
NppStatus nppiRGBToXYZ_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 XYZ color conversion.

Parameters
pSrc Source-Image Pointer.
nSrcStep Source-Image Line Step.
pDst Destination-Image Pointer.
nDstStep Destination-Image Line Step.
oSizeROI Region-of-Interest (ROI).
nppStreamCtx Application Managed Stream Context.
Returns
Image Data Related Error Codes, ROI Related Error Codes