/[classpath]/classpath/java/awt/image/IndexColorModel.java
ViewVC logotype

Diff of /classpath/java/awt/image/IndexColorModel.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by smarothy, Sat Nov 6 16:24:37 2004 UTC revision 1.12 by smarothy, Thu Nov 25 20:25:17 2004 UTC
# Line 125  public class IndexColorModel extends Col Line 125  public class IndexColorModel extends Col
125    public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,    public IndexColorModel(int bits, int size, byte[] reds, byte[] greens,
126                           byte[] blues, byte[] alphas)                           byte[] blues, byte[] alphas)
127    {    {
128      super (bits);      // FIXME: This super() constructor should not be used since it can give
129        // the wrong value for hasAlpha() which is final and cannot be overloaded
130        super(bits);
131      map_size = size;      map_size = size;
132      opaque = (alphas == null);      opaque = (alphas == null);
133    
# Line 416  public class IndexColorModel extends Col Line 418  public class IndexColorModel extends Col
418     */     */
419    public final int getAlpha (int pixel)    public final int getAlpha (int pixel)
420    {    {
421      if (pixel < map_size)      if (opaque || pixel >= map_size)
422              return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));        return 255;
423        
424      return 0;      return (int) ((generateMask (3) & rgb[pixel]) >> (3 * pixel_bits));
425    }    }
426    
427    /**    /**

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26