Class NPPImage_32sC1
Implements
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public class NPPImage_32sC1 : NPPImageBase, IDisposable
Constructors
| Improve this Doc View SourceNPPImage_32sC1(CUdeviceptr, NppiSize, Int32)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC1(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_32sC1(CUdeviceptr, NppiSize, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC1(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_32sC1(CUdeviceptr, Int32, Int32, Int32)
Creates a new NPPImage from allocated device ptr. Does not take ownership of decPtr.
Declaration
public NPPImage_32sC1(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_32sC1(CUdeviceptr, Int32, Int32, Int32, Boolean)
Creates a new NPPImage from allocated device ptr.
Declaration
public NPPImage_32sC1(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_32sC1(NPPImageBase)
Creates a new NPPImage from allocated device ptr. Does not take ownership of inner image device pointer.
Declaration
public NPPImage_32sC1(NPPImageBase image)
Parameters
Type | Name | Description |
---|---|---|
NPPImageBase | image | NPP image |
NPPImage_32sC1(NppiSize)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_32sC1(NppiSize size)
Parameters
Type | Name | Description |
---|---|---|
NppiSize | size | Image size |
NPPImage_32sC1(Int32, Int32)
Allocates new memory on device using NPP-Api.
Declaration
public NPPImage_32sC1(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 SourceAdd(NPPImage_32sC1, NPPImage_32sC1, Int32)
Image addition, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(NPPImage_32sC1 src2, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Add(NPPImage_32sC1, Int32)
In place image addition, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(NPPImage_32sC1 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Add(Int32, NPPImage_32sC1, Int32)
Add constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Add(int nConstant, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value to add |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Add(Int32, Int32)
Add constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Add(int nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value to add |
System.Int32 | nScaleFactor | scaling factor |
AlphaComp(Int32, NPPImage_32sC1, Int32, NPPImage_32sC1, NppiAlphaOp)
Image composition using constant alpha.
Declaration
public void AlphaComp(int alpha1, NPPImage_32sC1 src2, int alpha2, NPPImage_32sC1 dest, NppiAlphaOp nppAlphaOp)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | alpha1 | constant alpha for this image |
NPPImage_32sC1 | src2 | 2nd source image |
System.Int32 | alpha2 | constant alpha for src2 |
NPPImage_32sC1 | dest | Destination image |
NppiAlphaOp | nppAlphaOp | alpha compositing operation |
And(NPPImage_32sC1)
In place image logical and.
Declaration
public void And(NPPImage_32sC1 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
And(NPPImage_32sC1, NPPImage_32sC1)
Image logical and.
Declaration
public void And(NPPImage_32sC1 src2, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
And(Int32)
In place image logical and with constant.
Declaration
public void And(int nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
And(Int32, NPPImage_32sC1)
Image logical and with constant.
Declaration
public void And(int nConstant, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
NPPImage_32sC1 | dest | Destination image |
AverageError(NPPImage_32sC1, CudaDeviceVariable<Double>)
image average error. User buffer is internally allocated and freed.
Declaration
public void AverageError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageError(NPPImage_32sC1, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average error.
Declaration
public void AverageError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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_32sC1, CudaDeviceVariable<Double>)
image average relative error. User buffer is internally allocated and freed.
Declaration
public void AverageRelativeError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
AverageRelativeError(NPPImage_32sC1, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image average relative error.
Declaration
public void AverageRelativeError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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 |
Convert(NPPImage_16sC1, NppRoundMode, Int32)
32-bit signed to 16-bit signed conversion.
Declaration
public void Convert(NPPImage_16sC1 dst, NppRoundMode roundMode, int scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_16sC1 | dst | Destination image |
NppRoundMode | roundMode | Round mode |
System.Int32 | scaleFactor | scaling factor |
Convert(NPPImage_16uC1, NppRoundMode, Int32)
32-bit signed to 16-bit unsigned conversion.
Declaration
public void Convert(NPPImage_16uC1 dst, NppRoundMode roundMode, int scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_16uC1 | dst | Destination image |
NppRoundMode | roundMode | Round mode |
System.Int32 | scaleFactor | scaling factor |
Convert(NPPImage_32fC1)
32-bit signed to 32-bit float conversion.
Declaration
public void Convert(NPPImage_32fC1 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32fC1 | dst | Destination image |
Convert(NPPImage_32uC1)
32-bit signed to 32-bit unsigned conversion.
Declaration
public void Convert(NPPImage_32uC1 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32uC1 | dst | Destination image |
Convert(NPPImage_8sC1)
32-bit signed to 8-bit signed conversion.
Declaration
public void Convert(NPPImage_8sC1 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8sC1 | dst | Destination image |
Convert(NPPImage_8uC1)
32-bit signed to 8-bit unsigned conversion.
Declaration
public void Convert(NPPImage_8uC1 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8uC1 | dst | Destination image |
Copy(NPPImage_32sC1)
Image copy.
Declaration
public void Copy(NPPImage_32sC1 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination image |
Copy(NPPImage_32sC1, NPPImage_8uC1)
Masked Operation 8-bit unsigned image copy.
Declaration
public void Copy(NPPImage_32sC1 dst, NPPImage_8uC1 mask)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination image |
NPPImage_8uC1 | mask | Mask image |
Copy(NPPImage_32sC1, Int32, Int32, Int32)
Copy image and pad borders with a constant, user-specifiable color.
Declaration
public void Copy(NPPImage_32sC1 dst, int nTopBorderHeight, int nLeftBorderWidth, int nValue)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination image. The image ROI defines the destination region, i.e. the region that gets filled with data from the source image (inner part) and constant border color (outer part). |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
System.Int32 | nValue | The pixel value to be set for border pixels. |
Copy(NPPImage_32sC3, Int32)
Image copy.
Declaration
public void Copy(NPPImage_32sC3 dst, int channel)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination image |
System.Int32 | channel | Channel number. This number is added to the dst pointer |
Copy(NPPImage_32sC4, Int32)
Image copy.
Declaration
public void Copy(NPPImage_32sC4 dst, int channel)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | dst | Destination image |
System.Int32 | channel | Channel number. This number is added to the dst pointer |
CopyReplicateBorder(NPPImage_32sC1, Int32, Int32)
image copy with nearest source image pixel color.
Declaration
public void CopyReplicateBorder(NPPImage_32sC1 dst, int nTopBorderHeight, int nLeftBorderWidth)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination-Image |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
CopySubpix(NPPImage_32sC1, Single, Single)
linearly interpolated source image subpixel coordinate color copy.
Declaration
public void CopySubpix(NPPImage_32sC1 dst, float nDx, float nDy)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination-Image |
System.Single | nDx | Fractional part of source image X coordinate. |
System.Single | nDy | Fractional part of source image Y coordinate. |
CopyWrapBorder(NPPImage_32sC1, Int32, Int32)
image copy with the borders wrapped by replication of source image pixel colors.
Declaration
public void CopyWrapBorder(NPPImage_32sC1 dst, int nTopBorderHeight, int nLeftBorderWidth)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination-Image |
System.Int32 | nTopBorderHeight | Height (in pixels) of the top border. The height of the border at the bottom of the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight = oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height. |
System.Int32 | nLeftBorderWidth | Width (in pixels) of the left border. The width of the border at the right side of the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth = oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width. |
Div(NPPImage_32sC1, NPPImage_32sC1, Int32)
Image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(NPPImage_32sC1 src2, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Div(NPPImage_32sC1, Int32)
In place image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(NPPImage_32sC1 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Div(Int32, NPPImage_32sC1, Int32)
Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Div(int nConstant, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Div(Int32, Int32)
Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Div(int nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
System.Int32 | nScaleFactor | scaling factor |
DotProdGetBufferHostSize()
Device scratch buffer size (in bytes) for nppiDotProd_32s64f_C1R.
Declaration
public int DotProdGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
DotProduct(NPPImage_32sC1, CudaDeviceVariable<Double>)
One-channel 32-bit signed image DotProd. Buffer is internally allocated and freed.
Declaration
public void DotProduct(NPPImage_32sC1 src2, CudaDeviceVariable<double> pDp)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pDp | Pointer to the computed dot product of the two images. (1 * sizeof(double)) |
DotProduct(NPPImage_32sC1, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
One-channel 32-bit signed image DotProd.
Declaration
public void DotProduct(NPPImage_32sC1 src2, CudaDeviceVariable<double> pDp, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pDp | Pointer to the computed dot product of the two images. (1 * sizeof(double)) |
CudaDeviceVariable<System.Byte> | buffer | Allocated device memory with size of at DotProdGetBufferHostSize() |
Dup(NPPImage_32sC3)
source image duplicated in all 3 channels of destination image.
Declaration
public void Dup(NPPImage_32sC3 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC3 | dst | Destination-Image |
Dup(NPPImage_32sC4)
source image duplicated in all 4 channels of destination image.
Declaration
public void Dup(NPPImage_32sC4 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | dst | Destination-Image |
DupA(NPPImage_32sC4)
source image duplicated in 3 channels of 4 channel destination image with alpha channel unaffected.
Declaration
public void DupA(NPPImage_32sC4 dst)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC4 | dst | Destination-Image |
Filter(NPPImage_32sC1, CudaDeviceVariable<Single>, NppiSize, NppiPoint)
convolution filter.
Declaration
public void Filter(NPPImage_32sC1 dst, CudaDeviceVariable<float> pKernel, NppiSize oKernelSize, NppiPoint oAnchor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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_32sC1, CudaDeviceVariable<Single>, NppiSize, NppiPoint, NppiBorderType)
One channel 32-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_32sC1 dest, CudaDeviceVariable<float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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()
GetAffineBound(Double[,])
Calculates bounding box of the affine transform projection of the given source rectangular ROI
Declaration
public double[, ] GetAffineBound(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [2,2] |
GetAffineQuad(Double[,])
Calculates affine transform projection of given source rectangular ROI
Declaration
public double[, ] GetAffineQuad(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [4,2] |
GetAffineTransform(Double[,])
Calculates affine transform coefficients given source rectangular ROI and its destination quadrangle projection
Declaration
public double[, ] GetAffineTransform(double[, ] quad)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | quad | Destination quadrangle [4,2] |
Returns
Type | Description |
---|---|
System.Double[,] | Affine transform coefficients [2,3] |
GetPerspectiveBound(Double[,])
Calculates bounding box of the affine transform projection of the given source rectangular ROI
Declaration
public double[, ] GetPerspectiveBound(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [2,2] |
GetPerspectiveQuad(Double[,])
Calculates perspective transform projection of given source rectangular ROI
Declaration
public double[, ] GetPerspectiveQuad(double[, ] coeffs)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
Returns
Type | Description |
---|---|
System.Double[,] | Destination quadrangle [4,2] |
GetPerspectiveTransform(Double[,])
Calculates affine transform coefficients given source rectangular ROI and its destination quadrangle projection
Declaration
public double[, ] GetPerspectiveTransform(double[, ] quad)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | quad | Destination quadrangle [4,2] |
Returns
Type | Description |
---|---|
System.Double[,] | Perspective transform coefficients [3,3] |
LShiftC(UInt32)
image bit shift by constant (left), inplace.
Declaration
public void LShiftC(uint nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | nConstant | Constant |
LShiftC(UInt32, NPPImage_32sC1)
image bit shift by constant (left).
Declaration
public void LShiftC(uint nConstant, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | nConstant | Constant |
NPPImage_32sC1 | dest | Destination image |
MaxError(NPPImage_32sC1, CudaDeviceVariable<Double>)
image maximum error. User buffer is internally allocated and freed.
Declaration
public void MaxError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaxError(NPPImage_32sC1, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum error.
Declaration
public void MaxError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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_32sC1, CudaDeviceVariable<Double>)
image maximum relative error. User buffer is internally allocated and freed.
Declaration
public void MaximumRelativeError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
CudaDeviceVariable<System.Double> | pError | Pointer to the computed error. |
MaximumRelativeError(NPPImage_32sC1, CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image maximum relative error.
Declaration
public void MaximumRelativeError(NPPImage_32sC1 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | 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 |
Mirror(NppiAxis)
Mirror image inplace.
Declaration
public void Mirror(NppiAxis flip)
Parameters
Type | Name | Description |
---|---|---|
NppiAxis | flip | Specifies the axis about which the image is to be mirrored. |
Mirror(NPPImage_32sC1, NppiAxis)
Mirror image.
Declaration
public void Mirror(NPPImage_32sC1 dest, NppiAxis flip)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
NppiAxis | flip | Specifies the axis about which the image is to be mirrored. |
Mul(NPPImage_32sC1, NPPImage_32sC1, Int32)
Image multiplication, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(NPPImage_32sC1 src2, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Mul(NPPImage_32sC1, Int32)
In place image multiplication, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(NPPImage_32sC1 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Mul(Int32, NPPImage_32sC1, Int32)
Multiply constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Mul(int nConstant, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Mul(Int32, Int32)
Multiply constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Mul(int nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
System.Int32 | nScaleFactor | scaling factor |
NormInf(CudaDeviceVariable<Double>)
image infinity norm with 64-bit double precision result. Buffer is internally allocated and freed.
Declaration
public void NormInf(CudaDeviceVariable<double> normInf)
Parameters
Type | Name | Description |
---|---|---|
CudaDeviceVariable<System.Double> | normInf | Allocated device memory with size of at least 1 * sizeof(double) |
NormInf(CudaDeviceVariable<Double>, CudaDeviceVariable<Byte>)
image infinity norm with 64-bit double precision result. No additional buffer is allocated.
Declaration
public void NormInf(CudaDeviceVariable<double> normInf, CudaDeviceVariable<byte> buffer)
Parameters
Type | Name | Description |
---|---|---|
CudaDeviceVariable<System.Double> | normInf | Allocated device memory with size of at least 1 * sizeof(double) |
CudaDeviceVariable<System.Byte> | buffer | Allocated device memory with size of at NormInfGetBufferHostSize() |
NormInfGetBufferHostSize()
Scratch-buffer size for NormInf.
Declaration
public int NormInfGetBufferHostSize()
Returns
Type | Description |
---|---|
System.Int32 |
Or(NPPImage_32sC1)
In place image logical Or.
Declaration
public void Or(NPPImage_32sC1 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
Or(NPPImage_32sC1, NPPImage_32sC1)
Image logical Or.
Declaration
public void Or(NPPImage_32sC1 src2, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
Or(Int32)
In place image logical Or with constant.
Declaration
public void Or(int nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
Or(Int32, NPPImage_32sC1)
Image logical Or with constant.
Declaration
public void Or(int nConstant, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
NPPImage_32sC1 | dest | Destination image |
RectStdDev(NPPImage_32sC1, NPPImage_32sC1, Int32)
RectStdDev, scaled by 2^(-nScaleFactor).
Declaration
public void RectStdDev(NPPImage_32sC1 dst, NPPImage_32sC1 sqr, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dst | Destination-Image |
NPPImage_32sC1 | sqr | Destination-Image |
System.Int32 | nScaleFactor | Integer Result Scaling. |
RShiftC(UInt32)
image bit shift by constant (right), inplace.
Declaration
public void RShiftC(uint nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | nConstant | Constant |
RShiftC(UInt32, NPPImage_32sC1)
image bit shift by constant (right).
Declaration
public void RShiftC(uint nConstant, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | nConstant | Constant |
NPPImage_32sC1 | dest | Destination image |
Scale(NPPImage_8uC1, NppHintAlgorithm)
image conversion.
Declaration
public void Scale(NPPImage_8uC1 dst, NppHintAlgorithm hint)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_8uC1 | dst | Destination-Image |
NppHintAlgorithm | hint | algorithm performance or accuracy selector, currently ignored |
Set(Int32)
Set pixel values to nValue.
Declaration
public void Set(int nValue)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nValue | Value to be set |
Set(Int32, NPPImage_8uC1)
Set pixel values to nValue.
The 8-bit mask image affects setting of the respective pixels in the destination image.
If the mask value is zero (0) the pixel is not set, if the mask is non-zero, the corresponding destination pixel is set to specified value.
Declaration
public void Set(int nValue, NPPImage_8uC1 mask)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nValue | Value to be set |
NPPImage_8uC1 | mask | Mask image |
Sub(NPPImage_32sC1, NPPImage_32sC1, Int32)
Image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(NPPImage_32sC1 src2, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Sub(NPPImage_32sC1, Int32)
In place image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(NPPImage_32sC1 src2, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
System.Int32 | nScaleFactor | scaling factor |
Sub(Int32, NPPImage_32sC1, Int32)
Subtract constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
Declaration
public void Sub(int nConstant, NPPImage_32sC1 dest, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value to subtract |
NPPImage_32sC1 | dest | Destination image |
System.Int32 | nScaleFactor | scaling factor |
Sub(Int32, Int32)
Subtract constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace.
Declaration
public void Sub(int nConstant, int nScaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value to subtract |
System.Int32 | nScaleFactor | scaling factor |
ToCudaPitchedDeviceVariable()
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public CudaPitchedDeviceVariable<int> ToCudaPitchedDeviceVariable()
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<System.Int32> |
Transpose(NPPImage_32sC1)
image transpose
Declaration
public void Transpose(NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
WarpAffine(NPPImage_32sC1, Double[,], InterpolationMode)
Affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. The function operates on source and destination regions of interest. The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but does not perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one.
In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffine(NPPImage_32sC1 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineBack(NPPImage_32sC1, Double[,], InterpolationMode)
Inverse affine transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetAffineTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpAffineBack. The function operates on source and destination regions of interest.
The affine warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = C_00 * x + C_01 * y + C_02
Y_new = C_10 * x + C_11 * y + C_12
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetAffineQuad and nppiGetAffineBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffineBack(NPPImage_32sC1 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | coeffs | Affine transform coefficients [2,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpAffineQuad(Double[,], NPPImage_32sC1, Double[,], InterpolationMode)
Affine transform of an image.
This function performs affine warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpAffineQuad uses the same formulas for pixel mapping as in nppiWarpAffine function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified eInterpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpAffineQuad(double[, ] srcQuad, NPPImage_32sC1 dest, double[, ] dstQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | dstQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspective(NPPImage_32sC1, Double[,], InterpolationMode)
Perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspective(NPPImage_32sC1 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveBack(NPPImage_32sC1, Double[,], InterpolationMode)
Inverse perspective transform of an image.
This function operates using given transform coefficients that can be obtained by using nppiGetPerspectiveTransform function or set explicitly. Thus there is no need to invert coefficients in your application before calling WarpPerspectiveBack. The function operates on source and destination regions of interest. The perspective warp function transforms the source image pixel coordinates (x,y) according to the following formulas:
X_new = (C_00 * x + C_01 * y + C_02) / (C_20 * x + C_21 * y + C_22)
Y_new = (C_10 * x + C_11 * y + C_12) / (C_20 * x + C_21 * y + C_22)
The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI. The functions nppiGetPerspectiveQuad and nppiGetPerspectiveBound can help with destination ROI specification.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspectiveBack(NPPImage_32sC1 dest, double[, ] coeffs, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | coeffs | Perspective transform coefficients [3,3] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
WarpPerspectiveQuad(Double[,], NPPImage_32sC1, Double[,], InterpolationMode)
Perspective transform of an image.
This function performs perspective warping of a the specified quadrangle in the source image to the specified quadrangle in the destination image. The function nppiWarpPerspectiveQuad uses the same formulas for pixel mapping as in nppiWarpPerspective function. The transform coefficients are computed internally. The transformed part of the source image is resampled using the specified interpolation method and written to the destination ROI.
NPPI specific recommendation:
The function operates using 2 types of kernels: fast and accurate. The fast method is about 4 times faster than its accurate variant, but doesn't perform memory access checks and requires the destination ROI to be 64 bytes aligned. Hence any destination ROI is chunked into 3 vertical stripes: the first and the third are processed by accurate kernels and the central one is processed by the fast one. In order to get the maximum available speed of execution, the projection of destination ROI onto image addresses must be 64 bytes aligned. This is always true if the values
(int)((void *)(pDst + dstRoi.x))
and
(int)((void *)(pDst + dstRoi.x + dstRoi.width))
are multiples of 64. Another rule of thumb is to specify destination ROI in such way that left and right sides of the projected image are separated from the ROI by at least 63 bytes from each side. However, this requires the whole ROI to be part of allocated memory. In case when the conditions above are not satisfied, the function may decrease in speed slightly and will return NPP_MISALIGNED_DST_ROI_WARNING warning.
Declaration
public void WarpPerspectiveQuad(double[, ] srcQuad, NPPImage_32sC1 dest, double[, ] destQuad, InterpolationMode eInterpolation)
Parameters
Type | Name | Description |
---|---|---|
System.Double[,] | srcQuad | Source quadrangle [4,2] |
NPPImage_32sC1 | dest | Destination image |
System.Double[,] | destQuad | Destination quadrangle [4,2] |
InterpolationMode | eInterpolation | Interpolation mode: can be NearestNeighbor, Linear or Cubic |
Xor(NPPImage_32sC1)
In place image logical Xor.
Declaration
public void Xor(NPPImage_32sC1 src2)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
Xor(NPPImage_32sC1, NPPImage_32sC1)
Image logical Xor.
Declaration
public void Xor(NPPImage_32sC1 src2, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | src2 | 2nd source image |
NPPImage_32sC1 | dest | Destination image |
Xor(Int32)
In place image logical Xor with constant.
Declaration
public void Xor(int nConstant)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
Xor(Int32, NPPImage_32sC1)
Image logical Xor with constant.
Declaration
public void Xor(int nConstant, NPPImage_32sC1 dest)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | nConstant | Value |
NPPImage_32sC1 | dest | Destination image |
Operators
| Improve this Doc View SourceImplicit(CudaPitchedDeviceVariable<Int32> to NPPImage_32sC1)
Converts a CudaPitchedDeviceVariable to a NPPImage
Declaration
public static implicit operator NPPImage_32sC1(CudaPitchedDeviceVariable<int> img)
Parameters
Type | Name | Description |
---|---|---|
CudaPitchedDeviceVariable<System.Int32> | img | CudaPitchedDeviceVariable |
Returns
Type | Description |
---|---|
NPPImage_32sC1 | NPPImage with the same device pointer and size of CudaPitchedDeviceVariable with ROI set to full image |
Implicit(NPPImage_32sC1 to CudaPitchedDeviceVariable<Int32>)
Converts a NPPImage to a CudaPitchedDeviceVariable
Declaration
public static implicit operator CudaPitchedDeviceVariable<int>(NPPImage_32sC1 img)
Parameters
Type | Name | Description |
---|---|---|
NPPImage_32sC1 | img | NPPImage |
Returns
Type | Description |
---|---|
CudaPitchedDeviceVariable<System.Int32> | CudaPitchedDeviceVariable with the same device pointer and size of NPPImage without ROI information |