/// <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); } } }
public void Dispose() { if (environmentDataHandle != null) { environmentDataHandle.Dispose(); environmentDataHandle = null; } }
/// <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); }
public static extern unsafe void Render(SafeEnvironmentDataHandle handle, Rectangle *rois, int length, [In] ref BitmapData data);