Class NPPNativeMethods.NPPi.ColorToGray
RGB Color to Gray conversion using user supplied conversion coefficients.
Here is how NPP converts gamma corrected RGB Color to Gray using user supplied conversion coefficients.
nGray = aCoeffs[0] * R + aCoeffs[1] * G + aCoeffs[2] * B;
Inheritance
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public static class ColorToGray
Methods
nppiColorToGray_16s_AC4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 16-bit signed packed RGB with alpha to 1 channel 16-bit signed packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16s_AC4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_16s_C3C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
3 channel 16-bit signed packed RGB to 1 channel 16-bit signed packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16s_C3C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_16s_C4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 16-bit signed packed RGBA with alpha to 1 channel 16-bit signed packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16s_C4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_16u_AC4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 16-bit unsigned packed RGB with alpha to 1 channel 16-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16u_AC4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_16u_C3C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
3 channel 16-bit unsigned packed RGB to 1 channel 16-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16u_C3C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_16u_C4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 16-bit unsigned packed RGBA to 1 channel 16-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_16u_C4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_32f_AC4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 32-bit floating point packed RGB with alpha to 1 channel 32-bit floating point packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_32f_AC4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_32f_C3C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
3 channel 32-bit floating point packed RGB to 1 channel 32-bit floating point packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_32f_C3C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_32f_C4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 32-bit floating point packed RGBA with alpha to 1 channel 32-bit floating point packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_32f_C4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_8u_AC4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 8-bit unsigned packed RGB with alpha to 1 channel 8-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_8u_AC4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_8u_C3C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
3 channel 8-bit unsigned packed RGB to 1 channel 8-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_8u_C3C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |
nppiColorToGray_8u_C4C1R(CUdeviceptr, Int32, CUdeviceptr, Int32, NppiSize, Single[])
4 channel 8-bit unsigned packed RGBA to 1 channel 8-bit unsigned packed Gray conversion.
Declaration
public static NppStatus nppiColorToGray_8u_C4C1R(CUdeviceptr pSrc, int nSrcStep, CUdeviceptr pDst, int nDstStep, NppiSize oSizeROI, float[] aCoeffs)
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). |
System.Single[] | aCoeffs | fixed size array of constant floating point conversion coefficient values, one per color channel. |
Returns
Type | Description |
---|---|
NppStatus | StepError, NotEvenStepError, NullPointerError, AlignmentError, StepError, SizeError |