[gui] Add ComponentColorModel constructor

Jerry Quinn jlquinn@optonline.net
Mon Sep 27 15:17:00 GMT 2004


2004-09-26  Jerry Quinn  <jlquinn@optonline.net>

	* java/awt/image/ComponentColorModel.java (ComponentColorModel):
	Implement missing 1.4 constructor.

Index: ComponentColorModel.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/image/ComponentColorModel.java,v
retrieving revision 1.5.20.1
diff -u -r1.5.20.1 ComponentColorModel.java
--- ComponentColorModel.java	24 Jun 2004 05:30:19 -0000	1.5.20.1
+++ ComponentColorModel.java	26 Sep 2004 17:57:12 -0000
@@ -60,6 +60,32 @@
  	  transparency, transferType);
    }

+  /**
+   * Construct a new ComponentColorModel.
+   *
+   * This constructor makes all bits of each sample significant, so for a
+   * transferType of DataBuffer.BYTE, the bits per sample is 8, etc.  If
+   * both hasAlpha and isAlphaPremultiplied are true, color samples are
+   * assumed to be premultiplied by the alpha component.  Transparency 
may be
+   * one of OPAQUE, BITMASK, or TRANSLUCENT.
+   *
+   * @param colorSpace The colorspace for this color model.
+   * @param hasAlpha True if there is an alpha component.
+   * @param isAlphaPremultiplied True if colors are already multiplied by
+   * alpha.
+   * @param transparency The type of alpha values.
+   * @param transferType Data type of pixel sample values.
+   * @since 1.4
+   */
+  public ComponentColorModel(ColorSpace colorSpace,
+			     boolean hasAlpha,
+			     boolean isAlphaPremultiplied,
+			     int transparency, int transferType)
+  {	
+    this(colorSpace, null, hasAlpha, isAlphaPremultiplied,
+         transparency, transferType);
+  }
+
    public int getRed(int pixel)
    {
      if (getNumComponents()>1) throw new IllegalArgumentException();



More information about the Java-patches mailing list