/// <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 { ffeval86.Render(handle, rectanglePointer, length, ref bitmap); } } }
protected override void OnDispose(bool disposing) { if (disposing) { if (enviromentDataHandle != null) { enviromentDataHandle.Dispose(); enviromentDataHandle = null; } } base.OnDispose(disposing); }
protected override void OnSetRenderInfo(EffectConfigToken parameters, RenderArgs dstArgs, RenderArgs srcArgs) { PdnFFConfigToken token = (PdnFFConfigToken)parameters; if (enviromentDataHandle != null) { enviromentDataHandle.Dispose(); enviromentDataHandle = null; } filterparsed = false; if (token.Data != null && !string.IsNullOrEmpty(token.Data.Author)) { enviromentDataHandle = ffparse.CreateEnvironmentData(srcArgs.Surface, token.Data); filterparsed = !enviromentDataHandle.IsInvalid; } base.OnSetRenderInfo(parameters, dstArgs, srcArgs); }
public static extern unsafe void Render(SafeEnvironmentDataHandle handle, Rectangle *rois, int length, [In] ref BitmapData data);