Class NPPImageBase
Abstract base class for derived NPP typed images.
Inheritance
Implements
Inherited Members
Namespace: ManagedCuda.NPP
Assembly: NPP.dll
Syntax
public abstract class NPPImageBase : IDisposable
Fields
| Improve this Doc View Source_channels
Number of color channels in image.
Declaration
protected int _channels
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_devPtr
Base pointer to image data.
Declaration
protected CUdeviceptr _devPtr
Field Value
| Type | Description |
|---|---|
| CUdeviceptr |
_devPtrRoi
Base pointer moved to actual ROI.
Declaration
protected CUdeviceptr _devPtrRoi
Field Value
| Type | Description |
|---|---|
| CUdeviceptr |
_isOwner
Declaration
protected bool _isOwner
Field Value
| Type | Description |
|---|---|
| System.Boolean |
_pitch
Width of one image line + alignment bytes.
Declaration
protected int _pitch
Field Value
| Type | Description |
|---|---|
| System.Int32 |
_pointRoi
First pixel in the ROI.
Declaration
protected NppiPoint _pointRoi
Field Value
| Type | Description |
|---|---|
| NppiPoint |
_sizeOriginal
Size of the entire image.
Declaration
protected NppiSize _sizeOriginal
Field Value
| Type | Description |
|---|---|
| NppiSize |
_sizeRoi
Size of the actual ROI.
Declaration
protected NppiSize _sizeRoi
Field Value
| Type | Description |
|---|---|
| NppiSize |
_typeSize
Type size in bytes of one pixel in one channel.
Declaration
protected int _typeSize
Field Value
| Type | Description |
|---|---|
| System.Int32 |
disposed
Declaration
protected bool disposed
Field Value
| Type | Description |
|---|---|
| System.Boolean |
res
Last CUResult.
Declaration
protected CUResult res
Field Value
| Type | Description |
|---|---|
| CUResult |
status
Last NPPStatus result.
Declaration
protected NppStatus status
Field Value
| Type | Description |
|---|---|
| NppStatus |
Properties
| Improve this Doc View SourceChannels
Color channels
Declaration
public int Channels { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
DevicePointer
Device pointer to image data.
Declaration
public CUdeviceptr DevicePointer { get; }
Property Value
| Type | Description |
|---|---|
| CUdeviceptr |
DevicePointerRoi
Device pointer to first pixel in ROI.
Declaration
public CUdeviceptr DevicePointerRoi { get; }
Property Value
| Type | Description |
|---|---|
| CUdeviceptr |
Height
Height in pixels
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
HeightRoi
Height in pixels
Declaration
public int HeightRoi { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Pitch
Pitch in bytes
Declaration
public int Pitch { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
PointRoi
First pixel in the ROI.
Declaration
public NppiPoint PointRoi { get; }
Property Value
| Type | Description |
|---|---|
| NppiPoint |
Size
Size of the entire image.
Declaration
public NppiSize Size { get; }
Property Value
| Type | Description |
|---|---|
| NppiSize |
SizeRoi
Size of the actual ROI.
Declaration
public NppiSize SizeRoi { get; }
Property Value
| Type | Description |
|---|---|
| NppiSize |
TotalSizeInBytes
Total size in bytes (Pitch * Height)
Declaration
public int TotalSizeInBytes { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Width
Width in pixels
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
WidthInBytes
Width in bytes
Declaration
public int WidthInBytes { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
WidthRoi
Width in pixels
Declaration
public int WidthRoi { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
WidthRoiInBytes
Width in bytes
Declaration
public int WidthRoiInBytes { get; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
| Improve this Doc View SourceAsyncCopyToDevice(CUdeviceptr, CUstream)
Async Copy data from device to device memory
Declaration
public void AsyncCopyToDevice(CUdeviceptr source, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | source | Source pointer to device memory |
| CUstream | stream |
AsyncCopyToDevice(NPPImageBase, CUstream)
Async Copy from device to device memory
Declaration
public void AsyncCopyToDevice(NPPImageBase deviceSrc, CUstream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| NPPImageBase | deviceSrc | Source |
| CUstream | stream |
AsyncCopyToDevice<T>(CudaDeviceVariable<T>, CUstream)
Async Copy data from device to device memory
Declaration
public void AsyncCopyToDevice<T>(CudaDeviceVariable<T> source, CUstream stream)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<T> | source | Source |
| CUstream | stream |
Type Parameters
| Name | Description |
|---|---|
| T |
AsyncCopyToDevice<T>(CudaPitchedDeviceVariable<T>, CUstream)
Async Copy from device to device memory
Declaration
public void AsyncCopyToDevice<T>(CudaPitchedDeviceVariable<T> deviceSrc, CUstream stream)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaPitchedDeviceVariable<T> | deviceSrc | Source |
| CUstream | stream |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToDevice(CUdeviceptr)
Copy from device to device memory
Declaration
public void CopyToDevice(CUdeviceptr deviceSrc)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | deviceSrc | Source |
CopyToDevice(CUdeviceptr, SizeT)
Copy from device to device memory
Declaration
public void CopyToDevice(CUdeviceptr deviceSrc, SizeT pitch)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | deviceSrc | Source |
| SizeT | pitch | Pitch of deviceSrc |
CopyToDevice(NPPImageBase)
Copy from device to device memory
Declaration
public void CopyToDevice(NPPImageBase deviceSrc)
Parameters
| Type | Name | Description |
|---|---|---|
| NPPImageBase | deviceSrc | Source |
CopyToDevice(Array)
Copy from Host to device memory
Declaration
public void CopyToDevice(Array hostSrc)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostSrc | Source |
CopyToDevice(Array, SizeT)
Copy from Host to device memory
Declaration
public void CopyToDevice(Array hostSrc, SizeT stride)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostSrc | Source |
| SizeT | stride | Size of one image line in bytes with padding |
CopyToDevice(Bitmap)
Copy data from a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
Declaration
public void CopyToDevice(Bitmap bitmap)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Bitmap | bitmap |
CopyToDevice(IntPtr)
Copy from Host to device memory
Declaration
public void CopyToDevice(IntPtr hostSrc)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostSrc | Source |
CopyToDevice(IntPtr, SizeT)
Copy from Host to device memory
Declaration
public void CopyToDevice(IntPtr hostSrc, SizeT stride)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostSrc | Source |
| SizeT | stride | Size of one image line in bytes with padding |
CopyToDevice<T>(CudaDeviceVariable<T>)
Copy from device to device memory
Declaration
public void CopyToDevice<T>(CudaDeviceVariable<T> deviceSrc)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<T> | deviceSrc | Source |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToDevice<T>(CudaPitchedDeviceVariable<T>)
Copy from device to device memory
Declaration
public void CopyToDevice<T>(CudaPitchedDeviceVariable<T> deviceSrc)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaPitchedDeviceVariable<T> | deviceSrc | Source |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToDeviceRoi(CUdeviceptr, SizeT, NppiRect)
Copy from device to device memory
Declaration
public void CopyToDeviceRoi(CUdeviceptr deviceSrc, SizeT pitch, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | deviceSrc | Source |
| SizeT | pitch | Pitch of deviceSrc |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(CUdeviceptr, NppiRect)
Copy from device to device memory
Declaration
public void CopyToDeviceRoi(CUdeviceptr deviceSrc, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| CUdeviceptr | deviceSrc | Source |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(NPPImageBase)
Copy from device to device memory
Declaration
public void CopyToDeviceRoi(NPPImageBase deviceSrc)
Parameters
| Type | Name | Description |
|---|---|---|
| NPPImageBase | deviceSrc | Source |
CopyToDeviceRoi(Array, SizeT, NppiRect)
Copy from Host to device memory
Declaration
public void CopyToDeviceRoi(Array hostSrc, SizeT stride, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostSrc | Source |
| SizeT | stride | Size of one image line in bytes with padding |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(Array, NppiRect)
Copy from Host to device memory
Declaration
public void CopyToDeviceRoi(Array hostSrc, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostSrc | Source |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(Bitmap, NppiRect)
Copy data from a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
Declaration
public void CopyToDeviceRoi(Bitmap bitmap, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Bitmap | bitmap | Source Bitmap |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(IntPtr, SizeT, NppiRect)
Copy from Host to device memory
Declaration
public void CopyToDeviceRoi(IntPtr hostSrc, SizeT stride, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostSrc | Source |
| SizeT | stride | Size of one image line in bytes with padding |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi(IntPtr, NppiRect)
Copy from Host to device memory
Declaration
public void CopyToDeviceRoi(IntPtr hostSrc, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostSrc | Source |
| NppiRect | roi | ROI of source image |
CopyToDeviceRoi<T>(CudaDeviceVariable<T>, NppiRect)
Copy from device to device memory
Declaration
public void CopyToDeviceRoi<T>(CudaDeviceVariable<T> deviceSrc, NppiRect roi)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaDeviceVariable<T> | deviceSrc | Source |
| NppiRect | roi | ROI of source image |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToDeviceRoi<T>(CudaPitchedDeviceVariable<T>, NppiRect)
Copy from device to device memory
Declaration
public void CopyToDeviceRoi<T>(CudaPitchedDeviceVariable<T> deviceSrc, NppiRect roi)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| CudaPitchedDeviceVariable<T> | deviceSrc | Source |
| NppiRect | roi | ROI of source image |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToHost(Array, SizeT)
Copy data from this device to host memory
Declaration
public void CopyToHost(Array hostDest, SizeT stride)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostDest | Destination |
| SizeT | stride | Size of one image line in bytes with padding |
CopyToHost(Bitmap)
Copy data to a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
Declaration
public void CopyToHost(Bitmap bitmap)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Bitmap | bitmap |
CopyToHost(IntPtr)
Copy data from device to host memory
Declaration
public void CopyToHost(IntPtr hostDest)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostDest | IntPtr to destination in host memory |
CopyToHost(IntPtr, SizeT)
Copy data from device to host memory
Declaration
public void CopyToHost(IntPtr hostDest, SizeT stride)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostDest | IntPtr to destination in host memory |
| SizeT | stride | Size of one image line in bytes with padding |
CopyToHost<T>(T[])
Copy data from device to host memory
Declaration
public void CopyToHost<T>(T[] aHostDest)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | aHostDest | Destination |
Type Parameters
| Name | Description |
|---|---|
| T |
CopyToHostRoi(Array, SizeT, NppiRect)
Copy data from this device to host memory
Declaration
public void CopyToHostRoi(Array hostDest, SizeT stride, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Array | hostDest | Destination |
| SizeT | stride | Size of one image line in bytes with padding |
| NppiRect | roi | ROI of destination image |
CopyToHostRoi(Bitmap, NppiRect)
Copy data to a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
Declaration
public void CopyToHostRoi(Bitmap bitmap, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Drawing.Bitmap | bitmap | Destination Bitmap |
| NppiRect | roi | ROI of destination image |
CopyToHostRoi(IntPtr, SizeT, NppiRect)
Copy data from device to host memory
Declaration
public void CopyToHostRoi(IntPtr hostDest, SizeT stride, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostDest | IntPtr to destination in host memory |
| SizeT | stride | Size of one image line in bytes with padding |
| NppiRect | roi | ROI of destination image |
CopyToHostRoi(IntPtr, NppiRect)
Copy data from device to host memory
Declaration
public void CopyToHostRoi(IntPtr hostDest, NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IntPtr | hostDest | IntPtr to destination in host memory |
| NppiRect | roi | ROI of destination image |
CopyToHostRoi<T>(T[], NppiRect)
Copy data from device to host memory
Declaration
public void CopyToHostRoi<T>(T[] aHostDest, NppiRect roi)
where T : struct
Parameters
| Type | Name | Description |
|---|---|---|
| T[] | aHostDest | Destination |
| NppiRect | roi | ROI of destination image |
Type Parameters
| Name | Description |
|---|---|
| T |
Dispose()
Dispose
Declaration
public virtual void Dispose()
Dispose(Boolean)
For IDisposable
Declaration
protected virtual void Dispose(bool fDisposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | fDisposing |
GetResizeRect(Double, Double, Double, Double, InterpolationMode)
Returns NppiRect which represents the offset and size of the destination rectangle that would be generated by resizing the source NppiRect by the requested scale factors and shifts.
Declaration
public NppiRect GetResizeRect(double nXFactor, double nYFactor, double nXShift, double nYShift, InterpolationMode eInterpolation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Double | nXFactor | Factor by which x dimension is changed. |
| System.Double | nYFactor | Factor by which y dimension is changed. |
| System.Double | nXShift | Source pixel shift in x-direction. |
| System.Double | nYShift | Source pixel shift in y-direction. |
| InterpolationMode | eInterpolation | The type of eInterpolation to perform resampling. |
Returns
| Type | Description |
|---|---|
| NppiRect |
ResetRoi()
Resets the ROI to the full image
Declaration
public void ResetRoi()
SetRoi(NppiRect)
Defines the ROI on which all following operations take place
Declaration
public void SetRoi(NppiRect roi)
Parameters
| Type | Name | Description |
|---|---|---|
| NppiRect | roi |
SetRoi(Int32, Int32, Int32, Int32)
Defines the ROI on which all following operations take place
Declaration
public void SetRoi(int x, int y, int width, int height)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | x | |
| System.Int32 | y | |
| System.Int32 | width | |
| System.Int32 | height |