All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.qd.QDColor

java.lang.Object
   |
   +----quicktime.util.QTByteObject
           |
           +----quicktime.qd.QDColor

public final class QDColor
extends QTByteObject
implements QuickTimeLib, Cloneable
Represents color as 16bit values for each component and alpha channel. Once created this class is a read only color. The static color variables are the same as the java.awt.Color colors, but in 16bit format. The default format for the class (ie. the bytes that are returned by getBytes) is RGBColor.


Variable Index

 o black
 o blue
 o brown
 o cyan
 o darkGray
 o gray
 o green
 o kIsARGBColor
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.
 o kIsRGBColor
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.
 o kIsTQ3ColorARGB
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.
 o kIsTQ3ColorRGB
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.
 o kMaximumValue
This is a convenience value - it represents the largest value that a colour component can have.
 o lightGray
 o magenta
 o orange
 o pink
 o red
 o white
 o yellow

Constructor Index

 o QDColor()
Create an instance of an QDColor class - Black
 o QDColor(Color)
Create an instance of an QDColor class
 o QDColor(float, float, float)
Create an instance of an QDColor class.
 o QDColor(float, float, float, float)
Create an instance of an QDColor class.
 o QDColor(int, int, int)
Create an instance of an QDColor class.
 o QDColor(int, int, int, int)
Create an instance of an QDColor class.

Method Index

 o clone()
Returns a copy of this object
 o convert16to8(int)
Takes a 16bit color value and converts it into an 8bit value.
 o convert8to16(int)
Takes an 8bit color value and converts it into a 16bit value.
 o fromARGBColor(int)
Creates a QDColor with the specified ARGB value, where the alpha component is in bits 24-32 of the argument, where the red component is in bits 16-23 of the argument, the green component is in bits 8-15 of the argument, and the blue component is in bits 0-7.
 o fromArray(byte[], int)
Takes a byte array and converts it to a QDColor.
 o getAlpha()
Return value of alpha component
 o getAlphaF()
Return value of alpha component as float
 o getARGB()
Converts to a packed int according to the pixel depth supplied.
 o getARGBColor()
Returns the color as an ARGBColor value
 o getBlue()
Return value of blue component
 o getBlueF()
Return value of blue component as float
 o getEndianDescriptorARGBColor()
Returns the EndianDescriptor for ARGBColor color.
 o getEndianDescriptorRGBColor()
Returns the EndianDescriptor for RGBColor color.
 o getEndianDescriptorTQ3Color()
Returns the EndianDescriptor for TQ3Color color.
 o getEndianDescriptorTQ3ColorARGB()
Returns the EndianDescriptor for TQ3ColorARGB color.
 o getGreen()
Return value of green component
 o getGreenF()
Return value of green component as float
 o getRed()
Return value of red component
 o getRedF()
Return value of red component as float
 o getRGB()
Converts to a packed int according to the pixel depth supplied.
 o getRGBColor()
Returns the color as an RGBColor value
 o getTQ3ColorARGB()
Returns the color as a TQ3ColorARGB value
 o getTQ3ColorRGB()
Returns the color as a TQ3ColorRGB value
 o toColor()
Convert an QDColor into a java.awt.Color object.
 o toString()
Returns the String representation of this object

Variables

 o black
 public static final QDColor black
 o white
 public static final QDColor white
 o red
 public static final QDColor red
 o green
 public static final QDColor green
 o blue
 public static final QDColor blue
 o yellow
 public static final QDColor yellow
 o magenta
 public static final QDColor magenta
 o cyan
 public static final QDColor cyan
 o darkGray
 public static final QDColor darkGray
 o gray
 public static final QDColor gray
 o lightGray
 public static final QDColor lightGray
 o pink
 public static final QDColor pink
 o orange
 public static final QDColor orange
 o brown
 public static final QDColor brown
 o kMaximumValue
 public static final int kMaximumValue
This is a convenience value - it represents the largest value that a colour component can have.

 o kIsRGBColor
 public static final int kIsRGBColor
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.

 o kIsARGBColor
 public static final int kIsARGBColor
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.

 o kIsTQ3ColorRGB
 public static final int kIsTQ3ColorRGB
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.

 o kIsTQ3ColorARGB
 public static final int kIsTQ3ColorARGB
These constants are used in the fromArray call to indicate which of the 4 formats the byte array is encoded in.

Constructors

 o QDColor
 public QDColor()
Create an instance of an QDColor class - Black

 o QDColor
 public QDColor(int red,
                int green,
                int blue)
Create an instance of an QDColor class. Alpha is set to default (0xFFFF - opaque).

Parameters:
red - the 16bit red value
green - the 16bit green value
blue - the 16bit blue value
 o QDColor
 public QDColor(int red,
                int green,
                int blue,
                int alpha)
Create an instance of an QDColor class.

Parameters:
red - the 16bit red value
green - the 16bit green value
blue - the 16bit blue value
alpha - the 16bit alpha value
 o QDColor
 public QDColor(float red,
                float green,
                float blue)
Create an instance of an QDColor class. Alpha is set to default (0xFFFF - opaque).

Parameters:
red - the 16bit red value
green - the 16bit green value
blue - the 16bit blue value
 o QDColor
 public QDColor(float red,
                float green,
                float blue,
                float alpha)
Create an instance of an QDColor class.

Parameters:
red - the 16bit red value
green - the 16bit green value
blue - the 16bit blue value
alpha - the 16bit alpha value
 o QDColor
 public QDColor(Color color)
Create an instance of an QDColor class

Parameters:
color - the java.awt.Color class to convert

Methods

 o getEndianDescriptorRGBColor
 public static final EndianDescriptor getEndianDescriptorRGBColor()
Returns the EndianDescriptor for RGBColor color.

Returns:
an EndianDescriptor
 o getEndianDescriptorARGBColor
 public static final EndianDescriptor getEndianDescriptorARGBColor()
Returns the EndianDescriptor for ARGBColor color.

Returns:
an EndianDescriptor
 o getEndianDescriptorTQ3Color
 public static final EndianDescriptor getEndianDescriptorTQ3Color()
Returns the EndianDescriptor for TQ3Color color.

Returns:
an EndianDescriptor
 o getEndianDescriptorTQ3ColorARGB
 public static final EndianDescriptor getEndianDescriptorTQ3ColorARGB()
Returns the EndianDescriptor for TQ3ColorARGB color.

Returns:
an EndianDescriptor
 o convert8to16
 public static int convert8to16(int value)
Takes an 8bit color value and converts it into a 16bit value.

 o convert16to8
 public static int convert16to8(int value)
Takes a 16bit color value and converts it into an 8bit value.

 o fromArray
 public static QDColor fromArray(byte colorBytes[],
                                 int flag)
Takes a byte array and converts it to a QDColor. The flag tells the call what format the bytes are in. The length of the array must equate to at least the required length of bytes.

Parameters:
colorBytes - the byte array containing the color values
flag - flag that describes the format of the byte array
Returns:
a QDColor
Throws: IllegalArgumentException
if mismatch between minimum length of byte array and format flag
 o fromARGBColor
 public static QDColor fromARGBColor(int argb)
Creates a QDColor with the specified ARGB value, where the alpha component is in bits 24-32 of the argument, where the red component is in bits 16-23 of the argument, the green component is in bits 8-15 of the argument, and the blue component is in bits 0-7. The value zero indicates no contribution from the primary color component.

 o getRGBColor
 public byte[] getRGBColor()
Returns the color as an RGBColor value

 o getARGBColor
 public byte[] getARGBColor()
Returns the color as an ARGBColor value

 o getTQ3ColorRGB
 public byte[] getTQ3ColorRGB()
Returns the color as a TQ3ColorRGB value

 o getTQ3ColorARGB
 public byte[] getTQ3ColorARGB()
Returns the color as a TQ3ColorARGB value

 o getRed
 public int getRed()
Return value of red component

 o getRedF
 public float getRedF()
Return value of red component as float

 o getGreen
 public int getGreen()
Return value of green component

 o getGreenF
 public float getGreenF()
Return value of green component as float

 o getBlue
 public int getBlue()
Return value of blue component

 o getBlueF
 public float getBlueF()
Return value of blue component as float

 o getAlpha
 public int getAlpha()
Return value of alpha component

 o getAlphaF
 public float getAlphaF()
Return value of alpha component as float

 o toString
 public String toString()
Returns the String representation of this object

Overrides:
toString in class QTByteObject
 o clone
 public Object clone()
Returns a copy of this object

Overrides:
clone in class Object
 o toColor
 public Color toColor()
Convert an QDColor into a java.awt.Color object.

 o getARGB
 public int getARGB()
Converts to a packed int according to the pixel depth supplied.

Returns:
packed int of 8bit depth for each a, r, g, b component
 o getRGB
 public int getRGB()
Converts to a packed int according to the pixel depth supplied. Alpha channel is 0 (the high 8 bits).

Returns:
packed int of 8bit depth for each r, g, b component

All Packages  Class Hierarchy  This Package  Previous  Next  Index