• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NPP.NPPImage_8uC1类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ManagedCuda.NPP.NPPImage_8uC1的典型用法代码示例。如果您正苦于以下问题:C# NPPImage_8uC1类的具体用法?C# NPPImage_8uC1怎么用?C# NPPImage_8uC1使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



NPPImage_8uC1类属于ManagedCuda.NPP命名空间,在下文中一共展示了NPPImage_8uC1类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: DCTQuantFwd8x8LS

 /// <summary>
 /// Forward DCT, quantization and level shift part of the JPEG encoding.
 /// Input is expected in 8x8 macro blocks and output is expected to be in 64x1
 /// macro blocks.
 /// </summary>
 /// <param name="src">Source image.</param>
 /// <param name="dst">Destination image</param>
 /// <param name="QuantFwdTable">Forward quantization tables for JPEG encoding created using QuantInvTableInit()</param>
 /// <param name="oSizeRoi">Roi size (in macro blocks?).</param>
 public static void DCTQuantFwd8x8LS(NPPImage_8uC1 src, NPPImage_16sC1 dst, CudaDeviceVariable<ushort> QuantFwdTable, NppiSize oSizeRoi)
 {
     NppStatus status;
     status = NPPNativeMethods.NPPi.ImageCompression.nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R(src.DevicePointer, src.Pitch, dst.DevicePointer, dst.Pitch, QuantFwdTable.DevicePointer, oSizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiDCTQuantFwd8x8LS_JPEG_8u16s_C1R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:furusdara,项目名称:cuda,代码行数:16,代码来源:JPEGCompression.cs


示例2: GradientColorToGray

 /// <summary>
 /// 3 channel 8-bit unsigned packed RGB to 1 channel 8-bit unsigned packed Gray Gradient conversion.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="eNorm">Gradient distance method to use.</param>
 public void GradientColorToGray(NPPImage_8uC1 dest, NppiNorm eNorm)
 {
     NppStatus status = NPPNativeMethods.NPPi.GradientColorToGray.nppiGradientColorToGray_8u_C3C1R(DevicePointerRoi, Pitch, dest.DevicePointerRoi, dest.Pitch, SizeRoi, eNorm);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiGradientColorToGray_8u_C3C1R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_8uC3.cs


示例3: CopyA

		/// <summary>
		/// Masked Operation 8-bit unsigned image copy. Not affecting Alpha channel.
		/// </summary>
		/// <param name="dst">Destination image</param>
		/// <param name="mask">Mask image</param>
		public void CopyA(NPPImage_32sC4 dst, NPPImage_8uC1 mask)
		{
			status = NPPNativeMethods.NPPi.MemCopy.nppiCopy_32s_AC4MR(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, mask.DevicePointerRoi, mask.Pitch);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_32s_AC4MR", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_32sC4.cs


示例4: Remap

		/// <summary>
		/// planar image remap.
		/// </summary>
		/// <param name="src0">Source image (Channel 0)</param>
		/// <param name="src1">Source image (Channel 1)</param>
		/// <param name="src2">Source image (Channel 2)</param>
		/// <param name="src3">Source image (Channel 3)</param>
		/// <param name="dest0">Destination image (Channel 0)</param>
		/// <param name="dest1">Destination image (Channel 1)</param>
		/// <param name="dest2">Destination image (Channel 2)</param>
		/// <param name="dest3">Destination image (Channel 3)</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 static void Remap(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 src3, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2, NPPImage_8uC1 dest3, NPPImage_32fC1 pXMap, NPPImage_32fC1 pYMap, InterpolationMode eInterpolation)
		{
			CUdeviceptr[] src = new CUdeviceptr[] { src0.DevicePointer, src1.DevicePointer, src2.DevicePointer, src3.DevicePointer };
			CUdeviceptr[] dst = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi, dest3.DevicePointerRoi };
			NppiRect srcRect = new NppiRect(src0.PointRoi, src0.SizeRoi);
			NppStatus status = NPPNativeMethods.NPPi.Remap.nppiRemap_8u_P4R(src, src0.SizeRoi, src0.Pitch, srcRect, pXMap.DevicePointerRoi, pXMap.Pitch, pYMap.DevicePointerRoi, pYMap.Pitch, dst, dest0.Pitch, dest0.SizeRoi, eInterpolation);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRemap_8u_P4R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:23,代码来源:NPPImage_8uC4.cs


示例5: Resize

		/// <summary>
		/// resizes planar images.
		/// </summary>
		/// <param name="src0">Source image (Channel 0)</param>
		/// <param name="src1">Source image (Channel 1)</param>
		/// <param name="src2">Source image (Channel 2)</param>
		/// <param name="src3">Source image (Channel 3)</param>
		/// <param name="dest0">Destination image (Channel 0)</param>
		/// <param name="dest1">Destination image (Channel 1)</param>
		/// <param name="dest2">Destination image (Channel 2)</param>
		/// <param name="dest3">Destination image (Channel 3)</param>
		/// <param name="xFactor">X scaling factor</param>
		/// <param name="yFactor">Y scaling factor</param>
		/// <param name="eInterpolation">Interpolation mode</param>
		public static void Resize(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 src3, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2, NPPImage_8uC1 dest3, double xFactor, double yFactor, InterpolationMode eInterpolation)
		{
			CUdeviceptr[] src = new CUdeviceptr[] { src0.DevicePointer, src1.DevicePointer, src2.DevicePointer, src3.DevicePointer };
			CUdeviceptr[] dst = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi, dest3.DevicePointerRoi };
			NppStatus status = NPPNativeMethods.NPPi.GeometricTransforms.nppiResize_8u_P4R(src, src0.Size, src0.Pitch, new NppiRect(src0.PointRoi, src0.SizeRoi), dst, dest0.Pitch, dest0.SizeRoi, xFactor, yFactor, eInterpolation);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiResize_8u_P4R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:22,代码来源:NPPImage_8uC4.cs


示例6: RGBToYCrCb420

		/// <summary>
		/// 4 channel 8-bit unsigned packed RGB with alpha to 3 channel 8-bit unsigned planar YCrCb420 color conversion.
		/// </summary>
		/// <param name="dest0">Destination image channel 0</param>
		/// <param name="dest1">Destination image channel 1</param>
		/// <param name="dest2">Destination image channel 2</param>
		public void RGBToYCrCb420(NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2)
		{
			CUdeviceptr[] arrayDest = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi };
			int[] arrayPitch = new int[] { dest0.Pitch, dest1.Pitch, dest2.Pitch };
			NppStatus status = NPPNativeMethods.NPPi.RGBToYCrCb.nppiRGBToYCrCb420_8u_AC4P3R(_devPtrRoi, _pitch, arrayDest, arrayPitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRGBToYCrCb420_8u_AC4P3R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC4.cs


示例7: BGRToHLS

		/// <summary>
		/// 4 channel 8-bit unsigned planar BGR with alpha to 4 channel 8-bit unsigned planar HLS with alpha color conversion.
		/// </summary>
		/// <param name="src0">Source image channel 0</param>
		/// <param name="src1">Source image channel 1</param>
		/// <param name="src2">Source image channel 2</param>
		/// <param name="src3">Source image channel 2</param>
		/// <param name="dest0">Destination image channel 0</param>
		/// <param name="dest1">Destination image channel 1</param>
		/// <param name="dest2">Destination image channel 2</param>
		/// <param name="dest3">Destination image channel 3</param>
		public static void BGRToHLS(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 src3, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2, NPPImage_8uC1 dest3)
		{
			CUdeviceptr[] arraySrc = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi, src3.DevicePointerRoi };
			CUdeviceptr[] arrayDest = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi, dest3.DevicePointerRoi };
			NppStatus status = NPPNativeMethods.NPPi.BGRToHLS.nppiBGRToHLS_8u_AP4R(arraySrc, src0.Pitch, arrayDest, dest0.Pitch, src0.SizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiBGRToHLS_8u_AP4R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:19,代码来源:NPPImage_8uC4.cs


示例8: Copy

		/// <summary>
		/// Three-channel 8-bit unsigned packed to planar image copy.
		/// </summary>
		/// <param name="dst0">Destination image channel 0</param>
		/// <param name="dst1">Destination image channel 1</param>
		/// <param name="dst2">Destination image channel 2</param>
		/// <param name="dst3">Destination image channel 3</param>
		public void Copy(NPPImage_8uC1 dst0, NPPImage_8uC1 dst1, NPPImage_8uC1 dst2, NPPImage_8uC1 dst3)
		{
			CUdeviceptr[] array = new CUdeviceptr[] { dst0.DevicePointerRoi, dst1.DevicePointerRoi, dst2.DevicePointerRoi, dst3.DevicePointerRoi };
			status = NPPNativeMethods.NPPi.MemCopy.nppiCopy_8u_C4P4R(_devPtrRoi, _pitch, array, dst0.Pitch, _sizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCopy_8u_C4P4R", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC4.cs


示例9: YCbCr411ToRGB

 /// <summary>
 /// 3 channel 8-bit unsigned planar YCbCr411 to 4 channel 8-bit unsigned packed RGB color conversion with constant alpha.
 /// </summary>
 /// <param name="src0">Source image channel 0</param>
 /// <param name="src1">Source image channel 1</param>
 /// <param name="src2">Source image channel 2</param>
 /// <param name="dest">Destination image</param>
 /// <param name="nAval">8-bit unsigned alpha constant.</param>
 public static void YCbCr411ToRGB(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC4 dest, byte nAval)
 {
     CUdeviceptr[] arraySrc = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi };
     int[] arrayPitch = new int[] { src0.Pitch, src1.Pitch, src2.Pitch };
     NppStatus status = NPPNativeMethods.NPPi.YCbCrToRGB.nppiYCbCr411ToRGB_8u_P3C4R(arraySrc, arrayPitch, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, nAval);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiYCbCr411ToRGB_8u_P3C4R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:16,代码来源:NPPImage_8uC4.cs


示例10: Convert

		/// <summary>
		/// 32-bit unsigned to 8-bit unsigned conversion.
		/// </summary>
		/// <param name="dst">Destination image</param>
		/// <param name="roundMode">Round mode</param>
		/// <param name="scaleFactor">scaling factor</param>
		public void Convert(NPPImage_8uC1 dst, NppRoundMode roundMode, int scaleFactor)
		{
			status = NPPNativeMethods.NPPi.BitDepthConversion.nppiConvert_32u8u_C1RSfs(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, roundMode, scaleFactor);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiConvert_32u8u_C1RSfs", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_32uC1.cs


示例11: YCbCr411ToYCbCr422

 /// <summary>
 /// 3 channel 8-bit unsigned planar YCbCr411 to 3 channel 8-bit unsigned planar YCbCr422 sampling format conversion.
 /// </summary>
 /// <param name="src0">Source image channel 0</param>
 /// <param name="src1">Source image channel 1</param>
 /// <param name="src2">Source image channel 2</param>
 /// <param name="dest0">Destination image channel 0</param>  
 /// <param name="dest1">Destination image channel 1</param>  
 /// <param name="dest2">Destination image channel 2</param>   
 public static void YCbCr411ToYCbCr422(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2)
 {
     CUdeviceptr[] arraySrc = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi };
     int[] arrayPitchSrc = new int[] { src0.Pitch, src1.Pitch, src2.Pitch };
     CUdeviceptr[] arrayDest = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi };
     int[] arrayPitchDest = new int[] { dest0.Pitch, dest1.Pitch, dest2.Pitch };
     NppStatus status = NPPNativeMethods.NPPi.YCbCrAndACrCbAndOther.nppiYCbCr411ToYCbCr422_8u_P3R(arraySrc, arrayPitchSrc, arrayDest, arrayPitchDest, src0.SizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiYCbCr411ToYCbCr422_8u_P3R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:19,代码来源:NPPImage_8uC3.cs


示例12: RGBToYCbCr420

 /// <summary>
 /// 3 channel 8-bit unsigned packed RGB to planar YCbCr420 color conversion.
 /// </summary>
 /// <param name="dst0">Destination image channel 0</param>
 /// <param name="dst1">Destination image channel 1</param>
 /// <param name="dst2">Destination image channel 2</param>
 public void RGBToYCbCr420(NPPImage_8uC1 dst0, NPPImage_8uC1 dst1, NPPImage_8uC1 dst2)
 {
     CUdeviceptr[] array = new CUdeviceptr[] { dst0.DevicePointerRoi, dst1.DevicePointerRoi, dst2.DevicePointerRoi };
     int[] arrayStep = new int[] { dst0.Pitch, dst1.Pitch, dst2.Pitch };
     status = NPPNativeMethods.NPPi.RGBToYCbCr.nppiRGBToYCbCr420_8u_C3P3R(_devPtrRoi, _pitch, array, arrayStep, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRGBToYCbCr420_8u_C3P3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC3.cs


示例13: RGBToYUV420

 /// <summary>
 /// 3 channel 8-bit unsigned planar RGB to 3 channel 8-bit unsigned planar YUV420 color conversion.
 /// </summary>
 /// <param name="src0">Source image channel 0</param>
 /// <param name="src1">Source image channel 1</param>
 /// <param name="src2">Source image channel 2</param>
 /// <param name="dest0">Destination image channel 0</param>  
 /// <param name="dest1">Destination image channel 1</param>  
 /// <param name="dest2">Destination image channel 2</param>     
 public static void RGBToYUV420(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2)
 {
     CUdeviceptr[] arraySrc = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi };
     CUdeviceptr[] arrayDest = new CUdeviceptr[] { dest0.DevicePointerRoi, dest1.DevicePointerRoi, dest2.DevicePointerRoi };
     int[] arrayDestPitch = new int[] { dest0.Pitch, dest1.Pitch, dest2.Pitch };
     NppStatus status = NPPNativeMethods.NPPi.RGBToYUV420.nppiRGBToYUV420_8u_P3R(arraySrc, src0.Pitch, arrayDest, arrayDestPitch, src0.SizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRGBToYUV420_8u_P3R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:18,代码来源:NPPImage_8uC3.cs


示例14: MinMaxIndex

        /// <summary>
        /// Image pixel minimum and maximum values with their indices. Buffer is internally allocated and freed.
        /// </summary>
        /// <param name="coi">Channel of interest (0, 1 or 2)</param>
        /// <param name="min">Allocated device memory with size of at least 1 * sizeof(byte)</param>
        /// <param name="max">Allocated device memory with size of at least 1 * sizeof(byte)</param>
        /// <param name="minIndex">Allocated device memory with size of at least 1 * sizeof(NppiPoint)</param>
        /// <param name="maxIndex">Allocated device memory with size of at least 1 * sizeof(NppiPoint)</param>
        /// <param name="mask">If the mask is filled with zeros, then all the returned values are zeros, i.e., pMinIndex = {0, 0}, pMaxIndex = {0, 0}, pMinValue = 0, pMaxValue = 0.</param>
        public void MinMaxIndex(int coi, CudaDeviceVariable<byte> min, CudaDeviceVariable<byte> max, CudaDeviceVariable<NppiPoint> minIndex, CudaDeviceVariable<NppiPoint> maxIndex, NPPImage_8uC1 mask)
        {
            int bufferSize = MinMaxIndexGetBufferHostSize();
            CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);

            status = NPPNativeMethods.NPPi.MinMaxIndxNew.nppiMinMaxIndx_8u_C3CMR(_devPtrRoi, _pitch, mask.DevicePointerRoi, mask.Pitch, _sizeRoi, coi, min.DevicePointer, max.DevicePointer, minIndex.DevicePointer, maxIndex.DevicePointer, buffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMinMaxIndx_8u_C3CMR", status));
            buffer.Dispose();
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:19,代码来源:NPPImage_8uC3.cs


示例15: RGBToYCrCb422

 /// <summary>
 /// 3 channel 8-bit unsigned planar RGB to 2 channel 8-bit unsigned packed YCrCb422 color conversion.
 /// </summary>
 /// <param name="src0">Source image channel 0</param>
 /// <param name="src1">Source image channel 1</param>
 /// <param name="src2">Source image channel 2</param>
 /// <param name="dest">Destination image</param>
 public static void RGBToYCrCb422(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC2 dest)
 {
     CUdeviceptr[] arraySrc = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi };
     NppStatus status = NPPNativeMethods.NPPi.RGBToYCrCb.nppiRGBToYCrCb422_8u_P3C2R(arraySrc, src0.Pitch, dest.DevicePointerRoi, dest.Pitch, src0.SizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiRGBToYCrCb422_8u_P3C2R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC3.cs


示例16: WarpPerspectiveQuad

		/// <summary>
		/// Perspective transform of an image.<para/>
		/// This function performs perspective warping of a the specified
		/// quadrangle in the source image to the specified quadrangle in the
		/// destination image. The function nppiWarpPerspectiveQuad uses the same
		/// formulas for pixel mapping as in nppiWarpPerspective function. The
		/// transform coefficients are computed internally.
		/// The transformed part of the source image is resampled using the specified
		/// interpolation method and written to the destination ROI.<para/>
		/// NPPI specific recommendation: <para/>
		/// The function operates using 2 types of kernels: fast and accurate. The fast
		/// method is about 4 times faster than its accurate variant,
		/// but doesn't perform memory access checks and requires the destination ROI
		/// to be 64 bytes aligned. Hence any destination ROI is 
		/// chunked into 3 vertical stripes: the first and the third are processed by
		/// accurate kernels and the central one is processed by the fast one.
		/// In order to get the maximum available speed of execution, the projection of
		/// destination ROI onto image addresses must be 64 bytes aligned. This is
		/// always true if the values <para/>
		/// <code>(int)((void *)(pDst + dstRoi.x))</code> and <para/>
		/// <code>(int)((void *)(pDst + dstRoi.x + dstRoi.width))</code> <para/>
		/// are multiples of 64. Another rule of thumb is to specify destination ROI in
		/// such way that left and right sides of the projected image are separated from
		/// the ROI by at least 63 bytes from each side. However, this requires the
		/// whole ROI to be part of allocated memory. In case when the conditions above
		/// are not satisfied, the function may decrease in speed slightly and will
		/// return NPP_MISALIGNED_DST_ROI_WARNING warning.
		/// </summary>
		/// <param name="src0">Source image (Channel 0)</param>
		/// <param name="src1">Source image (Channel 1)</param>
		/// <param name="src2">Source image (Channel 2)</param>
		/// <param name="srcQuad">Source quadrangle [4,2]</param>
		/// <param name="dest0">Destination image (Channel 0)</param>
		/// <param name="dest1">Destination image (Channel 1)</param>
		/// <param name="dest2">Destination image (Channel 2)</param>
		/// <param name="destQuad">Destination quadrangle [4,2]</param>
		/// <param name="eInterpolation">Interpolation mode: can be <see cref="InterpolationMode.NearestNeighbor"/>, <see cref="InterpolationMode.Linear"/> or <see cref="InterpolationMode.Cubic"/></param>
		public static void WarpPerspectiveQuad(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, double[,] srcQuad, NPPImage_8uC1 dest0, NPPImage_8uC1 dest1, NPPImage_8uC1 dest2, double[,] destQuad, InterpolationMode eInterpolation)
		{
			NppiRect rectIn = new NppiRect(src0.PointRoi, src0.SizeRoi);
			NppiRect rectOut = new NppiRect(dest0.PointRoi, dest0.SizeRoi);

			CUdeviceptr[] src = new CUdeviceptr[] { src0.DevicePointer, src1.DevicePointer, src2.DevicePointer };
			CUdeviceptr[] dst = new CUdeviceptr[] { dest0.DevicePointer, dest1.DevicePointer, dest2.DevicePointer };

			NppStatus status = NPPNativeMethods.NPPi.PerspectiveTransforms.nppiWarpPerspectiveQuad_8u_P4R(src, src0.Size, src0.Pitch, rectIn, srcQuad, dst, dest0.Pitch, rectOut, destQuad, eInterpolation);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiWarpPerspectiveQuad_8u_P4R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:49,代码来源:NPPImage_8uC4.cs


示例17: GraphCut

		/// <summary>
		/// Graphcut of a flow network (32bit floating point edge capacities). The
		/// function computes the minimal cut (graphcut) of a 2D regular 8-connected
		/// graph. <para/>
		/// The inputs are the capacities of the horizontal (in transposed form),
		/// vertical and terminal (source and sink) edges. The capacities to source and
		/// sink 
		/// are stored as capacity differences in the terminals array 
		/// ( terminals(x) = source(x) - sink(x) ). The implementation assumes that the
		/// edge capacities 
		/// for boundary edges that would connect to nodes outside the specified domain
		/// are set to 0 (for example left(0,*) == 0). If this is not fulfilled the
		/// computed labeling may be wrong!<para/>
		/// The computed binary labeling is encoded as unsigned 8bit values (0 and >0).
		/// </summary>
		/// <param name="Terminals">Pointer to differences of terminal edge capacities</param>
		/// <param name="LeftTransposed">Pointer to transposed left edge capacities</param>
		/// <param name="RightTransposed">Pointer to transposed right edge capacities</param>
		/// <param name="Top">Pointer to top edge capacities (top(*,0) must be 0)</param>
		/// <param name="TopLeft">Pointer to top left edge capacities (topleft(*,0) </param>
		/// <param name="TopRight">Pointer to top right edge capacities (topright(*,0)</param>
		/// <param name="Bottom">Pointer to bottom edge capacities (bottom(*,height-1)</param>
		/// <param name="BottomLeft">Pointer to bottom left edge capacities </param>
		/// <param name="BottomRight">Pointer to bottom right edge capacities </param>
		/// <param name="Label">Pointer to destination label image </param>
		/// <returns></returns>
		public void GraphCut(NPPImage_32fC1 Terminals, NPPImage_32fC1 LeftTransposed, NPPImage_32fC1 RightTransposed,
			NPPImage_32fC1 Top, NPPImage_32fC1 TopLeft, NPPImage_32fC1 TopRight, NPPImage_32fC1 Bottom, NPPImage_32fC1 BottomLeft,
			NPPImage_32fC1 BottomRight, NPPImage_8uC1 Label)
		{
			status = NPPNativeMethods.NPPi.ImageLabeling.nppiGraphcut8_32f8u(Terminals.DevicePointer, LeftTransposed.DevicePointer, 
				RightTransposed.DevicePointer, Top.DevicePointer, TopLeft.DevicePointer, TopRight.DevicePointer, Bottom.DevicePointer, 
				BottomLeft.DevicePointer, BottomRight.DevicePointer, Terminals.Pitch, LeftTransposed.Pitch, _size, Label.DevicePointer, 
				Label.Pitch, _state);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiGraphcut8_32f8u", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:37,代码来源:GraphCut.cs


示例18: CompareA

		/// <summary>
		/// Compare pSrc's pixels with constant value. Not affecting Alpha.
		/// </summary>
		/// <param name="constants">list of constants, one per color channel.</param>
		/// <param name="dest">Destination image</param>
		/// <param name="eComparisonOperation">Specifies the comparison operation to be used in the pixel comparison.</param>
		public void CompareA(byte[] constants, NPPImage_8uC1 dest, NppCmpOp eComparisonOperation)
		{
			status = NPPNativeMethods.NPPi.Compare.nppiCompareC_8u_AC4R(_devPtrRoi, _pitch, constants, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, eComparisonOperation);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiCompareC_8u_AC4R", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_8uC4.cs


示例19: MinMaxIndex

		/// <summary>
		/// Image pixel minimum and maximum values with their indices. No additional buffer is allocated.
		/// </summary>
		/// <param name="coi">Channel of interest (0, 1 or 2)</param>
		/// <param name="min">Allocated device memory with size of at least 1 * sizeof(ushort)</param>
		/// <param name="max">Allocated device memory with size of at least 1 * sizeof(ushort)</param>
		/// <param name="minIndex">Allocated device memory with size of at least 1 * sizeof(NppiPoint)</param>
		/// <param name="maxIndex">Allocated device memory with size of at least 1 * sizeof(NppiPoint)</param>
		/// <param name="buffer">Allocated device memory with size of at <see cref="MinMaxIndexMaskedGetBufferHostSize()"/></param>
		/// <param name="mask">If the mask is filled with zeros, then all the returned values are zeros, i.e., pMinIndex = {0, 0}, pMaxIndex = {0, 0}, pMinValue = 0, pMaxValue = 0.</param>
		public void MinMaxIndex(int coi, CudaDeviceVariable<ushort> min, CudaDeviceVariable<ushort> max, CudaDeviceVariable<NppiPoint> minIndex, CudaDeviceVariable<NppiPoint> maxIndex, NPPImage_8uC1 mask, CudaDeviceVariable<byte> buffer)
		{
			int bufferSize = MinMaxIndexMaskedGetBufferHostSize();
			if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");

			status = NPPNativeMethods.NPPi.MinMaxIndxNew.nppiMinMaxIndx_16u_C3CMR(_devPtrRoi, _pitch, mask.DevicePointerRoi, mask.Pitch, _sizeRoi, coi, min.DevicePointer, max.DevicePointer, minIndex.DevicePointer, maxIndex.DevicePointer, buffer.DevicePointer);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMinMaxIndx_16u_C3CMR", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:19,代码来源:NPPImage_16uC3.cs


示例20: HLSToBGR

		/// <summary>
		/// 4 channel 8-bit unsigned planar HLS with alpha to 4 channel 8-bit unsigned packed BGR with alpha color conversion.
		/// </summary>
		/// <param name="src0">Source image channel 0</param>
		/// <param name="src1">Source image channel 1</param>
		/// <param name="src2">Source image channel 2</param>
		/// <param name="src3">Source image channel 2</param>
		/// <param name="dest">Destination image</param>
		public static void HLSToBGR(NPPImage_8uC1 src0, NPPImage_8uC1 src1, NPPImage_8uC1 src2, NPPImage_8uC1 src3, NPPImage_8uC4 dest)
		{
			CUdeviceptr[] array = new CUdeviceptr[] { src0.DevicePointerRoi, src1.DevicePointerRoi, src2.DevicePointerRoi, src3.DevicePointerRoi };
			NppStatus status = NPPNativeMethods.NPPi.HLSToBGR.nppiHLSToBGR_8u_AP4C4R(array, src0.Pitch, dest.DevicePointerRoi, dest.Pitch, src0.SizeRoi);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiHLSToBGR_8u_AP4C4R", status));
			NPPException.CheckNppStatus(status, null);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC4.cs



注:本文中的ManagedCuda.NPP.NPPImage_8uC1类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NPP.NPPImage_8uC3类代码示例发布时间:2022-05-26
下一篇:
C# NPP.NPPImage_32fC4类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap