/// <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_32fcC1 src2, CudaDeviceVariable<double> pError)
		{
			int bufferSize = MaximumRelativeErrorGetBufferHostSize();
			CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
			status = NPPNativeMethods.NPPi.MaximumRelativeError.nppiMaximumRelativeError_32fc_C1R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_32fc_C1R", 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>
		public void AverageRelativeError(NPPImage_32fcC1 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_C1R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_32fc_C1R", status));
			NPPException.CheckNppStatus(status, this);
		}
		/// <summary>
		/// In place image division.
		/// </summary>
		/// <param name="src2">2nd source image</param>
		public void Div(NPPImage_32fcC1 src2)
		{
			status = NPPNativeMethods.NPPi.Div.nppiDiv_32fc_C1IR(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDiv_32fc_C1IR", status));
			NPPException.CheckNppStatus(status, this);
		}
		/// <summary>
		/// Divide constant to image.
		/// </summary>
		/// <param name="nConstant">Value</param>
		/// <param name="dest">Destination image</param>
		public void Div(Npp32fc nConstant, NPPImage_32fcC1 dest)
		{
			status = NPPNativeMethods.NPPi.DivConst.nppiDivC_32fc_C1R(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDivC_32fc_C1R", status));
			NPPException.CheckNppStatus(status, this);
		}
		/// <summary>
		/// Image multiplication.
		/// </summary>
		/// <param name="src2">2nd source image</param>
		/// <param name="dest">Destination image</param>
		public void Mul(NPPImage_32fcC1 src2, NPPImage_32fcC1 dest)
		{
			status = NPPNativeMethods.NPPi.Mul.nppiMul_32fc_C1R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMul_32fc_C1R", status));
			NPPException.CheckNppStatus(status, this);
		}
Exemple #6
0
 /// <summary>
 /// Image subtraction.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 /// <param name="dest">Destination image</param>
 public void Sub(NPPImage_32fcC1 src2, NPPImage_32fcC1 dest)
 {
     status = NPPNativeMethods.NPPi.Sub.nppiSub_32fc_C1R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSub_32fc_C1R", status));
     NPPException.CheckNppStatus(status, this);
 }
Exemple #7
0
 /// <summary>
 /// Add constant to image.
 /// </summary>
 /// <param name="nConstant">Value to add</param>
 /// <param name="dest">Destination image</param>
 public void Add(Npp32fc nConstant, NPPImage_32fcC1 dest)
 {
     status = NPPNativeMethods.NPPi.AddConst.nppiAddC_32fc_C1R(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAddC_32fc_C1R", status));
     NPPException.CheckNppStatus(status, this);
 }
Exemple #8
0
 /// <summary>
 /// In place image addition.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 public void Add(NPPImage_32fcC1 src2)
 {
     status = NPPNativeMethods.NPPi.Add.nppiAdd_32fc_C1IR(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAdd_32fc_C1IR", status));
     NPPException.CheckNppStatus(status, this);
 }
Exemple #9
0
 /// <summary>
 /// Image addition.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 /// <param name="dest">Destination image</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void Add(NPPImage_32fcC1 src2, NPPImage_32fcC1 dest, NppStreamContext nppStreamCtx)
 {
     status = NPPNativeMethods_Ctx.NPPi.Add.nppiAdd_32fc_C1R_Ctx(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAdd_32fc_C1R_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }