private static void OnUndo(ICanUndo target) { if (!target.CanUndo) { return; } target.TryUndo(); }
public TrueSourceFilter(IRenderScript script) : base(Compile( new UnsafeTextureDescription(() => script.Descriptor.PrescaleSize), () => { if (script.Descriptor.Prescale) return(new TextureFilter(Return( new DeferredTextureOutput <ITexture2D>( () => Renderer.InputRenderTarget, () => script.Descriptor.PrescaleSize))) .Labeled(ChromaScaleDescription(script.Descriptor.PrescaleSize).AddPostfixToDescription(" (internal)")) .Labeled(LumaScaleDescription(script.Descriptor.PrescaleSize).AddPostfixToDescription(" (internal)"))); ICanUndo <RgbProcess> source = SourceComposition(); return((script.Descriptor.WantYuv ? source.Undo() : source) .SetSize(script.Descriptor.PrescaleSize)); })) { m_RenderScript = script; WantYuv = false; }