xod Posted October 30, 2018 Share Posted October 30, 2018 I think in paint.net 4.1.3 some changes have been made because now in VS I have this warning: 'PropertyBasedEffect.PropertyBasedEffect(string, Image, string, EffectFlags)' is obsolete: 'This constructor is deprecated. Use an overload that takes an EffectOptions instance.' Quote Link to comment Share on other sites More sharing options...
BoltBait Posted October 30, 2018 Share Posted October 30, 2018 1 hour ago, xod said: I think in paint.net 4.1.3 some changes have been made because now in VS I have this warning: 'PropertyBasedEffect.PropertyBasedEffect(string, Image, string, EffectFlags)' is obsolete: 'This constructor is deprecated. Use an overload that takes an EffectOptions instance.' Yes, Rick wants to move away from using EffectFlags and toward using EffectOptions. For now, you can still use EffectFlags as this is just a warning... this will change in Paint.NET v4.2 (whenever that ships). NOTE: Effects compiled with EffectFlags will always work, you just won't be able to compile new effects with them after 4.2 ships. Right now, there are only a hand full of Effect Flags (EffectFlags.Configurable | EffectFlags.ForceAliasedSelectionQuality | EffectFlags.SingleThreaded). Going forward, Rick wants to expand the options available and the best way to do that is with EffectOptions. EffectOptions can have more than just flags... you can pass in numeric values to parameters, etc. Here's one change available already: with EffectFlags, your selection is broken up into ROI's that span the entire width of the selection and are typically 1 or 2 rows high... using EffectOptions, you'll have access to breaking up ROI's into tiles to more efficiently use the effect engine. The next release of CodeLab will start generating solutions with EffectOptions. 3 Quote Download: BoltBait's Plugin Pack | CodeLab | and a Free Computer Dominos Game Link to comment Share on other sites More sharing options...
Rick Brewster Posted October 31, 2018 Share Posted October 31, 2018 Also, to expand on what @BoltBait mentioned about tiles vs. horizontal strips: if you use EffectOptions, then you get the new tile-based "rendering schedule" unless you specifically request the legacy horizontal strips. If you still use EffectFlags then your effect is considered a "legacy effect" and you get horizontal strips. EffectOptions isn't difficult, it's just new It's meant to be a superset of EffectFlags, and in fact it contains the EffectFlags. This: new EffectOptions() { Flags = EffectFlags.Configurable } is probably all you need to know how to do at this point. The EffectOptions will play a much more important role in a few releases once I open up the Direct2D/GPU stuff for plugins. It's almost ready, but 4.1.2 - 4.1.4 had to go out the door to solve some more immediate concerns (4.1.4 isn't out yet but will be soon). 2 Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
toe_head2001 Posted March 14, 2019 Share Posted March 14, 2019 (edited) Spiting these posts into a new forum topic. Here's some more info regarding ROI when using EffectOptions. As BoltBait and Rick have both said, EffectOptions uses tile-based rendering by default. On a 800x600 canvas it looks like this: With a selection, it can get a bit more complex: (Note: my red outlines are 1px thick, so some areas appear solid red... because the ROIs are also 1px thick.) ^^^ These images were created using this code: Spoiler void Render(Surface dst, Surface src, Rectangle rect) { using (Graphics g = new RenderArgs(dst).Graphics) { g.DrawRectangle(Pens.Red, rect); } } If your plugin's algorithm assumes the ROIs span the full width, you can specify the legacy behavior like this: : base(StaticName, StaticIcon, SubmenuName, new EffectOptions() { Flags = EffectFlags.Configurable, RenderingSchedule = EffectRenderingSchedule.SmallHorizontalStrips }) As a reminder, here is BoltBait's image of the legacy (full width strips) ROIs. Edited March 19, 2019 by toe_head2001 typos 2 Quote (September 25th, 2023) Sorry about any broken images in my posts. I am aware of the issue. My Gallery | My Plugin Pack Layman's Guide to CodeLab Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.