JavaFX: Bringing Rich Experiences To All the Screens Of Your Life

Profile: desktop, common

Overview

A blending mode that defines the manner in which the inputs are composited together. Each Mode describes a mathematical equation that combines premultiplied inputs to produce some premultiplied result.

Attribute Summary

nametypedescription
Public
ADDBlendMode

The color and alpha components from the top input are added to those from the bottom input.

More: [+]

The color and alpha components from the top input are added to those from the bottom input. The result is clamped to 1.0 if it exceeds the logical maximum of 1.0.

Thus:

 	Ar = min(1, Atop+Abot)
 	Cr = min(1, Ctop+Cbot)
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode is sometimes referred to as "linear dodge" in imaging software packages.

BLUEBlendMode

The blue component of the bottom input is replaced with the blue component of the top input; the other color components are unaffected.

More: [+]

The blue component of the bottom input is replaced with the blue component of the top input; the other color components are unaffected. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Rr = Rbot
 	Gr = Gbot
 	Br = Btop
 

COLOR_BURNBlendMode

The inverse of the bottom input color components are divided by the top input color components, all of which is then inverted to produce the resulting color.

More: [+]

The inverse of the bottom input color components are divided by the top input color components, all of which is then inverted to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = 1-((1-Cbot) / Ctop)
 

COLOR_DODGEBlendMode

The bottom input color components are divided by the inverse of the top input color components to produce the resulting color.

More: [+]

The bottom input color components are divided by the inverse of the top input color components to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = Cbot / (1-Ctop)
 

DARKENBlendMode

The darker of the color components from the two inputs are selected to produce the resulting color.

More: [+]

The darker of the color components from the two inputs are selected to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = min(Ctop, Cbot)
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode is the mathematical opposite of the #LIGHTEN mode.

DIFFERENCEBlendMode

The darker of the color components from the two inputs are subtracted from the lighter ones to produce the resulting color.

More: [+]

The darker of the color components from the two inputs are subtracted from the lighter ones to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = abs(Ctop-Cbot)
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode can be used to invert parts of the bottom input image, or to quickly compare two images (equal pixels will result in black).
  • Rendering with a completely white top input inverts the bottom input; rendering with a completely black top input produces a result equivalent to the bottom input.

EXCLUSIONBlendMode

The color components from the two inputs are multiplied and doubled, and then subtracted from the sum of the bottom input color components, to produce the resulting color.

More: [+]

The color components from the two inputs are multiplied and doubled, and then subtracted from the sum of the bottom input color components, to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = Ctop + Cbot - (2*Ctop*Cbot)
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode can be used to invert parts of the bottom input.
  • This mode produces results that are similar to those of #DIFFERENCE, except with lower contrast.
  • Rendering with a completely white top input inverts the bottom input; rendering with a completely black top input produces a result equivalent to the bottom input.

GREENBlendMode

The green component of the bottom input is replaced with the green component of the top input; the other color components are unaffected.

More: [+]

The green component of the bottom input is replaced with the green component of the top input; the other color components are unaffected. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Rr = Rbot
 	Gr = Gtop
 	Br = Bbot
 

HARD_LIGHTBlendMode

The input color components are either multiplied or screened, depending on the top input color.

More: [+]

The input color components are either multiplied or screened, depending on the top input color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
      TODO: not sure how to express this succinctly yet...
 

Notes:

  • This mode is a combination of #SCREEN and #MULTIPLY, depending on the top input color.
  • This mode is the mathematical opposite of the #OVERLAY mode.

LIGHTENBlendMode

The lighter of the color components from the two inputs are selected to produce the resulting color.

More: [+]

The lighter of the color components from the two inputs are selected to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = max(Ctop, Cbot)
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode is the mathematical opposite of the #DARKEN mode.

MULTIPLYBlendMode

The color components from the first input are multiplied with those from the second input.

More: [+]

The color components from the first input are multiplied with those from the second input. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = Ctop * Cbot
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode is the mathematical opposite of the #SCREEN mode.
  • The resulting color is always at least as dark as either of the input colors.
  • Rendering with a completely black top input produces black; rendering with a completely white top input produces a result equivalent to the bottom input.

OVERLAYBlendMode

The input color components are either multiplied or screened, depending on the bottom input color.

More: [+]

The input color components are either multiplied or screened, depending on the bottom input color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
      REMIND: not sure how to express this succinctly yet...
 

Notes:

  • This mode is a combination of #SCREEN and #MULTIPLY, depending on the bottom input color.
  • This mode is the mathematical opposite of the #HARD_LIGHT mode.
  • In this mode, the top input colors "overlay" the bottom input while preserving highlights and shadows of the latter.

REDBlendMode

The red component of the bottom input is replaced with the red component of the top input; the other color components are unaffected.

More: [+]

The red component of the bottom input is replaced with the red component of the top input; the other color components are unaffected. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Rr = Rtop
 	Gr = Gbot
 	Br = Bbot
 

SCREENBlendMode

The color components from both of the inputs are inverted, multiplied with each other, and that result is again inverted to produce the resulting color.

More: [+]

The color components from both of the inputs are inverted, multiplied with each other, and that result is again inverted to produce the resulting color. The alpha components are blended according to the #SRC_OVER equation.

Thus:

 	Ar = Atop + Abot*(1-Atop)
 	Cr = 1 - ((1-Ctop) * (1-Cbot))
 

Notes:

  • This mode is commutative (ordering of inputs does not matter).
  • This mode is the mathematical opposite of the #MULTIPLY mode.
  • The resulting color is always at least as light as either of the input colors.
  • Rendering with a completely white top input produces white; rendering with a completely black top input produces a result equivalent to the bottom input.

SOFT_LIGHTBlendMode

TODO: this is a complicated formula, TBD...

More: [+]

TODO: this is a complicated formula, TBD...

SRC_ATOPBlendMode

The part of the top input lying inside of the bottom input is blended with the bottom input.

More: [+]

The part of the top input lying inside of the bottom input is blended with the bottom input. (Equivalent to the Porter-Duff "source atop destination" rule.)

Thus:

      Ar = Atop*Abot + Abot*(1-Atop) = Abot
      Cr = Ctop*Abot + Cbot*(1-Atop)
 

SRC_INBlendMode

The part of the top input lying inside of the bottom input is kept in the resulting image.

More: [+]

The part of the top input lying inside of the bottom input is kept in the resulting image. (Equivalent to the Porter-Duff "source in destination" rule.)

Thus:

 	Ar = Atop*Abot
 	Cr = Ctop*Abot
 

SRC_OUTBlendMode

The part of the top input lying outside of the bottom input is kept in the resulting image.

More: [+]

The part of the top input lying outside of the bottom input is kept in the resulting image. (Equivalent to the Porter-Duff "source held out by destination" rule.)

Thus:

      Ar = Atop*(1-Abot)
      Cr = Ctop*(1-Abot)
 

SRC_OVERBlendMode

The top input is blended over the bottom input.

More: [+]

The top input is blended over the bottom input. (Equivalent to the Porter-Duff "source over destination" rule.)

Thus:

      Ar = Atop + Abot*(1-Atop)
      Cr = Ctop + Cbot*(1-Atop)
 

Protected

Inherited Attributes

Function Summary

public toString() : java.lang.String

More: [+]

Returns
String

Inherited Functions