/// <summary> /// Multiply 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 Mul(Npp16sc nConstant, NPPImage_16scC1 dest, int nScaleFactor) { status = NPPNativeMethods.NPPi.MulConst.nppiMulC_16sc_C1RSfs(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nScaleFactor); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMulC_16sc_C1RSfs", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// Divide constant to image, scale by 2^(-nScaleFactor), then clamp to saturated value. Inplace. /// </summary> /// <param name="nConstant">Value</param> /// <param name="nScaleFactor">scaling factor</param> public void Div(Npp16sc nConstant, int nScaleFactor) { status = NPPNativeMethods.NPPi.DivConst.nppiDivC_16sc_C1IRSfs(nConstant, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDivC_16sc_C1IRSfs", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// Set pixel values to nValue. /// </summary> /// <param name="nValue">Value to be set</param> public void Set(Npp16sc nValue) { status = NPPNativeMethods.NPPi.MemSet.nppiSet_16sc_C1R(nValue, _devPtrRoi, _pitch, _sizeRoi); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSet_16sc_C1R", status)); NPPException.CheckNppStatus(status, this); }
/// <summary> /// 16-bit integer complex number (16 bit real, 16 bit imaginary) signal subtract constant, /// scale, then clamp to saturated value. /// </summary> /// <param name="pSrc">Source signal pointer.</param> /// <param name="nValue">Constant value to be subtracted from each vector element</param> /// <param name="pDst">Destination signal pointer.</param> /// <param name="nScaleFactor">Integer Result Scaling.</param> public static void SubC(this CudaDeviceVariable<Npp16sc> pSrc, CudaDeviceVariable<Npp16sc> pDst, Npp16sc nValue, int nScaleFactor) { NppStatus status = NPPNativeMethods.NPPs.SubC.nppsSubC_16sc_Sfs(pSrc.DevicePointer, nValue, pDst.DevicePointer, pSrc.Size, nScaleFactor); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppsSubC_16sc_Sfs", status)); NPPException.CheckNppStatus(status, pSrc); }
/// <summary> /// 16-bit in place signed short complex number signal NPP_CMP_GREATER threshold with constant level. /// </summary> /// <param name="pSrcDst">In-Place Signal Pointer.</param> /// <param name="nLevel">Constant threshold value (real part only and must be greater than 0) to be used to limit each signal sample</param> /// <param name="nValue">Constant value to replace source value when threshold test is true.</param> public static void Threshold_GTVal(this CudaDeviceVariable<Npp16sc> pSrcDst, short nLevel, Npp16sc nValue) { NppStatus status = NPPNativeMethods.NPPs.Threshold.nppsThreshold_GTVal_16sc_I(pSrcDst.DevicePointer, pSrcDst.Size, nLevel, nValue); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppsThreshold_GTVal_16sc_I", status)); NPPException.CheckNppStatus(status, pSrcDst); }
/// <summary> /// 16-bit integer complex, vector set method. /// </summary> /// <param name="nValue">Value used to initialize the vector pDst.</param> /// <param name="pDst">Destination signal pointer.</param> public static void Set(this CudaDeviceVariable<Npp16sc> pDst, Npp16sc nValue) { NppStatus status = NPPNativeMethods.NPPs.Set.nppsSet_16sc(nValue, pDst.DevicePointer, pDst.Size); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppsSet_16sc", status)); NPPException.CheckNppStatus(status, pDst); }
/// <summary> /// 16-bit complex signed short signal normalize, scale, then clamp to saturated value. /// </summary> /// <param name="pSrc">Source signal pointer.</param> /// <param name="pDst">Destination signal pointer.</param> /// <param name="vSub">value subtracted from each signal element before division</param> /// <param name="vDiv">divisor of post-subtracted signal element dividend</param> /// <param name="nScaleFactor">Integer Result Scaling.</param> public static void Normalize(this CudaDeviceVariable<Npp16sc> pSrc, CudaDeviceVariable<Npp16sc> pDst, Npp16sc vSub, int vDiv, int nScaleFactor) { NppStatus status = NPPNativeMethods.NPPs.NormalizeSignal.nppsNormalize_16sc_Sfs(pSrc.DevicePointer, pDst.DevicePointer, pSrc.Size, vSub, vDiv, nScaleFactor); Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppsNormalize_16sc_Sfs", status)); NPPException.CheckNppStatus(status, pSrc); }