Class NPPImage_8sC2
Implements
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public class NPPImage_8sC2 : NPPImageBase, IDisposable
Constructors
| Improve this Doc View SourceNPPImage_8sC2(CUdeviceptr, NppiSize, Int32)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_8sC2(CUdeviceptr devPtr, NppiSize size, int pitch)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
NppiSize | size | Image size |
System.Int32 | pitch | Pitch / Line step |
NPPImage_8sC2(CUdeviceptr, NppiSize, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_8sC2(CUdeviceptr devPtr, NppiSize size, int pitch, bool isOwner)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
NppiSize | size | Image size |
System.Int32 | pitch | Pitch / Line step |
System.Boolean | isOwner | If TRUE, devPtr is freed when disposing |
NPPImage_8sC2(CUdeviceptr, Int32, Int32, Int32)
Creates a new NPPImage from allocated device ptr. Does not take ownership of decPtr.
Declaration
public NPPImage_8sC2(CUdeviceptr devPtr, int width, int height, int pitch)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
System.Int32 | width | Image width in pixels |
System.Int32 | height | Image height in pixels |
System.Int32 | pitch | Pitch / Line step |
NPPImage_8sC2(CUdeviceptr, Int32, Int32, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_8sC2(CUdeviceptr devPtr, int width, int height, int pitch, bool isOwner)
Parameters
Type | Name | Description |
---|---|---|
CUdeviceptr | devPtr | Already allocated device ptr. |
System.Int32 | width | Image width in pixels |
System.Int32 | height | Image height in pixels |
System.Int32 | pitch | Pitch / Line step |
System.Boolean | isOwner | If TRUE, devPtr is freed when disposing |
NPPImage_8sC2(NPPImageBase)
Creates a new NPPImage from allocated device ptr. Does not take ownership of inner image device pointer.
Declaration
public NPPImage_8sC2(NPPImageBase image)
Parameters
Type | Name | Description |
---|---|---|
NPPImageBase | image | NPP image |
NPPImage_8sC2(NppiSize)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_8sC2(NppiSize size)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | size | Image size |
NPPImage_8sC2(Int32, Int32)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_8sC2(int nWidthPixels, int nHeightPixels)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nWidthPixels | Image width in pixels |
System.Int32 | nHeightPixels | Image height in pixels |
Methods
| Improve this Doc View SourceAlphaComp(NPPImage_8sC2, NPPImage_8sC2, NppiAlphaOp)
Image composition using image alpha values (0 - max channel pixel value). Also the function is called *AC1R, it is a two channel image with second channel as alpha.
Declaration
public void AlphaComp(NPPImage_8sC2 src2, NPPImage_8sC2 dest, NppiAlphaOp nppAlphaOp)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
NPPImage_8sC2 | dest | Destination image |
NppiAlphaOp | nppAlphaOp | alpha compositing operation |
AverageError(NPPImage_8sC2, CudaDeviceVariable<Double>)
image average error. User buffer is internally allocated and freed.
Declaration
public void AverageError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageError(NPPImage_8sC2, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average error.
Declaration
public void AverageError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the AverageError operation. |
AverageErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for AverageError.
Declaration
public int AverageErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
AverageRelativeError(NPPImage_8sC2, CudaDeviceVariable<Double>)
image average relative error. User buffer is internally allocated and freed.
Declaration
public void AverageRelativeError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageRelativeError(NPPImage_8sC2, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average relative error.
Declaration
public void AverageRelativeError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the AverageRelativeError operation. |
AverageRelativeErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for AverageRelativeError.
Declaration
public int AverageRelativeErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
ColorTwist(NPPImage_8sC2, Single[,])
An input color twist matrix with floating-point pixel values is applied within ROI.
Declaration
public void ColorTwist(NPPImage_8sC2 dest, float[, ] twistMatrix)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | dest | Destination image |
System.Single[,] | twistMatrix | The color twist matrix with floating-point pixel values [3,4]. |
ColorTwist(Single[,])
in place color twist.
An input color twist matrix with floating-point coefficient values is applied within ROI.
Declaration
public void ColorTwist(float[, ] aTwist)
Parameters
Type | Name | Description |
---|---|---|
System.Single[,] | aTwist | The color twist matrix with floating-point coefficient values. [3,4] |
Copy(NPPImage_8sC2)
Image copy.
Declaration
public void Copy(NPPImage_8sC2 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | dst | Destination image |
Filter(NPPImage_8sC2, CudaDeviceVariable<Single>, NppiSize, NppiPoint)
convolution filter.
Declaration
public void Filter(NPPImage_8sC2 dst, CudaDeviceVariable<float> pKernel, NppiSize oKernelSize, NppiPoint oAnchor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | dst | Destination-Image |
CudaDeviceVariable<System.Single> | pKernel | Pointer to the start address of the kernel coefficient array. Coefficients are expected to be stored in reverse order. |
NppiSize | oKernelSize | Width and Height of the rectangular kernel. |
NppiPoint | oAnchor | X and Y offsets of the kernel origin frame of reference |
FilterBorder(NPPImage_8sC2, CudaDeviceVariable<Single>, NppiSize, NppiPoint, NppiBorderType)
Two channel 8-bit signed convolution filter with border control.
General purpose 2D convolution filter using floating-point weights with border control.
Pixels under the mask are multiplied by the respective weights in the mask and the results are summed. Before writing the result pixel the sum is scaled back via division by nDivisor. If any portion of the mask overlaps the source image boundary the requested border type operation is applied to all mask pixels which fall outside of the source image.
Declaration
public void FilterBorder(NPPImage_8sC2 dest, CudaDeviceVariable<float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | dest | Destination image |
CudaDeviceVariable<System.Single> | pKernel | Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order |
NppiSize | nKernelSize | Width and Height of the rectangular kernel. |
NppiPoint | oAnchor | X and Y offsets of the kernel origin frame of reference relative to the source pixel. |
NppiBorderType | eBorderType | The border type operation to be applied at source image border boundaries. |
Finalize()
For dispose
Declaration
protected void Finalize()
MaxError(NPPImage_8sC2, CudaDeviceVariable<Double>)
image maximum error. User buffer is internally allocated and freed.
Declaration
public void MaxError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaxError(NPPImage_8sC2, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum error.
Declaration
public void MaxError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the MaxError operation. |
MaxErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for MaxError.
Declaration
public int MaxErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
MaximumRelativeError(NPPImage_8sC2, CudaDeviceVariable<Double>)
image maximum relative error. User buffer is internally allocated and freed.
Declaration
public void MaximumRelativeError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaximumRelativeError(NPPImage_8sC2, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum relative error.
Declaration
public void MaximumRelativeError(NPPImage_8sC2 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
CudaDeviceVariable<System.Byte> | buffer | Pointer to the user-allocated scratch buffer required for the MaximumRelativeError operation. |
MaximumRelativeErrorGetBufferHostSize()
Device scratch buffer size (in bytes) for MaximumRelativeError.
Declaration
public int MaximumRelativeErrorGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
Set(SByte[])
Set pixel values to nValue.
Declaration
public void Set(sbyte[] nValue)
Parameters
Type | Name | Description |
---|---|---|
System.SByte[] | nValue | Value to be set |
ToCudaPitchedDeviceVariable()
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public CudaPitchedDeviceVariable<char2> ToCudaPitchedDeviceVariable()
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<char2> |
Operators
| Improve this Doc View SourceImplicit(CudaPitchedDeviceVariable<char2> to NPPImage_8sC2)
Converts a CudaPitchedDeviceVariable to a NPPImage
Declaration
public static implicit operator NPPImage_8sC2(CudaPitchedDeviceVariable<char2> img)
Parameters
Type | Name | Description |
---|---|---|
CudaPitchedDeviceVariable<char2> | img | CudaPitchedDeviceVariable |
Returns
Type | Description |
---|---|
NPPImage_8sC2 | NPPImage with the same device pointer and size of CudaPitchedDeviceVariable with ROI set to full image |
Implicit(NPPImage_8sC2 to CudaPitchedDeviceVariable<char2>)
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public static implicit operator CudaPitchedDeviceVariable<char2>(NPPImage_8sC2 img)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC2 | img | NPPImage |
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<char2> | CudaPitchedDeviceVariable with the same device pointer and size of NPPImage without ROI information |