/// <summary> /// image maximum error. User buffer is internally allocated and freed. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> /// <param name="nppStreamCtx">NPP stream context.</param> public void MaxError(NPPImage_32fcC2 src2, CudaDeviceVariable <double> pError, NppStreamContext nppStreamCtx) { int bufferSize = MaxErrorGetBufferHostSize(nppStreamCtx); CudaDeviceVariable <byte> buffer = new CudaDeviceVariable <byte>(bufferSize); status = NPPNativeMethods_Ctx.NPPi.MaximumError.nppiMaximumError_32fc_C2R_Ctx(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer, nppStreamCtx); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumError_32fc_C2R_Ctx", status)); buffer.Dispose(); NPPException.CheckNppStatus(status, this); }
/// <summary> /// image average relative error. User buffer is internally allocated and freed. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> public void AverageRelativeError(NPPImage_32fcC2 src2, CudaDeviceVariable <double> pError) { int bufferSize = AverageRelativeErrorGetBufferHostSize(); CudaDeviceVariable <byte> buffer = new CudaDeviceVariable <byte>(bufferSize); status = NPPNativeMethods.NPPi.AverageRelativeError.nppiAverageRelativeError_32fc_C2R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_32fc_C2R", status)); buffer.Dispose(); NPPException.CheckNppStatus(status, this); }
/// <summary> /// image average relative error. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> /// <param name="buffer">Pointer to the user-allocated scratch buffer required for the AverageRelativeError operation.</param> /// <param name="nppStreamCtx">NPP stream context.</param> public void AverageRelativeError(NPPImage_32fcC2 src2, CudaDeviceVariable <double> pError, CudaDeviceVariable <byte> buffer, NppStreamContext nppStreamCtx) { int bufferSize = AverageRelativeErrorGetBufferHostSize(nppStreamCtx); if (bufferSize > buffer.Size) { throw new NPPException("Provided buffer is too small."); } status = NPPNativeMethods_Ctx.NPPi.AverageRelativeError.nppiAverageRelativeError_32fc_C2R_Ctx(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer, nppStreamCtx); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_32fc_C2R_Ctx", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// image maximum error. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> /// <param name="buffer">Pointer to the user-allocated scratch buffer required for the MaxError operation.</param> public void MaxError(NPPImage_32fcC2 src2, CudaDeviceVariable <double> pError, CudaDeviceVariable <byte> buffer) { int bufferSize = MaxErrorGetBufferHostSize(); if (bufferSize > buffer.Size) { throw new NPPException("Provided buffer is too small."); } status = NPPNativeMethods.NPPi.MaximumError.nppiMaximumError_32fc_C2R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMedian_32fc_C2R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// image average relative error. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> /// <param name="buffer">Pointer to the user-allocated scratch buffer required for the AverageRelativeError operation.</param> public void AverageRelativeError(NPPImage_32fcC2 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer) { int bufferSize = AverageRelativeErrorGetBufferHostSize(); if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small."); status = NPPNativeMethods.NPPi.AverageRelativeError.nppiAverageRelativeError_32fc_C2R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_32fc_C2R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// image maximum relative error. User buffer is internally allocated and freed. /// </summary> /// <param name="src2">2nd source image</param> /// <param name="pError">Pointer to the computed error.</param> public void MaximumRelativeError(NPPImage_32fcC2 src2, CudaDeviceVariable<double> pError) { int bufferSize = MaximumRelativeErrorGetBufferHostSize(); CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize); status = NPPNativeMethods.NPPi.MaximumRelativeError.nppiMaximumRelativeError_32fc_C2R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_32fc_C2R", status)); buffer.Dispose(); NPPException.CheckNppStatus(status, this); }
/// <summary> /// Image copy. /// </summary> /// <param name="dst">Destination image</param> public void Copy(NPPImage_32fcC2 dst) { status = NPPNativeMethods.NPPi.MemCopy.nppiCopy_32fc_C2R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_32fc_C2R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// Image copy. /// </summary> /// <param name="dst">Destination image</param> /// <param name="nppStreamCtx">NPP stream context.</param> public void Copy(NPPImage_32fcC2 dst, NppStreamContext nppStreamCtx) { status = NPPNativeMethods_Ctx.NPPi.MemCopy.nppiCopy_32fc_C2R_Ctx(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, nppStreamCtx); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_32fc_C2R_Ctx", status)); NPPException.CheckNppStatus(status, this); }