All Packages Class Hierarchy This Package Previous Next Index
Class picture.Colors
java.lang.Object
|
+----picture.Colors
- public class Colors
- extends Object
A general color passing through a PicPipe pipeline, (has 6 components).
Typically, either the double value is used, or the 5 bytes are used,
but not both. In the later stages, the filter and transparency are
ignored and only red/green/blue are relevant.
This code is (c) 1996 Leemon Baird
<leemon@cs.cmu.edu>,
http://www.cs.cmu.edu/~baird
The source and object code may be redistributed freely.
If the code is modified, please state so in the comments.
- Version:
- 1.0, 26 April 96
- Author:
- Leemon Baird
-
blue
- blue component of color, -128=black, 127=bright red
-
filter
- add in color like a sheer curtain, -128=invisible curtain, 127=opaque curtain
-
green
- green component of color, -128=black, 127=bright red
-
red
- red component of color, -128=black, 127=bright red
-
trans
- multiply color like stained glass, -128=invisible glass, 127=can block all or none
-
value
- use double value instead of colors in early PicPipe stages
-
Colors()
-
-
copyInto(Colors)
- Copy one Colors object into the fields of another so they're the same.
-
getHSB(float[])
- Given an array of 3 doubles, changes them to be hue, saturation brightness in range [0,1].
-
reset()
- Reset the 6 Colors components to all -128, and value to 0.
-
set(byte, byte, byte, byte, byte)
- Set colors given 5 bytes in the range [-128,127]
-
set(double, double, double, double, double)
- Set colors given 5 doubles in the range [0,1]
-
setAqua()
- Set the color to aqua (don't change value, filter, or transparency)
-
setBlack()
- Set the color to black (don't change value, filter, or transparency)
-
setBlue()
- Set the color to blue (don't change value, filter, or transparency)
-
setGray()
- Set the color to gray (don't change value, filter, or transparency)
-
setGreen()
- Set the color to green (don't change value, filter, or transparency)
-
setHSB(float, float, float)
- Set colors given 3 doubles (hue, saturation, brightness) in the range [0,1]
-
setPurple()
- Set the color to purple (don't change value, filter, or transparency)
-
setRed()
- Set the color to red (don't change value, filter, or transparency)
-
setRGB(byte, byte, byte)
- Set colors given 3 bytes in the range [-128,127]
-
setRGB(double, double, double)
- Set colors given 3 doubles in the range [0,1]
-
setWhite()
- Set the color to white (don't change value, filter, or transparency)
-
setYellow()
- Set the color to yellow (don't change value, filter, or transparency)
value
public double value
- use double value instead of colors in early PicPipe stages
red
public byte red
- red component of color, -128=black, 127=bright red
green
public byte green
- green component of color, -128=black, 127=bright red
blue
public byte blue
- blue component of color, -128=black, 127=bright red
filter
public byte filter
- add in color like a sheer curtain, -128=invisible curtain, 127=opaque curtain
trans
public byte trans
- multiply color like stained glass, -128=invisible glass, 127=can block all or none
Colors
public Colors()
setBlack
public final void setBlack()
- Set the color to black (don't change value, filter, or transparency)
setWhite
public final void setWhite()
- Set the color to white (don't change value, filter, or transparency)
setGray
public final void setGray()
- Set the color to gray (don't change value, filter, or transparency)
setRed
public final void setRed()
- Set the color to red (don't change value, filter, or transparency)
setGreen
public final void setGreen()
- Set the color to green (don't change value, filter, or transparency)
setBlue
public final void setBlue()
- Set the color to blue (don't change value, filter, or transparency)
setYellow
public final void setYellow()
- Set the color to yellow (don't change value, filter, or transparency)
setAqua
public final void setAqua()
- Set the color to aqua (don't change value, filter, or transparency)
setPurple
public final void setPurple()
- Set the color to purple (don't change value, filter, or transparency)
reset
public final void reset()
- Reset the 6 Colors components to all -128, and value to 0.
setRGB
public final void setRGB(byte r,
byte g,
byte b)
- Set colors given 3 bytes in the range [-128,127]
setRGB
public final void setRGB(double r,
double g,
double b)
- Set colors given 3 doubles in the range [0,1]
setHSB
public final void setHSB(float h,
float s,
float b)
- Set colors given 3 doubles (hue, saturation, brightness) in the range [0,1]
getHSB
public final void getHSB(float hsb[])
- Given an array of 3 doubles, changes them to be hue, saturation brightness in range [0,1].
set
public final void set(byte r,
byte g,
byte b,
byte f,
byte t)
- Set colors given 5 bytes in the range [-128,127]
set
public final void set(double r,
double g,
double b,
double f,
double t)
- Set colors given 5 doubles in the range [0,1]
copyInto
public final void copyInto(Colors color)
- Copy one Colors object into the fields of another so they're the same.
All Packages Class Hierarchy This Package Previous Next Index