本文整理汇总了C#中ManagedCuda.NPP.NPPImage_8uC4类的典型用法代码示例。如果您正苦于以下问题:C# NPPImage_8uC4类的具体用法?C# NPPImage_8uC4怎么用?C# NPPImage_8uC4使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NPPImage_8uC4类属于ManagedCuda.NPP命名空间,在下文中一共展示了NPPImage_8uC4类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LUTCubicA
/// <summary>
/// cubic interpolated look-up-table color conversion.
/// The LUT is derived from a set of user defined mapping points through cubic interpolation. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="pValues">Host pointer to an array of 3 device memory pointers, one per color CHANNEL, pointing to user defined OUTPUT values.</param>
/// <param name="pLevels">Host pointer to an array of 3 device memory pointers, one per color CHANNEL, pointing to user defined INPUT values. pLevels.Size gives nLevels.</param>
public void LUTCubicA(NPPImage_8uC4 dst, CudaDeviceVariable<int>[] pValues, CudaDeviceVariable<int>[] pLevels)
{
CUdeviceptr[] ptrsV = new CUdeviceptr[] { pValues[0].DevicePointer, pValues[1].DevicePointer, pValues[2].DevicePointer };
CUdeviceptr[] ptrsL = new CUdeviceptr[] { pLevels[0].DevicePointer, pLevels[1].DevicePointer, pLevels[2].DevicePointer };
int[] size = new int[] { pLevels[0].Size, pLevels[1].Size, pLevels[2].Size };
status = NPPNativeMethods.NPPi.ColorLUTCubic.nppiLUT_Cubic_8u_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, ptrsV, ptrsL, size);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUT_Cubic_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例2: SubA
/// <summary>
/// In place image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value. Unchanged Alpha.
/// </summary>
/// <param name="src2">2nd source image</param>
/// <param name="nScaleFactor">scaling factor</param>
public void SubA(NPPImage_8uC4 src2, int nScaleFactor)
{
status = NPPNativeMethods.NPPi.Sub.nppiSub_8u_AC4IRSfs(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSub_8u_AC4IRSfs", status));
NPPException.CheckNppStatus(status, this);
}
示例3: Scale
/// <summary>
/// image conversion.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="hint">algorithm performance or accuracy selector, currently ignored</param>
public void Scale(NPPImage_8uC4 dst, NppHintAlgorithm hint)
{
NppiRect srcRect = new NppiRect(_pointRoi, _sizeRoi);
status = NPPNativeMethods.NPPi.Scale.nppiScale_32s8u_C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, hint);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiScale_32s8u_C4R", status));
NPPException.CheckNppStatus(status, this);
}
示例4: FilterSharpenBorderA
/// <summary>
/// Sharpen filter.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="eBorderType">The border type operation to be applied at source image border boundaries.</param>
public void FilterSharpenBorderA(NPPImage_8uC4 dst, NppiBorderType eBorderType)
{
status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterSharpenBorder_8u_AC4R(_devPtr, _pitch, _sizeOriginal, _pointRoi, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, eBorderType);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterSharpenBorder_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例5: FilterGauss
/// <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>
public void FilterGauss(NPPImage_8uC4 dst, CudaDeviceVariable<float> Kernel)
{
status = NPPNativeMethods.NPPi.FixedFilters.nppiFilterGaussAdvanced_8u_C4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, Kernel.Size, Kernel.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiFilterGaussAdvanced_8u_C4R", status));
NPPException.CheckNppStatus(status, this);
}
示例6: 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_8uC4 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_8u_C4R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiAverageRelativeError_8u_C4R", status));
NPPException.CheckNppStatus(status, this);
}
示例7: Not
/// <summary>
/// Image logical Not.
/// </summary>
/// <param name="dest">Destination image</param>
public void Not(NPPImage_8uC4 dest)
{
status = NPPNativeMethods.NPPi.Not.nppiNot_8u_C4R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNot_8u_C4R", status));
NPPException.CheckNppStatus(status, this);
}
示例8: CrossCorrValid_NormLevelA
/// <summary>
/// CrossCorrValid_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="ValidNormLevelAGetBufferHostSize()"/></param>
public void CrossCorrValid_NormLevelA(NPPImage_8uC4 tpl, NPPImage_32fC4 dst, CudaDeviceVariable<byte> buffer)
{
int bufferSize = ValidNormLevelAGetBufferHostSize();
if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");
status = NPPNativeMethods.NPPi.ImageProximity.nppiCrossCorrValid_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, "nppiCrossCorrValid_NormLevel_8u32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例9: 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_8uC4 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_8u_AC4R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormRel.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormRel_L1_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例10: 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_8uC4 tpl, CudaDeviceVariable<double> pNormRel)
{
int bufferSize = NormRelL2AGetBufferHostSize();
CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);
status = NPPNativeMethods.NPPi.NormRel.nppiNormRel_L2_8u_AC4R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormRel.DevicePointer, buffer.DevicePointer);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormRel_L2_8u_AC4R", status));
buffer.Dispose();
NPPException.CheckNppStatus(status, this);
}
示例11: CopySubpixA
/// <summary>
/// linearly interpolated source image subpixel coordinate color copy. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="nDx">Fractional part of source image X coordinate.</param>
/// <param name="nDy">Fractional part of source image Y coordinate.</param>
public void CopySubpixA(NPPImage_8uC4 dst, float nDx, float nDy)
{
status = NPPNativeMethods.NPPi.CopySubpix.nppiCopySubpix_8u_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, nDx, nDy);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopySubpix_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例12: CopyWrapBorderA
/// <summary>
/// image copy with the borders wrapped by replication of source image pixel colors. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="nTopBorderHeight">Height (in pixels) of the top border. The height of the border at the bottom of
/// the destination ROI is implicitly defined by the size of the source ROI: nBottomBorderHeight =
/// oDstSizeROI.height - nTopBorderHeight - oSrcSizeROI.height.</param>
/// <param name="nLeftBorderWidth">Width (in pixels) of the left border. The width of the border at the right side of
/// the destination ROI is implicitly defined by the size of the source ROI: nRightBorderWidth =
/// oDstSizeROI.width - nLeftBorderWidth - oSrcSizeROI.width.</param>
public void CopyWrapBorderA(NPPImage_8uC4 dst, int nTopBorderHeight, int nLeftBorderWidth)
{
status = NPPNativeMethods.NPPi.CopyWrapBorder.nppiCopyWrapBorder_8u_AC4R(_devPtrRoi, _pitch, _sizeRoi, dst.DevicePointerRoi, dst.Pitch, dst.SizeRoi, nTopBorderHeight, nLeftBorderWidth);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopyWrapBorder_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例13: LUTPaletteA
/// <summary>
/// range restricted palette look-up-table color conversion.
/// The LUT is derived from a set of user defined mapping points in a palette and
/// source pixels are then processed using a restricted bit range when looking up palette values. Not affecting Alpha.
/// </summary>
/// <param name="dst">Destination-Image</param>
/// <param name="pTable">Host pointer to an array of 3 device memory pointers, one per color CHANNEL, pointing to user defined OUTPUT palette values.</param>
/// <param name="nBitSize">Number of least significant bits (must be > 0 and <= 8) of each source pixel value to use as index into palette table during conversion.</param>
public void LUTPaletteA(NPPImage_8uC4 dst, CudaDeviceVariable<byte>[] pTable, int nBitSize)
{
CUdeviceptr[] ptrsT = new CUdeviceptr[] { pTable[0].DevicePointer, pTable[1].DevicePointer, pTable[2].DevicePointer };
status = NPPNativeMethods.NPPi.ColorLUTPalette.nppiLUTPalette_8u_AC4R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, ptrsT, nBitSize);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUTPalette_8u_AC4R", status));
NPPException.CheckNppStatus(status, this);
}
示例14: XorA
/// <summary>
/// In place image logical Xor. Unchanged Alpha.
/// </summary>
/// <param name="src2">2nd source image</param>
public void XorA(NPPImage_8uC4 src2)
{
status = NPPNativeMethods.NPPi.Xor.nppiXor_8u_AC4IR(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi);
Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiXor_8u_AC4IR", status));
NPPException.CheckNppStatus(status, this);
}
示例15: SqrDistanceValid_NormA
/// <summary>
/// image SqrDistanceValid_Norm. Not affecting Alpha.
/// </summary>
/// <param name="tpl">template image.</param>
/// <param name="dst">Destination-Image</param>
public void SqrDistanceValid_NormA(NPPImage_8uC4 tpl, NPPImage_32fC4 dst)
{
status = NPPNativeMethods.NPPi.ImageProximity.nppiSqrDistanceValid_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, "nppiSqrDistanceValid_Norm_8u32f_AC4R", status));
NPPException.CheckNppStatus(status, this);
}