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.
-
black
-
-
blue
-
-
brown
-
-
cyan
-
-
darkGray
-
-
gray
-
-
green
-
-
kIsARGBColor
- These constants are used in the fromArray call to indicate
which of the 4 formats the byte array is encoded in.
-
kIsRGBColor
- These constants are used in the fromArray call to indicate
which of the 4 formats the byte array is encoded in.
-
kIsTQ3ColorARGB
- These constants are used in the fromArray call to indicate
which of the 4 formats the byte array is encoded in.
-
kIsTQ3ColorRGB
- These constants are used in the fromArray call to indicate
which of the 4 formats the byte array is encoded in.
-
kMaximumValue
- This is a convenience value - it represents the largest value that a colour component
can have.
-
lightGray
-
-
magenta
-
-
orange
-
-
pink
-
-
red
-
-
white
-
-
yellow
-
-
QDColor()
-
Create an instance of an QDColor class - Black
-
QDColor(Color)
-
Create an instance of an QDColor class
-
QDColor(float, float, float)
-
Create an instance of an QDColor class.
-
QDColor(float, float, float, float)
-
Create an instance of an QDColor class.
-
QDColor(int, int, int)
-
Create an instance of an QDColor class.
-
QDColor(int, int, int, int)
-
Create an instance of an QDColor class.
-
clone()
- Returns a copy of this object
-
convert16to8(int)
- Takes a 16bit color value and converts it into an 8bit value.
-
convert8to16(int)
- Takes an 8bit color value and converts it into a 16bit value.
-
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.
-
fromArray(byte[], int)
- Takes a byte array and converts it to a QDColor.
-
getAlpha()
- Return value of alpha component
-
getAlphaF()
- Return value of alpha component as float
-
getARGB()
-
Converts to a packed int according to the pixel depth supplied.
-
getARGBColor()
- Returns the color as an ARGBColor value
-
getBlue()
- Return value of blue component
-
getBlueF()
- Return value of blue component as float
-
getEndianDescriptorARGBColor()
- Returns the EndianDescriptor for ARGBColor color.
-
getEndianDescriptorRGBColor()
- Returns the EndianDescriptor for RGBColor color.
-
getEndianDescriptorTQ3Color()
- Returns the EndianDescriptor for TQ3Color color.
-
getEndianDescriptorTQ3ColorARGB()
- Returns the EndianDescriptor for TQ3ColorARGB color.
-
getGreen()
- Return value of green component
-
getGreenF()
- Return value of green component as float
-
getRed()
- Return value of red component
-
getRedF()
- Return value of red component as float
-
getRGB()
-
Converts to a packed int according to the pixel depth supplied.
-
getRGBColor()
- Returns the color as an RGBColor value
-
getTQ3ColorARGB()
- Returns the color as a TQ3ColorARGB value
-
getTQ3ColorRGB()
- Returns the color as a TQ3ColorRGB value
-
toColor()
- Convert an QDColor into a java.awt.Color object.
-
toString()
- Returns the String representation of this object
black
public static final QDColor black
white
public static final QDColor white
red
public static final QDColor red
green
public static final QDColor green
blue
public static final QDColor blue
yellow
public static final QDColor yellow
magenta
public static final QDColor magenta
cyan
public static final QDColor cyan
darkGray
public static final QDColor darkGray
gray
public static final QDColor gray
lightGray
public static final QDColor lightGray
pink
public static final QDColor pink
orange
public static final QDColor orange
brown
public static final QDColor brown
kMaximumValue
public static final int kMaximumValue
- This is a convenience value - it represents the largest value that a colour component
can have.
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.
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.
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.
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.
QDColor
public QDColor()
- Create an instance of an QDColor class - Black
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
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
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
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
QDColor
public QDColor(Color color)
- Create an instance of an QDColor class
- Parameters:
- color - the java.awt.Color class to convert
getEndianDescriptorRGBColor
public static final EndianDescriptor getEndianDescriptorRGBColor()
- Returns the EndianDescriptor for RGBColor color.
- Returns:
- an EndianDescriptor
getEndianDescriptorARGBColor
public static final EndianDescriptor getEndianDescriptorARGBColor()
- Returns the EndianDescriptor for ARGBColor color.
- Returns:
- an EndianDescriptor
getEndianDescriptorTQ3Color
public static final EndianDescriptor getEndianDescriptorTQ3Color()
- Returns the EndianDescriptor for TQ3Color color.
- Returns:
- an EndianDescriptor
getEndianDescriptorTQ3ColorARGB
public static final EndianDescriptor getEndianDescriptorTQ3ColorARGB()
- Returns the EndianDescriptor for TQ3ColorARGB color.
- Returns:
- an EndianDescriptor
convert8to16
public static int convert8to16(int value)
- Takes an 8bit color value and converts it into a 16bit value.
convert16to8
public static int convert16to8(int value)
- Takes a 16bit color value and converts it into an 8bit value.
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.
- kIsRGBColorBytes, length == 6, r, g, b of 2 bytes each (unsigned short)(range 0->65535 for each component)
- kIsARGBColorBytes, length == 8, a, r, g, b of 2 bytes each (unsigned short)(range 0->65535 for each component)
- kIsTQ3ColorRGBBytes, length == 12, r, g, b of 4 bytes each (float)(range 0->1 for each component)
- kIsTQ3ColorARGBBytes, length == 16, a, r, g, b of 4 bytes each (float)(range 0->1 for each component)
- 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
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.
getRGBColor
public byte[] getRGBColor()
- Returns the color as an RGBColor value
getARGBColor
public byte[] getARGBColor()
- Returns the color as an ARGBColor value
getTQ3ColorRGB
public byte[] getTQ3ColorRGB()
- Returns the color as a TQ3ColorRGB value
getTQ3ColorARGB
public byte[] getTQ3ColorARGB()
- Returns the color as a TQ3ColorARGB value
getRed
public int getRed()
- Return value of red component
getRedF
public float getRedF()
- Return value of red component as float
getGreen
public int getGreen()
- Return value of green component
getGreenF
public float getGreenF()
- Return value of green component as float
getBlue
public int getBlue()
- Return value of blue component
getBlueF
public float getBlueF()
- Return value of blue component as float
getAlpha
public int getAlpha()
- Return value of alpha component
getAlphaF
public float getAlphaF()
- Return value of alpha component as float
toString
public String toString()
- Returns the String representation of this object
- Overrides:
- toString in class QTByteObject
clone
public Object clone()
- Returns a copy of this object
- Overrides:
- clone in class Object
toColor
public Color toColor()
- Convert an QDColor into a java.awt.Color object.
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
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