Commit 7099616c by Michael Koch Committed by Michael Koch

ColorModel.java: New version from classpath.

2003-06-25  Michael Koch  <konqueror@gmx.de>

	* java/awt/image/ColorModel.java:
	New version from classpath.

From-SVN: r68474
parent b348a598
2003-06-25 Michael Koch <konqueror@gmx.de> 2003-06-25 Michael Koch <konqueror@gmx.de>
* java/awt/image/ColorModel.java:
New version from classpath.
2003-06-25 Michael Koch <konqueror@gmx.de>
* java/net/PlainDatagramSocketImpl.java: * java/net/PlainDatagramSocketImpl.java:
Partly merged with classpath, this mainly adds documentation. Partly merged with classpath, this mainly adds documentation.
......
...@@ -76,7 +76,7 @@ import gnu.java.awt.Buffers; ...@@ -76,7 +76,7 @@ import gnu.java.awt.Buffers;
* </ul> * </ul>
* *
* @author Rolf W. Rasmussen <rolfwr@ii.uib.no> * @author Rolf W. Rasmussen <rolfwr@ii.uib.no>
* @author C. Brian Jones (cbj@gnu.org) * @author C. Brian Jones <cbj@gnu.org>
*/ */
public abstract class ColorModel implements Transparency public abstract class ColorModel implements Transparency
{ {
...@@ -155,6 +155,11 @@ public abstract class ColorModel implements Transparency ...@@ -155,6 +155,11 @@ public abstract class ColorModel implements Transparency
this.transferType = transferType; this.transferType = transferType;
} }
public void finalize()
{
// Do nothing here.
}
/** /**
* Returns the default color model which in Sun's case is an instance * Returns the default color model which in Sun's case is an instance
* of <code>DirectColorModel</code>. * of <code>DirectColorModel</code>.
...@@ -226,7 +231,7 @@ public abstract class ColorModel implements Transparency ...@@ -226,7 +231,7 @@ public abstract class ColorModel implements Transparency
* *
* @see #getRed(int) * @see #getRed(int)
*/ */
public abstract int getGreen(int pixel); public abstract int getGreen(int pixel);
/** /**
* Converts pixel value to sRGB and extract blue int sample * Converts pixel value to sRGB and extract blue int sample
...@@ -384,7 +389,7 @@ public abstract class ColorModel implements Transparency ...@@ -384,7 +389,7 @@ public abstract class ColorModel implements Transparency
*/ */
public Object getDataElements(int rgb, Object pixel) public Object getDataElements(int rgb, Object pixel)
{ {
// FIXME: implement // subclasses has to implement this method.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -403,8 +408,9 @@ public abstract class ColorModel implements Transparency ...@@ -403,8 +408,9 @@ public abstract class ColorModel implements Transparency
* according to the color model. Each component sample is stored * according to the color model. Each component sample is stored
* as a separate element in the array. * as a separate element in the array.
*/ */
public int[] getComponents(int pixel, int[] components, int offset) { public int[] getComponents(int pixel, int[] components, int offset)
// FIXME: implement {
// subclasses has to implement this method.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -426,6 +432,7 @@ public abstract class ColorModel implements Transparency ...@@ -426,6 +432,7 @@ public abstract class ColorModel implements Transparency
*/ */
public int[] getComponents(Object pixel, int[] components, int offset) public int[] getComponents(Object pixel, int[] components, int offset)
{ {
// subclasses has to implement this method.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
...@@ -476,6 +483,19 @@ public abstract class ColorModel implements Transparency ...@@ -476,6 +483,19 @@ public abstract class ColorModel implements Transparency
} }
/** /**
* Convert unnormalized components to normalized components.
*
* @since 1.4
*/
public float[] getNormalizedComponents (Object pixel,
float[] normComponents,
int normOffset)
{
// subclasses has to implement this method.
throw new UnsupportedOperationException();
}
/**
* Converts the unnormalized component samples from an array to a * Converts the unnormalized component samples from an array to a
* pixel value. I.e. composes the pixel from component samples, but * pixel value. I.e. composes the pixel from component samples, but
* does not perform any color conversion or scaling of the samples. * does not perform any color conversion or scaling of the samples.
...@@ -499,14 +519,28 @@ public abstract class ColorModel implements Transparency ...@@ -499,14 +519,28 @@ public abstract class ColorModel implements Transparency
*/ */
public int getDataElement(int[] components, int offset) public int getDataElement(int[] components, int offset)
{ {
// subclasses has to implement this method.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public int getDataElement (float[] components, int offset)
{
// subclasses has to implement this method.
throw new UnsupportedOperationException();
}
public Object getDataElements(int[] components, int offset, Object obj) public Object getDataElements(int[] components, int offset, Object obj)
{ {
// subclasses has to implement this method.
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
public int getDataElements (float[] components, Object obj)
{
// subclasses has to implement this method.
throw new UnsupportedOperationException();
}
public boolean equals(Object obj) public boolean equals(Object obj)
{ {
if (!(obj instanceof ColorModel)) return false; if (!(obj instanceof ColorModel)) return false;
...@@ -594,10 +628,6 @@ public abstract class ColorModel implements Transparency ...@@ -594,10 +628,6 @@ public abstract class ColorModel implements Transparency
return transferType; return transferType;
} }
public void finalize()
{
}
/** /**
* Subclasses must override this method if it is possible for the * Subclasses must override this method if it is possible for the
* color model to have an alpha channel. * color model to have an alpha channel.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment