VolumeJ
Class VJAlphaColor

java.lang.Object
  |
  +--VolumeJ.VJAlphaColor

public class VJAlphaColor
extends java.lang.Object

This class is the abstract type for an alphacolor, i.e. the combination of an RGB color and associated alpha (transparency). It has methods for composing colors. (c) 1999-2002 Michael Abramoff. All rights reserved.


Field Summary
 float alpha
           
 float b
           
 float g
           
 float r
           
 
Constructor Summary
VJAlphaColor()
           
VJAlphaColor(float grayvalue)
          Use as a grayscale value container.
VJAlphaColor(float alpha, float r, float g, float b)
          An alpha-grayscale value for float RGB values.
VJAlphaColor(float alpha, int grayvalue)
          Use as an alpha-grayscale value container.
VJAlphaColor(float alpha, int r, int g, int b)
          An alpha-grayscale value.
VJAlphaColor(int grayvalue)
          Use as a grayscale value container.
 
Method Summary
 boolean almostOpaque()
          Return whether this alphacolor is almost opaque.
 void attenuate(VJShade shade)
           
 void blendComposeScalar(VJAlphaColor color, VJShade shade)
          Composing.
 void compose(VJAlphaColor color, float contribution)
          Additive color mixing.
 void compose(VJAlphaColor color, VJShade shade, float contribution)
          Additive shading and color mixing.
 void copy(VJAlphaColor ac)
          Make a copy of this VJAlphaColor.
 float getAlpha()
           
 int getBlue()
           
 int getGreen()
           
 int getRed()
           
 int getValue()
           
 boolean isGrayscale()
           
 boolean notOpaque()
           
 void setAlpha(float alpha)
           
 void setOpaque()
           
 java.lang.String toString()
           
 boolean visible()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

alpha

public float alpha

r

public float r

g

public float g

b

public float b
Constructor Detail

VJAlphaColor

public VJAlphaColor()

VJAlphaColor

public VJAlphaColor(float alpha,
                    int grayvalue)
Use as an alpha-grayscale value container.
Parameters:
alpha: - the transparency [0-1]
grayvalue: - the grayscale value (integer).

VJAlphaColor

public VJAlphaColor(int grayvalue)
Use as a grayscale value container.
Parameters:
grayvalue: - the grayscale value (integer).

VJAlphaColor

public VJAlphaColor(float grayvalue)
Use as a grayscale value container.
Parameters:
grayvalue: - the grayscale value (integer).

VJAlphaColor

public VJAlphaColor(float alpha,
                    int r,
                    int g,
                    int b)
An alpha-grayscale value.
Parameters:
alpha: - the transparency [0-1]
r, - g, b: the RGB components [0-255] in int format.

VJAlphaColor

public VJAlphaColor(float alpha,
                    float r,
                    float g,
                    float b)
An alpha-grayscale value for float RGB values.
Parameters:
alpha: - the transparency [0-1]
r, - g, b: the RGB components [0-1] in float format.
Method Detail

getAlpha

public float getAlpha()

getRed

public int getRed()

getGreen

public int getGreen()

getBlue

public int getBlue()

getValue

public int getValue()

isGrayscale

public boolean isGrayscale()

compose

public void compose(VJAlphaColor color,
                    float contribution)
Additive color mixing. Compose this alphacolor with a fraction of color.
Parameters:
color: - the color to be composed (added) this alphacolor.
contribution: - the fraction of the components of color that are added.

blendComposeScalar

public void blendComposeScalar(VJAlphaColor color,
                               VJShade shade)
Composing. Compose the classified voxel color into pixel, combining with shade and gradient. The color value is attenuated with the shade. Update the alpha value for pixel. Front to back alpha blending compositing. White lights only!
Parameters:
g - the interpolated gradient for shading
color - contains the alpha value and the color (grayscale or RGB) of the classified values.
shade - is the effect of shading.

compose

public void compose(VJAlphaColor color,
                    VJShade shade,
                    float contribution)
Additive shading and color mixing. Compose this alphacolor with a shaded fraction of color.
Parameters:
color: - the color to be composed (added) this alphacolor.
shade: - the shade with which the fraction of color is shaded before adding.
contribution: - the fraction of the components of color that are added.

visible

public boolean visible()

notOpaque

public boolean notOpaque()

setOpaque

public void setOpaque()

copy

public void copy(VJAlphaColor ac)
Make a copy of this VJAlphaColor.

setAlpha

public void setAlpha(float alpha)

almostOpaque

public boolean almostOpaque()
Return whether this alphacolor is almost opaque.

attenuate

public void attenuate(VJShade shade)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object