/[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.7 by mkoch, Sat Sep 27 12:48:06 2003 UTC revision 1.8 by mkoch, Mon Sep 27 08:17:36 2004 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package java.awt.image;  package java.awt.image;
40    
41    import java.awt.color.ColorSpace;
42    
43  /**  /**
44   * @author C. Brian Jones (cbj@gnu.org)   * @author C. Brian Jones (cbj@gnu.org)
45   */   */
# Line 167  public class IndexColorModel extends Col Line 169  public class IndexColorModel extends Col
169      map_size = size;      map_size = size;
170      opaque = !hasAlpha;      opaque = !hasAlpha;
171      this.trans = trans;      this.trans = trans;
172      }
173    
174      /**
175       * Each array much contain <code>size</code> elements.  For each
176       * array, the i-th color is described by reds[i], greens[i],
177       * blues[i], alphas[i], unless alphas is not specified, then all the
178       * colors are opaque except for the transparent color.
179       *
180       * @param bits the number of bits needed to represent <code>size</code> colors
181       * @param size the number of colors in the color map
182       * @param cmap packed color components
183       * @param start the offset of the first color component in <code>cmap</code>
184       * @param hasAlpha <code>cmap</code> has alpha values
185       * @param trans the index of the transparent color
186       * @param transferType DataBuffer.TYPE_BYTE or DataBuffer.TYPE_USHORT
187       */
188      public IndexColorModel (int bits, int size, byte[] cmap, int start,
189                              boolean hasAlpha, int trans, int transferType)
190      {
191        super(bits * 4, // total bits, sRGB, four channels
192              nArray(bits, 4), // bits for each channel
193              ColorSpace.getInstance(ColorSpace.CS_sRGB), // sRGB
194              true, // has alpha
195              false, // not premultiplied
196              TRANSLUCENT, transferType);
197        if (transferType != DataBuffer.TYPE_BYTE
198            && transferType != DataBuffer.TYPE_USHORT)
199          throw new IllegalArgumentException();
200        map_size = size;
201        opaque = !hasAlpha;
202        this.trans = trans;
203    }    }
204    
205    public final int getMapSize ()    public final int getMapSize ()

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

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