本文整理汇总了C#中ManagedCuda.NPP.NppiPoint类的典型用法代码示例。如果您正苦于以下问题:C# NppiPoint类的具体用法?C# NppiPoint怎么用?C# NppiPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NppiPoint类属于ManagedCuda.NPP命名空间,在下文中一共展示了NppiPoint类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Divide
/// <summary>
/// per element Divide
/// </summary>
/// <param name="src"></param>
/// <param name="value"></param>
/// <returns></returns>
public static NppiPoint Divide(NppiPoint src, int value)
{
NppiPoint ret = new NppiPoint(src.x / value, src.y / value);
return ret;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPTypes.cs
示例2: Add
/// <summary>
/// per element Add
/// </summary>
/// <param name="src"></param>
/// <param name="value"></param>
/// <returns></returns>
public static NppiPoint Add(int src, NppiPoint value)
{
NppiPoint ret = new NppiPoint(src + value.x, src + value.y);
return ret;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPTypes.cs
示例3: ErodeA
/// <summary>
/// Erosion computes the output pixel as the minimum pixel value of the pixels under the mask. Pixels who’s
/// corresponding mask values are zero to not participate in the maximum search, not affecting Alpha.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="Mask">Pointer to the start address of the mask array.</param>
/// <param name="aMaskSize">Width and Height mask array.</param>
/// <param name="oAnchor">X and Y offsets of the mask origin frame of reference w.r.t the source pixel.</param>
public void ErodeA(NPPImage_8uC4 dest, CudaDeviceVariable<byte> Mask, NppiSize aMaskSize, NppiPoint oAnchor)
{
status = NPPNativeMethods.NPPi.MorphologyFilter2D.nppiErode_8u_AC4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, Mask.DevicePointer, aMaskSize, oAnchor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiErode_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC4.cs
示例4: NppiRect
/// <summary>
/// Non-default constructor
/// </summary>
/// <param name="aPoint"></param>
/// <param name="aSize"></param>
public NppiRect(NppiPoint aPoint, NppiSize aSize)
{
x = aPoint.x;
y = aPoint.y;
width = aSize.width;
height = aSize.height;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPTypes.cs
示例5: Subtract
/// <summary>
/// per element Add
/// </summary>
/// <param name="src"></param>
/// <param name="value"></param>
/// <returns></returns>
public static NppiRect Subtract(NppiPoint src, NppiRect value)
{
NppiRect ret = new NppiRect(src.x - value.x, src.y - value.y, value.width, value.height);
return ret;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPTypes.cs
示例6: FilterMaxBorderA
/// <summary>
/// Result pixel value is the maximum of pixel values under the rectangular mask region.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Avg operation.</param>
/// <param name="oAnchor">X and Y offsets 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 FilterMaxBorderA(NPPImage_8uC4 dest, NppiSize oMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.RankFilters.nppiFilterMaxBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, oMaskSize, oAnchor, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMaxBorder_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:13,代码来源:NPPImage_8uC4.cs
示例7: Filter
/// <summary>
/// convolution filter.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="pKernel">Pointer to the start address of the kernel coefficient array.<para/>
/// Coefficients are expected to be stored in reverse order.</param>
/// <param name="oKernelSize">Width and Height of the rectangular kernel.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference</param>
public void Filter(NPPImage_32sC4 dst, CudaDeviceVariable<float> pKernel, NppiSize oKernelSize, NppiPoint oAnchor)
{
status = NPPNativeMethods.NPPi.Convolution.nppiFilter32f_32s_C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, pKernel.DevicePointer, oKernelSize, oAnchor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilter32f_32s_C4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_32sC4.cs
示例8: FilterMedian
/// <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_8uC4 dst, NppiSize oMaskSize, NppiPoint oAnchor)
{
int bufferSize = FilterMedianGetBufferHostSize(oMaskSize);
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.ImageMedianFilter.nppiFilterMedian_8u_C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, oMaskSize, oAnchor, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMedian_8u_C4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC4.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_8uC4 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_8u_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, oMaskSize, oAnchor, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMedian_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:16,代码来源:NPPImage_8uC4.cs
示例10: FilterBoxA
/// <summary>
/// Computes the average pixel values of the pixels under a rectangular mask. Not affecting Alpha.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Avg operation.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference w.r.t the source pixel.</param>
public void FilterBoxA(NPPImage_8uC4 dest, NppiSize oMaskSize, NppiPoint oAnchor)
{
status = NPPNativeMethods.NPPi.LinearFixedFilters2D.nppiFilterBox_8u_AC4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, oMaskSize, oAnchor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBox_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_8uC4.cs
示例11: FilterA
/// <summary>
/// Pixels under the mask are multiplied by the respective weights in the mask and the results are summed.<para/>
/// Before writing the result pixel the sum is scaled back via division by nDivisor. Not affecting Alpha.
/// </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="aKernelSize">Width and Height of the rectangular kernel.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference w.r.t the source pixel.</param>
/// <param name="nDivisor">The factor by which the convolved summation from the Filter operation should be divided. If equal to the sum of coefficients, this will keep the maximum result value within full scale.</param>
public void FilterA(NPPImage_8uC4 dest, CudaDeviceVariable<int> Kernel, NppiSize aKernelSize, NppiPoint oAnchor, int nDivisor)
{
status = NPPNativeMethods.NPPi.Convolution.nppiFilter_8u_AC4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, Kernel.DevicePointer, aKernelSize, oAnchor, nDivisor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilter_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC4.cs
示例12: ErodeBorderA
/// <summary>
/// Erosion computes the output pixel as the minimum pixel value of the pixels under the mask. Pixels who’s
/// corresponding mask values are zero to not participate in the maximum search. With border control, ignoring alpha-channel.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="Mask">Pointer to the start address of the mask array.</param>
/// <param name="aMaskSize">Width and Height mask array.</param>
/// <param name="oAnchor">X and Y offsets of the mask 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 ErodeBorderA(NPPImage_8uC4 dest, CudaDeviceVariable<byte> Mask, NppiSize aMaskSize, NppiPoint oAnchor, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.ErosionWithBorderControl.nppiErodeBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, Mask.DevicePointer, aMaskSize, oAnchor, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiErodeBorder_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC4.cs
示例13: FilterBorderA
/// <summary>
/// Four channel 32-bit signed convolution filter with border control, ignoring alpha channel.<para/>
/// General purpose 2D convolution filter using floating-point weights with border control.<para/>
/// Pixels under the mask are multiplied by the respective weights in the mask
/// and the results are summed. Before writing the result pixel the sum is scaled
/// back via division by nDivisor. 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. <para/>
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="pKernel">Pointer to the start address of the kernel coefficient array. Coeffcients are expected to be stored in reverse order</param>
/// <param name="nKernelSize">Width and Height of the rectangular kernel.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference relative to the source pixel.</param>
/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
public void FilterBorderA(NPPImage_32sC4 dest, CudaDeviceVariable<float> pKernel, NppiSize nKernelSize, NppiPoint oAnchor, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.FilterBorder32f.nppiFilterBorder32f_32s_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, pKernel.DevicePointer, nKernelSize, oAnchor, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterBorder32f_32s_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:20,代码来源:NPPImage_32sC4.cs
示例14: Equals
/// <summary>
///
/// </summary>
/// <param name="value"></param>
/// <returns></returns>
public bool Equals(NppiPoint value)
{
bool ret = true;
ret &= this.x == value.x;
ret &= this.y == value.y;
return ret;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPTypes.cs
示例15: Multiply
/// <summary>
/// per element Multiply
/// </summary>
/// <param name="src"></param>
/// <param name="value"></param>
/// <returns></returns>
public static NppiPoint Multiply(NppiPoint src, NppiSize value)
{
NppiPoint ret = new NppiPoint(src.x * value.width, src.y * value.height);
return ret;
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPTypes.cs
示例16: Contains
/// <summary>
/// Determines if the specified point is contained within this Rectangle structure.
/// </summary>
/// <param name="point"></param>
/// <returns></returns>
public bool Contains(NppiPoint point)
{
return (point.x >= Left) && (point.x <= Right) && (point.y >= Top) && (point.y <= Bottom);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:9,代码来源:NPPTypes.cs
示例17: FilterMax
/// <summary>
/// Result pixel value is the maximum of pixel values under the rectangular mask region.
/// </summary>
/// <param name="dest">Destination image</param>
/// <param name="oMaskSize">Width and Height of the neighborhood region for the local Avg operation.</param>
/// <param name="oAnchor">X and Y offsets of the kernel origin frame of reference w.r.t the source pixel.</param>
public void FilterMax(NPPImage_16uC3 dest, NppiSize oMaskSize, NppiPoint oAnchor)
{
status = NPPNativeMethods.NPPi.RankFilters.nppiFilterMax_16u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, oMaskSize, oAnchor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterMax_16u_C3R", status));
NPPException.CheckNppStatus(status, this);
}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_16uC3.cs
注:本文中的ManagedCuda.NPP.NppiPoint类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论