Class NPPNativeMethods.NPPi.YUVToBGR
YUV to BGR color conversion.
Here is how NPP converts YUV to gamma corrected RGB or BGR.
Npp32f nY = (Npp32f)Y;
Npp32f nU = (Npp32f)U - 128.0F;
Npp32f nV = (Npp32f)V - 128.0F;
Npp32f nR = nY + 1.140F * nV;
if (nR < 0.0F) nR = 0.0F;
if (nR > 255.0F) nR = 255.0F;
Npp32f nG = nY - 0.394F * nU - 0.581F * nV;
if (nG < 0.0F) nG = 0.0F;
if (nG > 255.0F) nG = 255.0F;
Npp32f nB = nY + 2.032F * nU;
if (nB < 0.0F) nB = 0.0F;
if (nB > 255.0F) nB = 255.0F;
Inheritance
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public static class YUVToBGR
Methods
nppiYUVToBGR_8u_AC4R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize)
4 channel 8-bit packed YUV with alpha to 4 channel 8-bit unsigned packed BGR color conversion with alpha, not affecting alpha. images.
Declaration
public static NppStatus nppiYUVToBGR_8u_AC4R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiYUVToBGR_8u_C3R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize)
3 channel 8-bit unsigned packed YUV to 3 channel 8-bit unsigned packed BGR color conversion.
Declaration
public static NppStatus nppiYUVToBGR_8u_C3R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | pSrc | Source-Image Pointer. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiYUVToBGR_8u_P3C3R(CUdeviceptr[], Int32, CUdeviceptr, Int32, NppiSize)
3 channel 8-bit unsigned planar YUV to 3 channel 8-bit unsigned packed BGR color conversion.
Declaration
public static NppStatus nppiYUVToBGR_8u_P3C3R(CUdeviceptr[] pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr[] | pSrc | \ref source_planar_image_pointer_array. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr | pDst | Destination-Image Pointer. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiYUVToBGR_8u_P3R(CUdeviceptr[], Int32, CUdeviceptr[], Int32, NppiSize)
3 channel 8-bit unsigned planar YUV to 3 channel 8-bit unsigned planar BGR color conversion.
Declaration
public static NppStatus nppiYUVToBGR_8u_P3R(CUdeviceptr[] pSrc, int nSrcStep, CUdeviceptr[] pDst, int nDstStep, NppiSize oSizeROI)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr[] | pSrc | \ref source_planar_image_pointer_array. |
System.Int32 | nSrcStep | Source-Image Line Step. |
CUdeviceptr[] | pDst | \ref destination_planar_image_pointer_array. |
System.Int32 | nDstStep | Destination-Image Line Step. |
NppiSize | oSizeROI | Region-of-Interest (ROI). |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |