Jump to content

UserBlendOp versus BinaryPixelOp


MJW
 Share

Recommended Posts

In the CodeLap 2.0 release, one of the changes is: BlendOps have been changed from UserBlendOp to BinaryPixelOp.

 

What is the distinction between them? I believe UserBlendOp is a subclass of BinaryPixelOp, but what is the significance of the change?

 

I notice UserBlendOp has an associated class called UserBlendOps that provides a number of helpful methods, while PixelBlendOps is labeled as obsolete.

 

 

 

Link to comment
Share on other sites

The following works in Paint.NET 3.5.11 and below

// Darken
private UserBlendOp darkenOp = new UserBlendOps.DarkenBlendOp(); 

 

 

 

The following works in paint.net 4.0+

// Setup for using Darken blend op
private BinaryPixelOp darkenOp = LayerBlendModeUtil.CreateCompositionOp(LayerBlendMode.Darken);

 

The change was made by Rick when developing 4.0.  I think the change was made to match the naming convention of Unary pixel ops.

 

EDIT:

 

Binary pixel operations take two pixels for input.  Unary pixel ops take one pixel for input:

 

// Setup for using pixel op
private UnaryPixelOps.Desaturate desaturateOp = new UnaryPixelOps.Desaturate();

 

  • Upvote 1

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

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...