Exemple #1
0
        /// <summary>
        /// Renders the Filter Factory output to the destination surface.
        /// </summary>
        /// <param name="handle">The filter environment handle.</param>
        /// <param name="rois">The array of rectangles to render.</param>
        /// <param name="startIndex">The starting index in the rectangle array.</param>
        /// <param name="length">The number of rectangles to render.</param>
        /// <param name="dstSurface">The destination surface.</param>
        public static unsafe void Render(SafeEnvironmentDataHandle handle, Rectangle[] rois, int startIndex, int length, Surface dstSurface)
        {
            if (length == 0)
            {
                return;
            }

            BitmapData bitmap = new BitmapData
            {
                width     = dstSurface.Width,
                height    = dstSurface.Height,
                stride    = dstSurface.Stride,
                pixelSize = ColorBgra.SizeOf,
                scan0     = dstSurface.Scan0.Pointer
            };

            fixed(Rectangle *rectanglePointer = &rois[startIndex])
            {
                if (IntPtr.Size == 8)
                {
                    ffeval64.Render(handle, rectanglePointer, length, ref bitmap);
                }
                else
                {
                    ffeval32.Render(handle, rectanglePointer, length, ref bitmap);
                }
            }
        }
Exemple #2
0
 public void Dispose()
 {
     if (environmentDataHandle != null)
     {
         environmentDataHandle.Dispose();
         environmentDataHandle = null;
     }
 }
Exemple #3
0
        /// <summary>
        /// Sets the Filter source code and Control values
        /// </summary>
        public void SetupFilterData(Surface srcSurface, int[] control_values, string[] source)
        {
            if (environmentDataHandle != null)
            {
                environmentDataHandle.Dispose();
                environmentDataHandle = null;
            }

            environmentDataHandle = ffparse.CreateEnvironmentData(srcSurface, source, control_values);
        }
Exemple #4
0
 public static extern unsafe void Render(SafeEnvironmentDataHandle handle, Rectangle *rois, int length, [In] ref BitmapData data);