Library/ManagedCuda/NPP/NPPImage_8uC3.cs
/// <summary>
/// Histogram with bins determined by pLevels array. Buffer is internally allocated and freed.
/// </summary>
/// <param name="histogram">array that receives the computed histogram. The CudaDeviceVariable must be of size nLevels-1. Array size = 3</param>
/// <param name="pLevels">Array in device memory containing the level sizes of the bins. The CudaDeviceVariable must be of size nLevels. Array size = 3</param>
Histogram with bins determined by pLevels array. Buffer is internally allocated and freed.
Histogram with bins determined by pLevels array . Buffer is internally allocated and freed .
public void HistogramRange(CudaDeviceVariable<int>[] histogram, CudaDeviceVariable<int>[] pLevels)
		{
			int[] size = new int[] { (int)histogram[0].Size, (int)histogram[1].Size, (int)histogram[2].Size };
			CUdeviceptr[] devPtrs = new CUdeviceptr[] { histogram[0].DevicePointer, histogram[1].DevicePointer, histogram[2].DevicePointer };
			CUdeviceptr[] devLevels = new CUdeviceptr[] { pLevels[0].DevicePointer, pLevels[1].DevicePointer, pLevels[2].DevicePointer };
			int bufferSize = HistogramRangeGetBufferSize(size);
			CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
			status = NPPNativeMethods.NPPi.Histogram.nppiHistogramRange_8u_C3R(_devPtrRoi, _pitch, _sizeRoi, devPtrs, devLevels, size, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiHistogramRange_8u_C3R", status));
			buffer.Dispose();
			NPPException.CheckNppStatus(status, this);
		}
public void HistogramRange ( CudaDeviceVariable < int > [ ] histogram , CudaDeviceVariable < int > [ ] pLevels ) { int [ ] size = new int [ ] { ( int ) histogram [ 0 ] . Size , ( int ) histogram [ 1 ] . Size , ( int ) histogram [ 2 ] . Size } ; CUdeviceptr [ ] devPtrs = new CUdeviceptr [ ] { histogram [ 0 ] . DevicePointer , histogram [ 1 ] . DevicePointer , histogram [ 2 ] . DevicePointer } ; CUdeviceptr [ ] devLevels = new CUdeviceptr [ ] { pLevels [ 0 ] . DevicePointer , pLevels [ 1 ] . DevicePointer , pLevels [ 2 ] . DevicePointer } ; int bufferSize = HistogramRangeGetBufferSize ( size ) ; CudaDeviceVariable < byte > buffer = new CudaDeviceVariable < byte > ( bufferSize ) ; status = NPPNativeMethods . NPPi . Histogram . nppiHistogramRange_8u_C3R ( _devPtrRoi , _pitch , _sizeRoi , devPtrs , devLevels , size , buffer . DevicePointer ) ; Debug . WriteLine ( String . Format ( " " , DateTime . Now , " " , status ) ) ; buffer . Dispose ( ) ; NPPException . CheckNppStatus ( status , this ) ; }
Histogram with bins determined by pLevels array.
Histogram with bins determined by pLevels array .
histogram
CudaDeviceVariable<int>[]
array that receives the computed histogram. The CudaDeviceVariable must be of size nLevels-1. Array size = 3
array that receives the computed histogram . The CudaDeviceVariable must be of size nLevels - 1 . Array size = 3
pLevels
CudaDeviceVariable<int>[]
Array in device memory containing the level sizes of the bins. The CudaDeviceVariable must be of size nLevels. Array size = 3
Array in device memory containing the level sizes of the bins . The CudaDeviceVariable must be of size nLevels . Array size = 3