本文整理汇总了C#中ManagedCuda.NPP.NPPImage_32fC4类的典型用法代码示例。如果您正苦于以下问题:C# NPPImage_32fC4类的具体用法?C# NPPImage_32fC4怎么用?C# NPPImage_32fC4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NPPImage_32fC4类属于ManagedCuda.NPP命名空间,在下文中一共展示了NPPImage_32fC4类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_8uC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:21,代码来源:NPPImage_16sC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:10,代码来源:NPPImage_8uC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:18,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:16,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:13,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:17,代码来源:NPPImage_32fC4.cs
示例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);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_32fC4.cs
示例16: FilterGaussBorderA
/// <summary>
/// Filters the image using a separable Gaussian filter kernel with user supplied floating point coefficients
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="Kernel">Pointer to an array of nFilterTaps kernel coefficients which sum to 1.0F, where nFilterTaps = 2 * ((int)((float)ceil(radius) + 0.5F) ) + 1.</param>
/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
public void FilterGaussBorderA(NPPImage_32fC4 dst, CudaDeviceVariable<float> Kernel, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.FilterGaussBorder.nppiFilterGaussAdvancedBorder_32f_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, Kernel.Size, Kernel.DevicePointer, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterGaussAdvancedBorder_32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_32fC4.cs
示例17: AverageRelativeError
/// <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_32fC4 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_32f_C4R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_32f_C4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_32fC4.cs
示例18: Sqrt
/// <summary>
/// Image square root.
/// </summary>
/// <param name="dest">Destination image</param>
public void Sqrt(NPPImage_32fC4 dest)
{
status = NPPNativeMethods.NPPi.Sqrt.nppiSqrt_32f_C4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSqrt_32f_C4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:10,代码来源:NPPImage_32fC4.cs
示例19: FilterColumnBorder
//New in Cuda 7.0
#region FilterColumnBorder
/// <summary>
/// General purpose 1D convolution column filter with border control.<para/>
/// Pixels under the mask are multiplied by the respective weights in the mask
/// and the results are summed. If any portion of the mask overlaps the source
/// image boundary the requested border type operation is applied to all mask pixels
/// which fall outside of the source image.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="Kernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order.</param>
/// <param name="nAnchor">X offset of the kernel origin frame of reference w.r.t the source pixel.</param>
/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
public void FilterColumnBorder(NPPImage_32fC4 dest, CudaDeviceVariable<float> Kernel, int nAnchor, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.LinearFilter1D.nppiFilterColumnBorder_32f_C4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, Kernel.DevicePointer, Kernel.Size, nAnchor, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterColumnBorder_32f_C4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:21,代码来源:NPPImage_32fC4.cs
示例20: Copy
/// <summary>
/// Image copy.
/// </summary>
/// <param name="dst">Destination image</param>
/// <param name="channel">Channel number. This number is added to the dst pointer</param>
public void Copy(NPPImage_32fC4 dst, int channel)
{
if (channel < 0 | channel >= dst.Channels) throw new ArgumentOutOfRangeException("channel", "channel must be in range [0..3].");
status = NPPNativeMethods.NPPi.MemCopy.nppiCopy_32f_C1C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi + channel * _typeSize, dst.Pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_32f_C1C4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_32fC1.cs
注:本文中的ManagedCuda.NPP.NPPImage_32fC4类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论