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

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

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

revision 1.11 by tromey, Sat Nov 30 04:45:34 2002 UTC revision 1.12 by mkoch, Tue Jan 14 21:30:39 2003 UTC
# Line 120  public abstract class ColorModel impleme Line 120  public abstract class ColorModel impleme
120           Buffers.smallestAppropriateTransferType(bits * 4));           Buffers.smallestAppropriateTransferType(bits * 4));
121    }    }
122    
123      /**
124       * Constructs a ColorModel that translates pixel values to
125       * color/alpha components.
126       *
127       * @exception IllegalArgumentException If the length of the bit array is less
128       * than the number of color or alpha components in this ColorModel, or if the
129       * transparency is not a valid value, or if the sum of the number of bits in
130       * bits is less than 1 or if any of the elements in bits is less than 0.
131       */
132    protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace,    protected ColorModel(int pixel_bits, int[] bits, ColorSpace cspace,
133                         boolean hasAlpha, boolean isAlphaPremultiplied,                         boolean hasAlpha, boolean isAlphaPremultiplied,
134                         int transparency, int transferType)                         int transparency, int transferType)
135    {    {
136        int bits_sum = 0;
137        for (int i = 0; i < bits.length; i++)
138          {
139            if (bits [i] < 0)
140              throw new IllegalArgumentException ();
141    
142            bits_sum |= bits [i];
143          }
144        
145        if ((bits.length < cspace.numComponents)
146            || (bits_sum < 1))
147          throw new IllegalArgumentException ();
148    
149      this.pixel_bits = pixel_bits;      this.pixel_bits = pixel_bits;
150      this.bits = bits;      this.bits = bits;
151      this.cspace = cspace;      this.cspace = cspace;

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