ManagedCuda.NPP.NPPImage_8uC3.HistogramRange C# (CSharp) Method

HistogramRange() public method

Histogram with bins determined by pLevels array. Buffer is internally allocated and freed.
public HistogramRange ( CudaDeviceVariable histogram, CudaDeviceVariable pLevels ) : void
histogram CudaDeviceVariable array that receives the computed histogram. The CudaDeviceVariable must be of size nLevels-1. Array size = 3
pLevels CudaDeviceVariable Array in device memory containing the level sizes of the bins. The CudaDeviceVariable must be of size nLevels. Array size = 3
return void
        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);
        }

Same methods

NPPImage_8uC3::HistogramRange ( CudaDeviceVariable histogram, CudaDeviceVariable pLevels, CudaDeviceVariable buffer ) : void
NPPImage_8uC3