Jump to content

Reading entire image before processing effect dialog


evanolds
 Share

Recommended Posts

Is there a safe and easy way to read the entire image into memory before I display my effect dialog? I can use the render function and some tricks to pass the entire image to my dialog if it needs it, but this gets a little messy and involves some large allocated objects in the config token, which I take it is not desired.

Let's say I wanted to make an effect like Photoshop's "variations", where you see 9 or so different thumbnail previews at once (very helpful). Any suggestions for getting the active image to my config dialog?

There are no warranties whatsoever on my plug-ins. Use them at your own risk. You may redistribute them if you'd like, but I'd prefer you just link to the download on my site. Please do not modify and redistribute.

Link to comment
Share on other sites

Oh man, yeah what you're trying to do goes far beyond the scope of the current effect framework's design. Something like this would want to be built in to Paint.NET at this point whereby it could render multiple effects (or tokens) using the same src and dst buffers so as to save all tons of memory. This does give me some ideas though -- I'll have to get back to you. Nothing related to this will make it for v3.0, fyi.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Is there a safe and easy way to read the entire image into memory before I display my effect dialog?

The source surface is available from the EffectConfigDialog.EffectSourceSurface property after the OnLoad event.

This is how I got the info for the histogram in my 'Threshold' effect. But, as Rick pointed-out, this may not help much if you effect is complex.

If the effect is a pixel-op, you could extract a thumbnail image from the source surface and then duplicate the thumbnail once for each preview image, appply a different effect to each...

ed-sig2.png.3c040e8f8a7b22d05fbfbad8e5ea6994.png

Link to comment
Share on other sites

The source surface is available from the EffectConfigDialog.EffectSourceSurface property after the OnLoad event.

Ah, I think I actually used this in one of my earlier effects that I didn't release, but I'd forgotten. Thanks.

There are no warranties whatsoever on my plug-ins. Use them at your own risk. You may redistribute them if you'd like, but I'd prefer you just link to the download on my site. Please do not modify and redistribute.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...