当前位置: 首页>>代码示例>>C#>>正文


C# NPP.NPPImage_8uC1类代码示例

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


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


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