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

Lut() public method

look-up-table color conversion. The LUT is derived from a set of user defined mapping points through linear interpolation.
public Lut ( NPPImage_8uC3 dest, CudaDeviceVariable values0, CudaDeviceVariable levels0, CudaDeviceVariable values1, CudaDeviceVariable levels1, CudaDeviceVariable values2, CudaDeviceVariable levels2 ) : void
dest NPPImage_8uC3 Destination image
values0 CudaDeviceVariable array of user defined OUTPUT values, channel 0
levels0 CudaDeviceVariable array of user defined INPUT values, channel 0
values1 CudaDeviceVariable array of user defined OUTPUT values, channel 1
levels1 CudaDeviceVariable array of user defined INPUT values, channel 1
values2 CudaDeviceVariable array of user defined OUTPUT values, channel 2
levels2 CudaDeviceVariable array of user defined INPUT values, channel 2
return void
        public void Lut(NPPImage_8uC3 dest, CudaDeviceVariable<int> values0, CudaDeviceVariable<int> levels0, CudaDeviceVariable<int> values1, CudaDeviceVariable<int> levels1, CudaDeviceVariable<int> values2, CudaDeviceVariable<int> levels2)
        {
            if (values0.Size != levels0.Size) throw new ArgumentException("values0 and levels0 must have same size.");
            if (values1.Size != levels1.Size) throw new ArgumentException("values1 and levels1 must have same size.");
            if (values2.Size != levels2.Size) throw new ArgumentException("values2 and levels2 must have same size.");

            CUdeviceptr[] values = new CUdeviceptr[3];
            CUdeviceptr[] levels = new CUdeviceptr[3];
            int[] levelLengths = new int[3];

            values[0] = values0.DevicePointer;
            values[1] = values1.DevicePointer;
            values[2] = values2.DevicePointer;
            levels[0] = levels0.DevicePointer;
            levels[1] = levels1.DevicePointer;
            levels[2] = levels2.DevicePointer;

            levelLengths[0] = (int)levels0.Size;
            levelLengths[1] = (int)levels1.Size;
            levelLengths[2] = (int)levels2.Size;

            status = NPPNativeMethods.NPPi.ColorProcessing.nppiLUT_Linear_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, values, levels, levelLengths);

            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUT_Linear_8u_C3R", status));
            NPPException.CheckNppStatus(status, this);
        }
NPPImage_8uC3