org.havi.ui
Class HImageMatte

java.lang.Object
  extended by org.havi.ui.HImageMatte
All Implemented Interfaces:
HMatte

public class HImageMatte
extends java.lang.Object
implements HMatte

The HImageMatte class represents a matte that varies over space but is constant over time, it can be specified by an "image mask" (a single channel image) where the pixels indicate matte transparency.


The parameters to the constructors are as follows, in cases where parameters are not used, then the constructor should use the default values.

Default parameter values exposed in the constructors

ParameterDescriptionDefault value Set methodGet method
data The transparency value for this image matte. null (the matte should be treated as being spatially unvarying and opaque) setMatteData(java.awt.Image) getMatteData()

Default parameter values not exposed in the constructors

DescriptionDefault valueSet method Get method
The pixel offset for the image matte, relative to the top, left corner of its associated component. A java.awt.Point (0, 0) setOffset(java.awt.Point) getOffset()


Constructor Summary
HImageMatte()
          Creates an HImageMatte object.
HImageMatte(java.awt.Image data)
          Creates an HImageMatte object.
 
Method Summary
 java.awt.Image getMatteData()
          Returns the data used for this matte.
 java.awt.Point getOffset()
          Get the offset of the matte relative to its component in pixels.
 void setMatteData(java.awt.Image data)
          Sets the data for this matte.
 void setOffset(java.awt.Point p)
          Set the offset of the matte relative to its component in pixels.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HImageMatte

public HImageMatte()
Creates an HImageMatte object. See the class description for details of constructor parameters and default values.


HImageMatte

public HImageMatte(java.awt.Image data)
Creates an HImageMatte object. See the class description for details of constructor parameters and default values.

Method Detail

setMatteData

public void setMatteData(java.awt.Image data)
Sets the data for this matte. Any previously set data is replaced.

Note that if the size of the image is smaller than the size of the component to which the matte is applied, the empty space behaves as if it were an opaque flat matte of value 1.0. By default images are aligned at the top left corner of the component. This can be changed with the setOffset method.

Parameters:
data - the data for this matte. Specify a null object to remove the associated data for this matte.

getMatteData

public java.awt.Image getMatteData()
Returns the data used for this matte.

Returns:
the data used for this matte (an image) or null if no matte data has been set.

setOffset

public void setOffset(java.awt.Point p)
Set the offset of the matte relative to its component in pixels.

Parameters:
p - the offset of the matte relative to its component in pixels. If p is null a NullPointerException is thrown.

getOffset

public java.awt.Point getOffset()
Get the offset of the matte relative to its component in pixels.

Returns:
the offset of the specified frame of the matte relative to its component in pixels (as a Point)