JDK-4654826 : spec for AlphaComposite is incomprehensible
  • Type: Bug
  • Status: Closed
  • Resolution: Fixed
  • Component: docs
  • Sub-Component: guides
  • Priority: P4
  • Affected Version: 1.4.0,5.0
  • OS: generic,solaris_2.6
  • CPU: generic,sparc
  • Submit Date: 2002-03-19
  • Updated Date: 2017-05-16
  • Resolved Date: 2003-12-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 b31Fixed
Related Reports
Duplicate :  
Duplicate :  
Description
Name: atR10191			Date: 03/19/2002


specification for the class AlphaComposite states:
" ...
  The alpha resulting from the compositing operation is stored in the
  destination if the destination has an alpha channel. Otherwise, the resulting
  color is divided by the resulting alpha before being stored in the destination
  and the alpha is discarded. If the alpha value is 0.0, the color values are
  set to 0.0.
"
The questions are:
1.How color is divided? Does it mean that it's red, green and blue
  components are divided by the value?
2.What does "alpha is discarded" mean? Does it become 1.0f or 0.0?

Note also that specification for the static members of the class do
not recall about this.

For example, CLEAR:
"...
Fs = 0 and Fd = 0, thus:

        Cd = 0
        Ad = 0
"

But when "alpha is discarded", Ad becomes 1.0.
It's quite confusing and ambiguous.


Another contradictory place is the following:
"A constant alpha value can also be specified to be multiplied with the alpha
 value of the source pixels.

 The following abbreviations are used in the description of the rules:

 Cs = one of the color components of the source pixel.
 Cd = one of the color components of the destination pixel.
 As = alpha component of the source pixel.
 Ad = alpha component of the destination pixel.
 Fs = fraction of the source pixel that contributes to the output.
 Fd = fraction of the input destination pixel that contributes to the output.
"
I guess that "A constant alpha value ... " refers to Fs.
So fraction is alpha.
I think it would be much better to name the same thing with the same
term, especially in the complicated documentation.
And I think "fraction" is better than "alpha", because there is
"alpha value of the source pixels" already.
See for example spec for Src field:
"AlphaComposite object that implements the opaque SRC_OVER rule with an alpha
 of 1.0f."
Here I guess alpha is not "alpha value of the source pixels" but rather Fs.
It's quite confusing.
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-b31 tiger-beta VERIFIED IN: 1.5
2004-09-14

EVALUATION We've fixed this by fleshing out the AlphaComposite and BufferedImage specs. ###@###.### 2003-12-01
2003-12-01