本文整理汇总了C#中ManagedCuda.NPP.NPPImage_32fC4类的典型用法代码示例。如果您正苦于以下问题:C# NPPImage_32fC4类的具体用法?C# NPPImage_32fC4怎么用?C# NPPImage_32fC4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NPPImage_32fC4类属于ManagedCuda.NPP命名空间,在下文中一共展示了NPPImage_32fC4类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QualityIndexA
/// <summary>
/// image QualityIndex. Not affecting Alpha.
/// </summary>
/// <param name="src2">2nd source image</param>
/// <param name="dst">Pointer to the quality index. (3 * sizeof(float))</param>
public void QualityIndexA(NPPImage_32fC4 src2, CudaDeviceVariable<float> dst)
{
int bufferSize = QualityIndexAGetBufferHostSize();
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.QualityIndex.nppiQualityIndex_32f_AC4R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, dst.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiQualityIndex_32f_AC4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}
示例2: CrossCorrSame_NormLevelA
/// <summary>
/// CrossCorrSame_NormLevel. Not affecting Alpha.
/// </summary>
/// <param name="tpl">template image.</param>
/// <param name="dst">Destination image</param>
/// <param name="buffer">Allocated device memory with size of at <see cref="SameNormLevelAGetBufferHostSize()"/></param>
public void CrossCorrSame_NormLevelA(NPPImage_8uC4 tpl, NPPImage_32fC4 dst, CudaDeviceVariable<byte> buffer)
{
int bufferSize = SameNormLevelAGetBufferHostSize();
if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");
status = NPPNativeMethods.NPPi.ImageProximity.nppiCrossCorrSame_NormLevel_8u32f_AC4R(_devPtrRoi, _pitch, _sizeRoi, tpl.DevicePointerRoi, tpl.Pitch, tpl.SizeRoi, dst.DevicePointer, dst.Pitch, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCrossCorrSame_NormLevel_8u32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例3: CrossCorrValid_NormA
/// <summary>
/// image CrossCorrValid_Norm. Not affecting Alpha.
/// </summary>
/// <param name="tpl">template image.</param>
/// <param name="dst">Destination-Image</param>
public void CrossCorrValid_NormA(NPPImage_8uC4 tpl, NPPImage_32fC4 dst)
{
status = NPPNativeMethods.NPPi.ImageProximity.nppiCrossCorrValid_Norm_8u32f_AC4R(_devPtrRoi, _pitch, _sizeRoi, tpl.DevicePointerRoi, tpl.Pitch, tpl.SizeRoi, dst.DevicePointerRoi, dst.Pitch);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCrossCorrValid_Norm_8u32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例4: SumWindowColumn
//New in Cuda 6.0
#region SumWindow
/// <summary>
/// 16-bit signed 1D (column) sum to 32f.
/// Apply Column Window Summation filter over a 1D mask region around each
/// source pixel for 4-channel 16 bit/pixel input images with 32-bit floating point
/// output. <para/>
/// Result 32-bit floating point pixel is equal to the sum of the corresponding and
/// neighboring column pixel values in a mask region of the source image defined by
/// nMaskSize and nAnchor.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="nMaskSize">Length of the linear kernel array.</param>
/// <param name="nAnchor">Y offset of the kernel origin frame of reference w.r.t the source pixel.</param>
public void SumWindowColumn(NPPImage_32fC4 dest, int nMaskSize, int nAnchor)
{
status = NPPNativeMethods.NPPi.WindowSum1D.nppiSumWindowColumn_16s32f_C4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nMaskSize, nAnchor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSumWindowColumn_16s32f_C4R", status));
NPPException.CheckNppStatus(status, this);
}
示例5: ConvertA
/// <summary>
/// 8-bit unsigned to 32-bit floating point conversion. Not affecting Alpha channel.
/// </summary>
/// <param name="dst">Destination image</param>
public void ConvertA(NPPImage_32fC4 dst)
{
status = NPPNativeMethods.NPPi.BitDepthConversion.nppiConvert_8u32f_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiConvert_8u32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例6: DivA
/// <summary>
/// Divide constant to image. Unchanged Alpha.
/// </summary>
/// <param name="nConstant">Value</param>
/// <param name="dest">Destination image</param>
public void DivA(float[] nConstant, NPPImage_32fC4 dest)
{
status = NPPNativeMethods.NPPi.DivConst.nppiDivC_32f_AC4R(_devPtrRoi, _pitch, nConstant, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDivC_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例7: RotateA
/// <summary>
/// Rotate images. Not affecting Alpha.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="nAngle">The angle of rotation in degrees.</param>
/// <param name="nShiftX">Shift along horizontal axis</param>
/// <param name="nShiftY">Shift along vertical axis</param>
/// <param name="eInterpolation">Interpolation mode</param>
public void RotateA(NPPImage_32fC4 dest, double nAngle, double nShiftX, double nShiftY, InterpolationMode eInterpolation)
{
status = NPPNativeMethods.NPPi.GeometricTransforms.nppiRotate_32f_AC4R(_devPtr, _sizeRoi, _pitch, new NppiRect(_pointRoi, _sizeRoi),
dest.DevicePointer, dest.Pitch, new NppiRect(dest.PointRoi, dest.SizeRoi), nAngle, nShiftX, nShiftY, eInterpolation);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRotate_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例8: FilterMedian
//New in Cuda 6.0
#region Filter Median
/// <summary>
/// Result pixel value is the median of pixel values under the rectangular mask region.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Median operation.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
public void FilterMedian(NPPImage_32fC4 dst, NppiSize oMaskSize, NppiPoint oAnchor)
{
int bufferSize = FilterMedianGetBufferHostSize(oMaskSize);
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.ImageMedianFilter.nppiFilterMedian_32f_C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, oMaskSize, oAnchor, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMedian_32f_C4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}
示例9: FilterMedianA
/// <summary>
/// Result pixel value is the median of pixel values under the rectangular mask region, ignoring alpha channel.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Median operation.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
/// <param name="buffer">Pointer to the user-allocated scratch buffer required for the Median operation.</param>
public void FilterMedianA(NPPImage_32fC4 dst, NppiSize oMaskSize, NppiPoint oAnchor, CudaDeviceVariable<byte> buffer)
{
int bufferSize = FilterMedianGetBufferHostSizeA(oMaskSize);
if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");
status = NPPNativeMethods.NPPi.ImageMedianFilter.nppiFilterMedian_32f_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, oMaskSize, oAnchor, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMedian_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例10: NormRel_L1A
/// <summary>
/// image NormRel_L1. Not affecting Alpha.
/// </summary>
/// <param name="tpl">template image.</param>
/// <param name="pNormRel">Pointer to the computed relative error for the infinity norm of two images. (3 * sizeof(double))</param>
/// <param name="buffer">Allocated device memory with size of at <see cref="NormRelL1AGetBufferHostSize()"/></param>
public void NormRel_L1A(NPPImage_32fC4 tpl, CudaDeviceVariable<double> pNormRel, CudaDeviceVariable<byte> buffer)
{
int bufferSize = NormRelL1AGetBufferHostSize();
if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");
status = NPPNativeMethods.NPPi.NormRel.nppiNormRel_L1_32f_AC4R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormRel.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormRel_L1_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例11: NormRel_L2A
/// <summary>
/// image NormRel_L2. Buffer is internally allocated and freed. Not affecting Alpha.
/// </summary>
/// <param name="tpl">template image.</param>
/// <param name="pNormRel">Pointer to the computed relative error for the infinity norm of two images. (3 * sizeof(double))</param>
public void NormRel_L2A(NPPImage_32fC4 tpl, CudaDeviceVariable<double> pNormRel)
{
int bufferSize = NormRelL2AGetBufferHostSize();
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.NormRel.nppiNormRel_L2_32f_AC4R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormRel.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormRel_L2_32f_AC4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}
示例12: ResizeA
/// <summary>
/// Resizes images. Not affecting Alpha.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="xFactor">X scaling factor</param>
/// <param name="yFactor">Y scaling factor</param>
/// <param name="eInterpolation">Interpolation mode</param>
public void ResizeA(NPPImage_32fC4 dest, double xFactor, double yFactor, InterpolationMode eInterpolation)
{
status = NPPNativeMethods.NPPi.GeometricTransforms.nppiResize_32f_AC4R(_devPtr, _sizeOriginal, _pitch, new NppiRect(_pointRoi, _sizeRoi), dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, xFactor, yFactor, eInterpolation);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiResize_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例13: RemapA
/// <summary>
/// image remap. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="pXMap">Device memory pointer to 2D image array of X coordinate values to be used when sampling source image. </param>
/// <param name="pYMap">Device memory pointer to 2D image array of Y coordinate values to be used when sampling source image. </param>
/// <param name="eInterpolation">The type of eInterpolation to perform resampling.</param>
public void RemapA(NPPImage_32fC4 dst, NPPImage_32fC1 pXMap, NPPImage_32fC1 pYMap, InterpolationMode eInterpolation)
{
NppiRect srcRect = new NppiRect(_pointRoi, _sizeRoi);
status = NPPNativeMethods.NPPi.Remap.nppiRemap_32f_AC4R(_devPtr, _sizeRoi, _pitch, srcRect, pXMap.DevicePointerRoi, pXMap.Pitch, pYMap.DevicePointerRoi, pYMap.Pitch, dst.DevicePointerRoi, dst.Pitch, dst.SizeRoi, eInterpolation);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRemap_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例14: ResizeSqrPixelA
/// <summary>
/// image resize. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="nXFactor">Factor by which x dimension is changed. </param>
/// <param name="nYFactor">Factor by which y dimension is changed. </param>
/// <param name="nXShift">Source pixel shift in x-direction.</param>
/// <param name="nYShift">Source pixel shift in y-direction.</param>
/// <param name="eInterpolation">The type of eInterpolation to perform resampling.</param>
public void ResizeSqrPixelA(NPPImage_32fC4 dst, double nXFactor, double nYFactor, double nXShift, double nYShift, InterpolationMode eInterpolation)
{
NppiRect srcRect = new NppiRect(_pointRoi, _sizeRoi);
NppiRect dstRect = new NppiRect(dst.PointRoi, dst.SizeRoi);
status = NPPNativeMethods.NPPi.ResizeSqrPixel.nppiResizeSqrPixel_32f_AC4R(_devPtr, _sizeRoi, _pitch, srcRect, dst.DevicePointer, dst.Pitch, dstRect, nXFactor, nYFactor, nXShift, nYShift, eInterpolation);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiResizeSqrPixel_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例15: MaximumRelativeError
/// <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_32fC4 src2, CudaDeviceVariable<double> pError)
{
int bufferSize = MaximumRelativeErrorGetBufferHostSize();
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.MaximumRelativeError.nppiMaximumRelativeError_32f_C4R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_32f_C4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}