public final class

SurfaceType

extends Object
java.lang.Object
   ↳ sun.java2d.loops.SurfaceType

Class Overview

A SurfaceType object provides a chained description of a type of drawing surface. The object will provide a single String constant descriptor which is one way of viewing or accessing a particular drawing surface as well as a pointer to another SurfaceType which describes the same drawing surface in a different (typically more generalized) way.

A more specific description of a surface is considered a "subtype" and a more general description is considered a "supertype". Thus, the deriveSubType method provides a way to create a new SurfaceType that is related to but more specific than an existing SurfaceType and the getSuperType method provides a way to ask a given SurfaceType for a more general way to describe the same surface.

Note that you cannot construct a brand new root for a chain since the constructor is private. Every chain of types must at some point derive from the Any node provided here using the deriveSubType() method. The presence of this common Any node on every chain ensures that all chains end with the DESC_ANY descriptor so that a suitable General GraphicsPrimitive object can be obtained for the indicated surface if all of the more specific searches fail.

Summary

Constants
String DESC_3BYTE_BGR
String DESC_3BYTE_RGB additional 3 byte format common on Windows
String DESC_4BYTE_ABGR
String DESC_4BYTE_ABGR_PRE
String DESC_ANY surface is unknown color model or sample model.
String DESC_ANY_3BYTE wildcard format which indicates that the GraphicsPrimitive operates on a surface with 3 component interleaved Raster and sample model and a ComponentColorModel with an arbitrary ordering of the RGB channels
String DESC_ANY_4BYTE wildcard format which indicates that the GraphicsPrimitive operates on a surface with 4 component interleaved Raster and sample model and a ComponentColorModel with an arbitrary ordering of the ARGB channels
String DESC_ANY_BYTE wildcard format which indicates that the GraphicsPrimitive is independent of the color model on a ByteComponent sample model surface
String DESC_ANY_COLOR
String DESC_ANY_INT wildcard format which indicates that the GraphicsPrimitive is independent of the color model on an IntegerComponent sample model surface
String DESC_ANY_INT_DCM wildcard format which indicates that the GraphicsPrimitive operates on a surface with a single component IntegerComponent sample model and a DirectColorModel with an arbitrary ordering of the RGB channels
String DESC_ANY_PAINT Special type for describing the sources of loops that render the current foreground color or paint instead of copying colors from a source surface.
String DESC_ANY_SHORT wildcard format which indicates that the GraphicsPrimitive is independent of the color model on a ShortComponent sample model surface
String DESC_BYTE_BINARY
String DESC_BYTE_BINARY_1BIT
String DESC_BYTE_BINARY_2BIT
String DESC_BYTE_BINARY_4BIT
String DESC_BYTE_GRAY
String DESC_BYTE_INDEXED
String DESC_BYTE_INDEXED_BM
String DESC_BYTE_INDEXED_OPAQUE Opaque 8-bit indexed images
String DESC_GRADIENT_PAINT
String DESC_INDEX12_GRAY
String DESC_INDEX8_GRAY Special Gray Scale types for rendering loops.
String DESC_INT_ARGB
String DESC_INT_ARGB_BM common formats for BITMASK transparency.
String DESC_INT_ARGB_PRE
String DESC_INT_BGR
String DESC_INT_BGRx
String DESC_INT_RGB common surface formats defined in BufferedImage
String DESC_INT_RGBx additional IntegerComponent types common on Windows
String DESC_LINEAR_GRADIENT_PAINT
String DESC_OPAQUE_COLOR
String DESC_OPAQUE_GRADIENT_PAINT
String DESC_OPAQUE_LINEAR_GRADIENT_PAINT
String DESC_OPAQUE_RADIAL_GRADIENT_PAINT
String DESC_OPAQUE_TEXTURE_PAINT
String DESC_RADIAL_GRADIENT_PAINT
String DESC_TEXTURE_PAINT
String DESC_USHORT_4444_ARGB
String DESC_USHORT_555_RGB
String DESC_USHORT_555_RGBx
String DESC_USHORT_565_RGB
String DESC_USHORT_GRAY
String DESC_USHORT_INDEXED
Fields
public static final SurfaceType Any The root SurfaceType object for all chains of surface descriptions.
public static final SurfaceType Any3Byte
public static final SurfaceType Any4Byte
public static final SurfaceType AnyByte
public static final SurfaceType AnyByteBinary
public static final SurfaceType AnyColor
public static final SurfaceType AnyDcm
public static final SurfaceType AnyInt
public static final SurfaceType AnyPaint
public static final SurfaceType AnyShort
public static final SurfaceType ByteBinary1Bit
public static final SurfaceType ByteBinary2Bit
public static final SurfaceType ByteBinary4Bit
public static final SurfaceType ByteGray
public static final SurfaceType ByteIndexed
public static final SurfaceType ByteIndexedBm
public static final SurfaceType ByteIndexedOpaque
public static final SurfaceType Custom
public static final SurfaceType FourByteAbgr
public static final SurfaceType FourByteAbgrPre
public static final SurfaceType GradientPaint
public static final SurfaceType Index12Gray
public static final SurfaceType Index8Gray
public static final SurfaceType IntArgb
public static final SurfaceType IntArgbBm
public static final SurfaceType IntArgbPre
public static final SurfaceType IntBgr
public static final SurfaceType IntBgrx
public static final SurfaceType IntRgb
public static final SurfaceType IntRgbx
public static final SurfaceType LinearGradientPaint
public static final SurfaceType OpaqueColor
public static final SurfaceType OpaqueGradientPaint
public static final SurfaceType OpaqueLinearGradientPaint
public static final SurfaceType OpaqueRadialGradientPaint
public static final SurfaceType OpaqueTexturePaint
public static final SurfaceType RadialGradientPaint
public static final SurfaceType TexturePaint
public static final SurfaceType ThreeByteBgr
public static final SurfaceType ThreeByteRgb
public static final SurfaceType Ushort4444Argb
public static final SurfaceType Ushort555Rgb
public static final SurfaceType Ushort555Rgbx
public static final SurfaceType Ushort565Rgb
public static final SurfaceType UshortGray
public static final SurfaceType UshortIndexed
protected PixelConverter pixelConverter
Public Methods
SurfaceType deriveSubType(String desc)
Return a new SurfaceType object which uses this object as its more general "supertype" descriptor.
SurfaceType deriveSubType(String desc, PixelConverter pixelConverter)
boolean equals(Object o)
Indicates whether some other object is "equal to" this one.
int getAlphaMask()
String getDescriptor()
PixelConverter getPixelConverter()
SurfaceType getSuperType()
int getUniqueID()
int hashCode()
Returns a hash code value for the object.
synchronized final static int makeUniqueID(String desc)
int pixelFor(int rgb, ColorModel cm)
int rgbFor(int pixel, ColorModel cm)
String toString()
Returns a string representation of the object.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String DESC_3BYTE_BGR

Constant Value: "3 Byte BGR"

public static final String DESC_3BYTE_RGB

additional 3 byte format common on Windows

Constant Value: "3 Byte RGB"

public static final String DESC_4BYTE_ABGR

Constant Value: "4 Byte ABGR"

public static final String DESC_4BYTE_ABGR_PRE

Constant Value: "4 Byte ABGR Premultiplied"

public static final String DESC_ANY

surface is unknown color model or sample model.

Constant Value: "Any Surface"

public static final String DESC_ANY_3BYTE

wildcard format which indicates that the GraphicsPrimitive operates on a surface with 3 component interleaved Raster and sample model and a ComponentColorModel with an arbitrary ordering of the RGB channels

Constant Value: "Any 3 Byte Component"

public static final String DESC_ANY_4BYTE

wildcard format which indicates that the GraphicsPrimitive operates on a surface with 4 component interleaved Raster and sample model and a ComponentColorModel with an arbitrary ordering of the ARGB channels

Constant Value: "Any 4 Byte Component"

public static final String DESC_ANY_BYTE

wildcard format which indicates that the GraphicsPrimitive is independent of the color model on a ByteComponent sample model surface

Constant Value: "Any Discrete Byte"

public static final String DESC_ANY_COLOR

Constant Value: "Single Color"

public static final String DESC_ANY_INT

wildcard format which indicates that the GraphicsPrimitive is independent of the color model on an IntegerComponent sample model surface

Constant Value: "Any Discrete Integer"

public static final String DESC_ANY_INT_DCM

wildcard format which indicates that the GraphicsPrimitive operates on a surface with a single component IntegerComponent sample model and a DirectColorModel with an arbitrary ordering of the RGB channels

Constant Value: "Any Integer DCM"

public static final String DESC_ANY_PAINT

Special type for describing the sources of loops that render the current foreground color or paint instead of copying colors from a source surface.

Constant Value: "Paint Object"

public static final String DESC_ANY_SHORT

wildcard format which indicates that the GraphicsPrimitive is independent of the color model on a ShortComponent sample model surface

Constant Value: "Any Discrete Short"

public static final String DESC_BYTE_BINARY

Constant Value: "Packed Binary Bitmap"

public static final String DESC_BYTE_BINARY_1BIT

Constant Value: "Packed Binary 1-bit Bitmap"

public static final String DESC_BYTE_BINARY_2BIT

Constant Value: "Packed Binary 2-bit Bitmap"

public static final String DESC_BYTE_BINARY_4BIT

Constant Value: "Packed Binary 4-bit Bitmap"

public static final String DESC_BYTE_GRAY

Constant Value: "8-bit Gray"

public static final String DESC_BYTE_INDEXED

Constant Value: "8-bit Indexed"

public static final String DESC_BYTE_INDEXED_BM

Constant Value: "8-bit Indexed (Bitmask)"

public static final String DESC_BYTE_INDEXED_OPAQUE

Opaque 8-bit indexed images

Constant Value: "8-bit Indexed (Opaque)"

public static final String DESC_GRADIENT_PAINT

Constant Value: "Gradient Paint"

public static final String DESC_INDEX12_GRAY

Constant Value: "12-bit Palettized Gray"

public static final String DESC_INDEX8_GRAY

Special Gray Scale types for rendering loops. Really indexed types, but colormap has all gray values.

Constant Value: "8-bit Palettized Gray"

public static final String DESC_INT_ARGB

Constant Value: "Integer ARGB"

public static final String DESC_INT_ARGB_BM

common formats for BITMASK transparency.

Constant Value: "Int ARGB (Bitmask)"

public static final String DESC_INT_ARGB_PRE

Constant Value: "Integer ARGB Premultiplied"

public static final String DESC_INT_BGR

Constant Value: "Integer BGR"

public static final String DESC_INT_BGRx

Constant Value: "Integer BGRx"

public static final String DESC_INT_RGB

common surface formats defined in BufferedImage

Constant Value: "Integer RGB"

public static final String DESC_INT_RGBx

additional IntegerComponent types common on Windows

Constant Value: "Integer RGBx"

public static final String DESC_LINEAR_GRADIENT_PAINT

Constant Value: "Linear Gradient Paint"

public static final String DESC_OPAQUE_COLOR

Constant Value: "Opaque Color"

public static final String DESC_OPAQUE_GRADIENT_PAINT

Constant Value: "Opaque Gradient Paint"

public static final String DESC_OPAQUE_LINEAR_GRADIENT_PAINT

Constant Value: "Opaque Linear Gradient Paint"

public static final String DESC_OPAQUE_RADIAL_GRADIENT_PAINT

Constant Value: "Opaque Radial Gradient Paint"

public static final String DESC_OPAQUE_TEXTURE_PAINT

Constant Value: "Opaque Texture Paint"

public static final String DESC_RADIAL_GRADIENT_PAINT

Constant Value: "Radial Gradient Paint"

public static final String DESC_TEXTURE_PAINT

Constant Value: "Texture Paint"

public static final String DESC_USHORT_4444_ARGB

Constant Value: "Short 4444 ARGB"

public static final String DESC_USHORT_555_RGB

Constant Value: "Short 555 RGB"

public static final String DESC_USHORT_555_RGBx

Constant Value: "Short 555 RGBx"

public static final String DESC_USHORT_565_RGB

Constant Value: "Short 565 RGB"

public static final String DESC_USHORT_GRAY

Constant Value: "16-bit Gray"

public static final String DESC_USHORT_INDEXED

Constant Value: "16-bit Indexed"

Fields

public static final SurfaceType Any

The root SurfaceType object for all chains of surface descriptions. The root uses the default PixelConverter object, which uses a given ColorModel object to calculate its pixelFor() values when asked. Any SurfaceType objects that are not created with a specific PixelConverter object will inherit this behavior from the root.

public static final SurfaceType Any3Byte

public static final SurfaceType Any4Byte

public static final SurfaceType AnyByte

public static final SurfaceType AnyByteBinary

public static final SurfaceType AnyColor

public static final SurfaceType AnyDcm

public static final SurfaceType AnyInt

public static final SurfaceType AnyPaint

public static final SurfaceType AnyShort

public static final SurfaceType ByteBinary1Bit

public static final SurfaceType ByteBinary2Bit

public static final SurfaceType ByteBinary4Bit

public static final SurfaceType ByteGray

public static final SurfaceType ByteIndexed

public static final SurfaceType ByteIndexedBm

public static final SurfaceType ByteIndexedOpaque

public static final SurfaceType Custom

public static final SurfaceType FourByteAbgr

public static final SurfaceType FourByteAbgrPre

public static final SurfaceType GradientPaint

public static final SurfaceType Index12Gray

public static final SurfaceType Index8Gray

public static final SurfaceType IntArgb

public static final SurfaceType IntArgbBm

public static final SurfaceType IntArgbPre

public static final SurfaceType IntBgr

public static final SurfaceType IntBgrx

public static final SurfaceType IntRgb

public static final SurfaceType IntRgbx

public static final SurfaceType LinearGradientPaint

public static final SurfaceType OpaqueColor

public static final SurfaceType OpaqueGradientPaint

public static final SurfaceType OpaqueLinearGradientPaint

public static final SurfaceType OpaqueRadialGradientPaint

public static final SurfaceType OpaqueTexturePaint

public static final SurfaceType RadialGradientPaint

public static final SurfaceType TexturePaint

public static final SurfaceType ThreeByteBgr

public static final SurfaceType ThreeByteRgb

public static final SurfaceType Ushort4444Argb

public static final SurfaceType Ushort555Rgb

public static final SurfaceType Ushort555Rgbx

public static final SurfaceType Ushort565Rgb

public static final SurfaceType UshortGray

public static final SurfaceType UshortIndexed

protected PixelConverter pixelConverter

Public Methods

public SurfaceType deriveSubType (String desc)

Return a new SurfaceType object which uses this object as its more general "supertype" descriptor. If no operation can be found that manipulates the type of surface described more exactly by desc, then this object will define the more relaxed specification of the surface that can be used to find a more general operator.

public SurfaceType deriveSubType (String desc, PixelConverter pixelConverter)

public boolean equals (Object o)

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true).

Note that it is generally necessary to override the hashCode method whenever this method is overridden, so as to maintain the general contract for the hashCode method, which states that equal objects must have equal hash codes.

Parameters
o the reference object with which to compare.
Returns
  • true if this object is the same as the obj argument; false otherwise.

public int getAlphaMask ()

public String getDescriptor ()

public PixelConverter getPixelConverter ()

public SurfaceType getSuperType ()

public int getUniqueID ()

public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by java.util.Hashtable.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals(java.lang.Object) method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hashtables.

As much as is reasonably practical, the hashCode method defined by class Object does return distinct integers for distinct objects. (This is typically implemented by converting the internal address of the object into an integer, but this implementation technique is not required by the JavaTM programming language.)

Returns
  • a hash code value for this object.

public static final synchronized int makeUniqueID (String desc)

public int pixelFor (int rgb, ColorModel cm)

public int rgbFor (int pixel, ColorModel cm)

public String toString ()

Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a string representation of the object.