Jump to content

Effect Composition


BoltBait

Recommended Posts

I know how to call the Gaussian Blur function to blur from the source canvas to the destination canvas.

this.blurEffect.Render(blurToken, dstArgs, srcArgs, rois, startIndex, length);

This always does a replacement on the destination canvas.

Is there a way to do this AND specify a blending operation?

For example, could I call the Gaussian Blur function from the source canvas to the desintation canvas and specify the "Darken" blending operation so that the destination canvas would be the result of blending the image already on the destination canvas with the gaussian blur of the source canvas (using the specified blending op, obviously)?

Link to comment
Share on other sites

Look into the (PaintDotNet.Data?).UserBlendOps.MultiplyBlendOp and its Apply() methods... If you still have the source code from my Outline Object plugin in your inbox, then you can look at the way I use the UserBlendOps.NormalBlendOp class.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

No, I know how to use blend ops. What I want to do is blur from the source canvas to the destination canvas (and other effects) and apply a blend op on the way--without having to create another canvas as an intermediate step.

Link to comment
Share on other sites

No, you can't, as far as I know, even so much as run Gaussian Blur via code without providing it with a destination Surface. Whether that Surface is your final destination Surface, or an intermediate one that you create, is up to you.

xZYt6wl.png

ambigram signature by Kemaru

[i write plugins and stuff]

If you like a post, upvote it!

Link to comment
Share on other sites

Remember how I said the rendering architecture is very limiting right now? If you had a 3rd surface to work with, everything would be possible. But, memory usage makes that prohibitive.

As is, we must wait for the retained-mode, tile-based rendering of Paint.NET v4.0 ...

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

If you had a 3rd surface to work with, everything would be possible. But, memory usage makes that prohibitive.

Given the huge amount of memory on modern PCs, wouldn't this would only be a problem far very large images?

IIRC, your resize code allocates extra surfaces to accomplish its processing...

ed-sig2.png.3c040e8f8a7b22d05fbfbad8e5ea6994.png

Link to comment
Share on other sites

  • 2 months later...

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.

×
×
  • Create New...