public class AlphaColor extends Color
In the final composition between the graphics and video, the underlying video stream will be alpha-blended with the AWT graphics plane using that pixel's alpha value by default, i.e. source over compositing will be used between the video plane and the AWT graphics plane by default. This behavior can be changed using other APIs, possibly APIs defined outside of Java TV.
This API supports up to 256 levels of alpha blending. However, an
individual graphics system may support fewer levels. Such systems
will round the alpha value specified in an AlphaColor
constructor to some nearest value when the AlphaColor
instance is used, e.g. rounding to the nearest implemented alpha
value.
Systems on which alpha blending is not supported will interpret alpha values other than 255 as if they were 255 (opaque) instead.
The actual color used in rendering will depend on finding the best match given the color space available for a given output device.
Within the AWT graphics plane, the actual compositing done will be platform-dependent.
getAlpha(),
Serialized Formblack, BLACK, blue, BLUE, cyan, CYAN, DARK_GRAY, darkGray, gray, GRAY, green, GREEN, LIGHT_GRAY, lightGray, magenta, MAGENTA, orange, ORANGE, pink, PINK, red, RED, white, WHITE, yellow, YELLOWBITMASK, OPAQUE, TRANSLUCENT| Constructor and Description |
|---|
AlphaColor(Color c)
Constructs a new
AlphaColor using the specified
java.awt.Color. |
AlphaColor(float r,
float g,
float b,
float a)
Creates an sRGB color with the specified red, green, blue, and
alpha values in the range [0.0 - 1.0].
|
AlphaColor(int argb,
boolean hasAlpha)
Creates an sRGB color with the specified combined RGBA value
consisting of the alpha component in bits 24-31, the red
component in bits 16-23, the green component in bits 8-15, and
the blue component in bits 0-7.
|
AlphaColor(int r,
int g,
int b,
int a)
Creates an sRGB color with the specified red, green, blue, and
alpha values in the range 0-255, inclusive.
|
| Modifier and Type | Method and Description |
|---|---|
Color |
brighter()
Creates a brighter version of this color.
|
Color |
darker()
Creates a darker version of this color.
|
boolean |
equals(Object obj)
Determines whether another object is equal to this
AlphaColor. |
int |
getAlpha()
Reports the alpha value of this
AlphaColor instance. |
int |
getRGB()
Returns the RGB value representing the color in the default sRGB
ColorModel.
|
int |
hashCode()
Computes the hash code for this color.
|
String |
toString()
Creates a string that represents this
AlphaColor. |
createContext, decode, getBlue, getColor, getColor, getColor, getColorComponents, getColorComponents, getColorSpace, getComponents, getComponents, getGreen, getHSBColor, getRed, getRGBColorComponents, getRGBComponents, getTransparency, HSBtoRGB, RGBtoHSBpublic AlphaColor(float r,
float g,
float b,
float a)
r - The red component.g - The green component.b - The blue component.a - The alpha component.IllegalArgumentException - If any of the input parameters
are outside the range [0.0 - 1.0].Color.getRed(),
Color.getGreen(),
Color.getBlue(),
getAlpha(),
getRGB()public AlphaColor(int r,
int g,
int b,
int a)
r - The red component.g - The green component.b - The blue component.a - The alpha component.IllegalArgumentException - If any of the input parameters
are outside the range [0 - 255].Color.getRed(),
Color.getGreen(),
Color.getBlue(),
getAlpha(),
getRGB()public AlphaColor(int argb,
boolean hasAlpha)
hasAlpha
argument is false, alpha is set to 255.argb - The combined ARGB componentshasAlpha - true if the alpha bits are to be
used, false otherwise.Color.getRed(),
Color.getGreen(),
Color.getBlue(),
getAlpha(),
getRGB()public AlphaColor(Color c)
AlphaColor using the specified
java.awt.Color. If this color has no alpha value, alpha will
be set to 255 (opaque).c - the colorpublic Color brighter()
Although brighter and darker are inverse operations, the results of a series of invocations of these two methods may be inconsistent because of rounding errors.
public Color darker()
Although brighter and darker are inverse operations, the results of a series of invocations of these two methods may be inconsistent because of rounding errors.
darker in class ColorAlphaColor objectbrighter()public boolean equals(Object obj)
AlphaColor.
The result is true if and only if the argument is not
null and is a AlphaColor object that has
the same red, green, blue and alpha values as this object.
public int hashCode()
public int getAlpha()
AlphaColor instance.public int getRGB()
getRGB in class ColorColorModel.getRGBdefault(),
Color.getRed(),
Color.getGreen(),
Color.getBlue()Copyright © 2012 code4tv.com. All Rights Reserved.