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

C# NPP.NPPImage_8uC3类代码示例

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

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



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

示例1: Ln

 /// <summary>
 /// Natural logarithm, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 public void Ln(NPPImage_8uC3 dest, int nScaleFactor)
 {
     status = NPPNativeMethods.NPPi.Ln.nppiLn_8u_C3RSfs(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nScaleFactor);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLn_8u_C3RSfs", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_8uC3.cs


示例2: btn_Resize_Click

        private void btn_Resize_Click(object sender, EventArgs e)
        {
            if ((Bitmap)pic_Image.Image == null) return;

            Bitmap bmp = (Bitmap)pic_Image.Image;
            int w = bmp.Width;
            int h = bmp.Height;

            if ((w <= 16 || h <= 16) && trk_Size.Value < 100)
            {
                MessageBox.Show("Image is too small for resizing.");
                return;
            }

            int newW = (int)(trk_Size.Value / 100.0f * w);
            int newH = (int)(trk_Size.Value / 100.0f * h);

            if (newW % 16 != 0)
            {
                newW = newW - (newW % 16);
            }
            if (newW < 16) newW = 16;

            if (newH % 16 != 0)
            {
                newH = newH - (newH % 16);
            }
            if (newH < 16) newH = 16;

            double ratioW = newW / (double)w;
            double ratioH = newH / (double)h;

            if (ratioW == 1 && ratioH == 1)
                return;

            if (bmp.PixelFormat != System.Drawing.Imaging.PixelFormat.Format24bppRgb)
            {
                MessageBox.Show("Only three channel color images are supported!");
                return;
            }

            NPPImage_8uC3 imgIn = new NPPImage_8uC3(w, h);
            NPPImage_8uC3 imgOut = new NPPImage_8uC3(newW, newH);

            InterpolationMode interpol = InterpolationMode.SuperSampling;
            if (ratioH >= 1 || ratioW >= 1)
                interpol = InterpolationMode.Lanczos;

            imgIn.CopyToDevice(bmp);
            imgIn.ResizeSqrPixel(imgOut, ratioW, ratioH, 0, 0, interpol);
            Bitmap bmpRes = new Bitmap(newW, newH, System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            imgOut.CopyToHost(bmpRes);
            pic_Image.Image = bmpRes;

            imgIn.Dispose();
            imgOut.Dispose();
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:57,代码来源:Form1.cs


示例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_8uC3 dst, NppHintAlgorithm hint)
		{
			NppiRect srcRect = new NppiRect(_pointRoi, _sizeRoi);
			status = NPPNativeMethods.NPPi.Scale.nppiScale_16u8u_C3R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, hint);
			Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiScale_16u8u_C3R", status));
			NPPException.CheckNppStatus(status, this);
		}
开发者ID:lvaleriu,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_16uC3.cs


示例4: Xor

 /// <summary>
 /// In place image logical Xor.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 public void Xor(NPPImage_8uC3 src2)
 {
     status = NPPNativeMethods.NPPi.Xor.nppiXor_8u_C3IR(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiXor_8u_C3IR", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:10,代码来源:NPPImage_8uC3.cs


示例5: YUVToRGB

 /// <summary>
 /// 3 channel 8-bit unsigned packed YUV to 3 channel 8-bit unsigned packed RGB color conversion.
 /// </summary>
 /// <param name="dest">Destination image</param>  
 public void YUVToRGB(NPPImage_8uC3 dest)
 {
     NppStatus status = NPPNativeMethods.NPPi.YUVToRGB.nppiYUVToRGB_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiYUVToRGB_8u_C3R", status));
     NPPException.CheckNppStatus(status, null);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:10,代码来源:NPPImage_8uC3.cs


示例6: Threshold

 /// <summary>
 /// Image threshold.<para/>
 /// If for a comparison operations OP the predicate (sourcePixel OP nThreshold) is true, the pixel is set
 /// to nValue, otherwise it is set to sourcePixel.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="nThreshold">The threshold value.</param>
 /// <param name="nValue">The threshold replacement value.</param>
 /// <param name="eComparisonOperation">eComparisonOperation. Only allowed values are <see cref="NppCmpOp.Less"/> and <see cref="NppCmpOp.Greater"/></param>
 public void Threshold(NPPImage_8uC3 dest, byte[] nThreshold, byte[] nValue, NppCmpOp eComparisonOperation)
 {
     status = NPPNativeMethods.NPPi.Threshold.nppiThreshold_Val_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nThreshold, nValue, eComparisonOperation);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiThreshold_Val_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例7: Transpose

 /// <summary>
 /// image transpose
 /// </summary>
 /// <param name="dest">Destination image</param>
 public void Transpose(NPPImage_8uC3 dest)
 {
     status = NPPNativeMethods.NPPi.Transpose.nppiTranspose_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiTranspose_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:10,代码来源:NPPImage_8uC3.cs


示例8: NormDiff_Inf

        /// <summary>
        /// image NormDiff_Inf. Buffer is internally allocated and freed.
        /// </summary>
        /// <param name="tpl">template image.</param>
        /// <param name="pNormDiff">Pointer to the computed Inf-norm of differences. (3 * sizeof(double))</param>
        public void NormDiff_Inf(NPPImage_8uC3 tpl, CudaDeviceVariable<double> pNormDiff)
        {
            int bufferSize = NormDiffInfGetBufferHostSize();
            CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);

            status = NPPNativeMethods.NPPi.NormDiff.nppiNormDiff_Inf_8u_C3R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormDiff.DevicePointer, buffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormDiff_Inf_8u_C3R", status));
            buffer.Dispose();
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例9: NormRel_L2

        /// <summary>
        /// image NormRel_L2.
        /// </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="NormRelL2GetBufferHostSize()"/></param>
        public void NormRel_L2(NPPImage_8uC3 tpl, CudaDeviceVariable<double> pNormRel, CudaDeviceVariable<byte> buffer)
        {
            int bufferSize = NormRelL2GetBufferHostSize();
            if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");

            status = NPPNativeMethods.NPPi.NormRel.nppiNormRel_L2_8u_C3R(_devPtrRoi, _pitch, tpl.DevicePointerRoi, tpl.Pitch, _sizeRoi, pNormRel.DevicePointer, buffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiNormRel_L2_8u_C3R", status));
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例10: MaximumRelativeError

        /// <summary>
        /// image maximum 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 MaximumRelativeError operation.</param>
        public void MaximumRelativeError(NPPImage_8uC3 src2, CudaDeviceVariable<double> pError, CudaDeviceVariable<byte> buffer)
        {
            int bufferSize = MaximumRelativeErrorGetBufferHostSize();
            if (bufferSize > buffer.Size) throw new NPPException("Provided buffer is too small.");

            status = NPPNativeMethods.NPPi.MaximumRelativeError.nppiMaximumRelativeError_8u_C3R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, pError.DevicePointer, buffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMaximumRelativeError_8u_C3R", status));
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例11: Mirror

 /// <summary>
 /// Mirror image.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="flip">Specifies the axis about which the image is to be mirrored.</param>
 public void Mirror(NPPImage_8uC3 dest, NppiAxis flip)
 {
     status = NPPNativeMethods.NPPi.GeometricTransforms.nppiMirror_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, dest.SizeRoi, flip);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiMirror_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_8uC3.cs


示例12: LUTPalette

 /// <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.
 /// </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 &gt; 0 and &lt;= 8) of each source pixel value to use as index into palette table during conversion.</param>
 public void LUTPalette(NPPImage_8uC3 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_C3R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, ptrsT, nBitSize);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUTPalette_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例13: LUTCubic

 /// <summary>
 /// cubic interpolated look-up-table color conversion.
 /// The LUT is derived from a set of user defined mapping points through cubic interpolation. 
 /// </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 LUTCubic(NPPImage_8uC3 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[] { (int)pLevels[0].Size, (int)pLevels[1].Size, (int)pLevels[2].Size };
     status = NPPNativeMethods.NPPi.ColorLUTCubic.nppiLUT_Cubic_8u_C3R(_devPtrRoi, _pitch, dst.DevicePointerRoi, dst.Pitch, _sizeRoi, ptrsV, ptrsL, size);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUT_Cubic_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:16,代码来源:NPPImage_8uC3.cs


示例14: Lut

        /// <summary>
        /// look-up-table color conversion.<para/>
        /// The LUT is derived from a set of user defined mapping points through linear interpolation.
        /// </summary>
        /// <param name="dest">Destination image</param>
        /// <param name="values0">array of user defined OUTPUT values, channel 0</param>
        /// <param name="levels0">array of user defined INPUT values, channel 0</param>
        /// <param name="values1">array of user defined OUTPUT values, channel 1</param>
        /// <param name="levels1">array of user defined INPUT values, channel 1</param>
        /// <param name="values2">array of user defined OUTPUT values, channel 2</param>
        /// <param name="levels2">array of user defined INPUT values, channel 2</param>
        public void Lut(NPPImage_8uC3 dest, CudaDeviceVariable<int> values0, CudaDeviceVariable<int> levels0, CudaDeviceVariable<int> values1, CudaDeviceVariable<int> levels1, CudaDeviceVariable<int> values2, CudaDeviceVariable<int> levels2)
        {
            if (values0.Size != levels0.Size) throw new ArgumentException("values0 and levels0 must have same size.");
            if (values1.Size != levels1.Size) throw new ArgumentException("values1 and levels1 must have same size.");
            if (values2.Size != levels2.Size) throw new ArgumentException("values2 and levels2 must have same size.");

            CUdeviceptr[] values = new CUdeviceptr[3];
            CUdeviceptr[] levels = new CUdeviceptr[3];
            int[] levelLengths = new int[3];

            values[0] = values0.DevicePointer;
            values[1] = values1.DevicePointer;
            values[2] = values2.DevicePointer;
            levels[0] = levels0.DevicePointer;
            levels[1] = levels1.DevicePointer;
            levels[2] = levels2.DevicePointer;

            levelLengths[0] = (int)levels0.Size;
            levelLengths[1] = (int)levels1.Size;
            levelLengths[2] = (int)levels2.Size;

            status = NPPNativeMethods.NPPi.ColorProcessing.nppiLUT_Linear_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, values, levels, levelLengths);

            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiLUT_Linear_8u_C3R", status));
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:37,代码来源:NPPImage_8uC3.cs


示例15: SqrDistanceValid_Norm

 /// <summary>
 /// image SqrDistanceValid_Norm.
 /// </summary>
 /// <param name="tpl">template image.</param>
 /// <param name="dst">Destination-Image</param>
 /// <param name="nScaleFactor">Integer Result Scaling.</param>
 public void SqrDistanceValid_Norm(NPPImage_8uC3 tpl, NPPImage_8uC3 dst, int nScaleFactor)
 {
     status = NPPNativeMethods.NPPi.ImageProximity.nppiSqrDistanceValid_Norm_8u_C3RSfs(_devPtrRoi, _pitch, _sizeRoi, tpl.DevicePointerRoi, tpl.Pitch, tpl.SizeRoi, dst.DevicePointerRoi, dst.Pitch, nScaleFactor);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSqrDistanceValid_Norm_8u_C3RSfs", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:12,代码来源:NPPImage_8uC3.cs


示例16: Sub

 /// <summary>
 /// In place image subtraction, scale by 2^(-nScaleFactor), then clamp to saturated value.
 /// </summary>
 /// <param name="src2">2nd source image</param>
 /// <param name="nScaleFactor">scaling factor</param>
 public void Sub(NPPImage_8uC3 src2, int nScaleFactor)
 {
     status = NPPNativeMethods.NPPi.Sub.nppiSub_8u_C3IRSfs(src2.DevicePointerRoi, src2.Pitch, _devPtrRoi, _pitch, _sizeRoi, nScaleFactor);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiSub_8u_C3IRSfs", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:11,代码来源:NPPImage_8uC3.cs


示例17: QualityIndex

        /// <summary>
        /// image QualityIndex.
        /// </summary>
        /// <param name="src2">2nd source image</param>
        /// <param name="dst">Pointer to the quality index. (3 * sizeof(float))</param>
        public void QualityIndex(NPPImage_8uC3 src2, CudaDeviceVariable<float> dst)
        {
            int bufferSize = QualityIndexGetBufferHostSize();
            CudaDeviceVariable<byte> buffer = new CudaDeviceVariable<byte>(bufferSize);

            status = NPPNativeMethods.NPPi.QualityIndex.nppiQualityIndex_8u32f_C3R(_devPtrRoi, _pitch, src2.DevicePointerRoi, src2.Pitch, _sizeRoi, dst.DevicePointer, buffer.DevicePointer);
            Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiQualityIndex_8u32f_C3R", status));
            buffer.Dispose();
            NPPException.CheckNppStatus(status, this);
        }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:15,代码来源:NPPImage_8uC3.cs


示例18: ThresholdLTGT

 /// <summary>
 /// Image threshold.<para/>
 /// If for a comparison operations sourcePixel is less than nThresholdLT is true, the pixel is set
 /// to nValueLT, else if sourcePixel is greater than nThresholdGT the pixel is set to nValueGT, otherwise it is set to sourcePixel.
 /// </summary>
 /// <param name="dest">Destination image</param>
 /// <param name="nThresholdLT">The thresholdLT value.</param>
 /// <param name="nValueLT">The thresholdLT replacement value.</param>
 /// <param name="nThresholdGT">The thresholdGT value.</param>
 /// <param name="nValueGT">The thresholdGT replacement value.</param>
 public void ThresholdLTGT(NPPImage_8uC3 dest, byte[] nThresholdLT, byte[] nValueLT, byte[] nThresholdGT, byte[] nValueGT)
 {
     status = NPPNativeMethods.NPPi.Threshold.nppiThreshold_LTValGTVal_8u_C3R(_devPtrRoi, _pitch, dest.DevicePointerRoi, dest.Pitch, _sizeRoi, nThresholdLT, nValueLT, nThresholdGT, nValueGT);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiThreshold_LTValGTVal_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:16,代码来源:NPPImage_8uC3.cs


示例19: Remap

 /// <summary>
 /// image remap.
 /// </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 Remap(NPPImage_8uC3 dst, NPPImage_32fC1 pXMap, NPPImage_32fC1 pYMap, InterpolationMode eInterpolation)
 {
     NppiRect srcRect = new NppiRect(_pointRoi, _sizeRoi);
     status = NPPNativeMethods.NPPi.Remap.nppiRemap_8u_C3R(_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_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:14,代码来源:NPPImage_8uC3.cs


示例20: 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="srcQuad">Source quadrangle [4,2]</param>
 /// <param name="dest">Destination image</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 void WarpPerspectiveQuad(double[,] srcQuad, NPPImage_8uC3 dest, double[,] destQuad, InterpolationMode eInterpolation)
 {
     NppiRect rectIn = new NppiRect(_pointRoi, _sizeRoi);
     NppiRect rectOut = new NppiRect(dest.PointRoi, dest.SizeRoi);
     status = NPPNativeMethods.NPPi.PerspectiveTransforms.nppiWarpPerspectiveQuad_8u_C3R(_devPtr, _sizeOriginal, _pitch, rectIn, srcQuad, dest.DevicePointer, dest.Pitch, rectOut, destQuad, eInterpolation);
     Debug.WriteLine(String.Format("{0:G}, {1}: {2}", DateTime.Now, "nppiWarpPerspectiveQuad_8u_C3R", status));
     NPPException.CheckNppStatus(status, this);
 }
开发者ID:kunzmi,项目名称:managedCuda,代码行数:40,代码来源:NPPImage_8uC3.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# NPP.NPPImage_8uC4类代码示例发布时间:2022-05-26
下一篇:
C# NPP.NPPImage_8uC1类代码示例发布时间: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