HLS to RGB color conversion.
More...
|
NppStatus |
nppiHLSToRGB_8u_C3R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
3 channel 8-bit unsigned packed HLS to 3 channel 8-bit unsigned packed RGB color conversion. More...
|
|
NppStatus |
nppiHLSToRGB_8u_C3R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
NppStatus |
nppiHLSToRGB_8u_AC4R_Ctx (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI, NppStreamContext nppStreamCtx) |
|
4 channel 8-bit unsigned packed HLS with alpha to 4 channel 8-bit unsigned packed RGB with alpha color conversion. More...
|
|
NppStatus |
nppiHLSToRGB_8u_AC4R (const Npp8u *pSrc, int nSrcStep, Npp8u *pDst, int nDstStep, NppiSize oSizeROI) |
|
HLS to RGB color conversion.
This is how NPP converts HLS to gamma corrected RGB or BGR.
* if (nNormalizedL <= 0.5F)
* nM2 = nNormalizedL * (1.0F + nNormalizedS);
* else
* nM2 = nNormalizedL + nNormalizedS - nNormalizedL * nNormalizedS;
* nM1 = 2.0F * nNormalizedL - nM2;
* if (nNormalizedS == 0.0F)
* nR = nG = nB = nNormalizedL;
* else
* {
* nh = nNormalizedH + 0.3333F;
* if (nh > 1.0F)
* nh -= 1.0F;
* }
* if (0.6667F < nh)
* nR = nM1;
* else
* {
* if (nh < 0.1667F)
* nR = (nM1 + nMDiff * nh * 6.0F);
* else if (nh < 0.5F)
* nR = nM2;
* else
* nR = nM1 + nMDiff * ( 0.6667F - nh ) * 6.0F;
* }
* if (nR > 1.0F)
* nR = 1.0F;
* nh = nNormalizedH;
* if (0.6667F < nh)
* nG = nM1;
* else
* {
* if (nh < 0.1667F)
* nG = (nM1 + nMDiff * nh * 6.0F);
* else if (nh < 0.5F)
* nG = nM2;
* else
* nG = nM1 + nMDiff * (0.6667F - nh ) * 6.0F;
* }
* if (nG > 1.0F)
* nG = 1.0F;
* nh = nNormalizedH - 0.3333F;
* if (nh < 0.0F)
* nh += 1.0F;
* if (0.6667F < nh)
* nB = nM1;
* else
* {
* if (nh < 0.1667F)
* nB = (nM1 + nMDiff * nh * 6.0F);
* else if (nh < 0.5F)
* nB = nM2;
* else
* nB = nM1 + nMDiff * (0.6667F - nh ) * 6.0F;
* }
* if (nB > 1.0F)
* nB = 1.0F;
* R = (
Npp8u)(nR * 255.0F);
* G = (
Npp8u)(nG * 255.0F);
* B = (
Npp8u)(nB * 255.0F);
*