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

Variable Index

 o blue
blue component of color, -128=black, 127=bright red
 o filter
add in color like a sheer curtain, -128=invisible curtain, 127=opaque curtain
 o green
green component of color, -128=black, 127=bright red
 o red
red component of color, -128=black, 127=bright red
 o trans
multiply color like stained glass, -128=invisible glass, 127=can block all or none
 o value
use double value instead of colors in early PicPipe stages

Constructor Index

 o Colors()

Method Index

 o copyInto(Colors)
Copy one Colors object into the fields of another so they're the same.
 o getHSB(float[])
Given an array of 3 doubles, changes them to be hue, saturation brightness in range [0,1].
 o reset()
Reset the 6 Colors components to all -128, and value to 0.
 o set(byte, byte, byte, byte, byte)
Set colors given 5 bytes in the range [-128,127]
 o set(double, double, double, double, double)
Set colors given 5 doubles in the range [0,1]
 o setAqua()
Set the color to aqua (don't change value, filter, or transparency)
 o setBlack()
Set the color to black (don't change value, filter, or transparency)
 o setBlue()
Set the color to blue (don't change value, filter, or transparency)
 o setGray()
Set the color to gray (don't change value, filter, or transparency)
 o setGreen()
Set the color to green (don't change value, filter, or transparency)
 o setHSB(float, float, float)
Set colors given 3 doubles (hue, saturation, brightness) in the range [0,1]
 o setPurple()
Set the color to purple (don't change value, filter, or transparency)
 o setRed()
Set the color to red (don't change value, filter, or transparency)
 o setRGB(byte, byte, byte)
Set colors given 3 bytes in the range [-128,127]
 o setRGB(double, double, double)
Set colors given 3 doubles in the range [0,1]
 o setWhite()
Set the color to white (don't change value, filter, or transparency)
 o setYellow()
Set the color to yellow (don't change value, filter, or transparency)

Variables

 o value
 public double value
use double value instead of colors in early PicPipe stages

 o red
 public byte red
red component of color, -128=black, 127=bright red

 o green
 public byte green
green component of color, -128=black, 127=bright red

 o blue
 public byte blue
blue component of color, -128=black, 127=bright red

 o filter
 public byte filter
add in color like a sheer curtain, -128=invisible curtain, 127=opaque curtain

 o trans
 public byte trans
multiply color like stained glass, -128=invisible glass, 127=can block all or none

Constructors

 o Colors
 public Colors()

Methods

 o setBlack
 public final void setBlack()
Set the color to black (don't change value, filter, or transparency)

 o setWhite
 public final void setWhite()
Set the color to white (don't change value, filter, or transparency)

 o setGray
 public final void setGray()
Set the color to gray (don't change value, filter, or transparency)

 o setRed
 public final void setRed()
Set the color to red (don't change value, filter, or transparency)

 o setGreen
 public final void setGreen()
Set the color to green (don't change value, filter, or transparency)

 o setBlue
 public final void setBlue()
Set the color to blue (don't change value, filter, or transparency)

 o setYellow
 public final void setYellow()
Set the color to yellow (don't change value, filter, or transparency)

 o setAqua
 public final void setAqua()
Set the color to aqua (don't change value, filter, or transparency)

 o setPurple
 public final void setPurple()
Set the color to purple (don't change value, filter, or transparency)

 o reset
 public final void reset()
Reset the 6 Colors components to all -128, and value to 0.

 o setRGB
 public final void setRGB(byte r,
                          byte g,
                          byte b)
Set colors given 3 bytes in the range [-128,127]

 o setRGB
 public final void setRGB(double r,
                          double g,
                          double b)
Set colors given 3 doubles in the range [0,1]

 o setHSB
 public final void setHSB(float h,
                          float s,
                          float b)
Set colors given 3 doubles (hue, saturation, brightness) in the range [0,1]

 o getHSB
 public final void getHSB(float hsb[])
Given an array of 3 doubles, changes them to be hue, saturation brightness in range [0,1].

 o 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]

 o 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]

 o 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