/// <summary>
 /// In place image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void Sub(NPPImage_16scC3 src2, int nScaleFactor, NppStreamContext nppStreamCtx)
 {
     status = NPPNativeMethods_Ctx.NPPi.Sub.nppiSub_16sc_C3IRSfs_Ctx(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSub_16sc_C3IRSfs_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }
Example #2
0
 /// <summary>
 /// Image copy.
 /// </summary>
 /// <param name="dst">Destination image</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void Copy(NPPImage_16scC3 dst, NppStreamContext nppStreamCtx)
 {
     status = NPPNativeMethods_Ctx.NPPi.MemCopy.nppiCopy_16sc_C3R_Ctx(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_16sc_C3R_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }
 /// <summary>
 /// Add constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="nConstant">Value to add</param>
 /// <param name="dest">Destination image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 /// <param name="nppStreamCtx">NPP stream context.</param>
 public void Add(Npp16sc[] nConstant, NPPImage_16scC3 dest, int nScaleFactor, NppStreamContext nppStreamCtx)
 {
     status = NPPNativeMethods_Ctx.NPPi.AddConst.nppiAddC_16sc_C3RSfs_Ctx(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nScaleFactor, nppStreamCtx);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAddC_16sc_C3RSfs_Ctx", status));
     NPPException.CheckNppStatus(status, this);
 }
Example #4
0
		/// <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_16scC3 src2, CudaDeviceVariable<double> pError)
		{
			int bufferSize = MaximumRelativeErrorGetBufferHostSize();
			CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
			status = NPPNativeMethods.NPPi.MaximumRelativeError.nppiMaximumRelativeError_16sc_C3R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_16sc_C3R", status));
			buffer.Dispose();
			NPPException.CheckNppStatus(status, this);
		}
Example #5
0
		/// <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_16scC3 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_16sc_C3R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_16sc_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
Example #6
0
		/// <summary>
		/// Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
		/// </summary>
		/// <param name="nConstant">Value</param>
		/// <param name="dest">Destination image</param>
		/// <param name="nScaleFactor">scaling factor</param>
		public void Div(Npp16sc[] nConstant, NPPImage_16scC3 dest, int nScaleFactor)
		{
			status = NPPNativeMethods.NPPi.DivConst.nppiDivC_16sc_C3RSfs(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nScaleFactor);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDivC_16sc_C3RSfs", status));
			NPPException.CheckNppStatus(status, this);
		}
Example #7
0
		/// <summary>
		/// In place image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
		/// </summary>
		/// <param name="src2">2nd source image</param>
		/// <param name="nScaleFactor">scaling factor</param>
		public void Div(NPPImage_16scC3 src2, int nScaleFactor)
		{
			status = NPPNativeMethods.NPPi.Div.nppiDiv_16sc_C3IRSfs(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDiv_16sc_C3IRSfs", status));
			NPPException.CheckNppStatus(status, this);
		}
Example #8
0
		/// <summary>
		/// Image copy.
		/// </summary>
		/// <param name="dst">Destination image</param>
		public void Copy(NPPImage_16scC3 dst)
		{
			status = NPPNativeMethods.NPPi.MemCopy.nppiCopy_16sc_C3R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_16sc_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
 /// <summary>
 /// Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="nConstant">Value</param>
 /// <param name="dest">Destination image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 public void Div(Npp16sc[] nConstant, NPPImage_16scC3 dest, int nScaleFactor)
 {
     status = NPPNativeMethods.NPPi.DivConst.nppiDivC_16sc_C3RSfs(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nScaleFactor);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDivC_16sc_C3RSfs", status));
     NPPException.CheckNppStatus(status, this);
 }
 /// <summary>
 /// In place image division, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 public void Div(NPPImage_16scC3 src2, int nScaleFactor)
 {
     status = NPPNativeMethods.NPPi.Div.nppiDiv_16sc_C3IRSfs(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDiv_16sc_C3IRSfs", status));
     NPPException.CheckNppStatus(status, this);
 }