HImageMatte

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.havi.ui
Class HImageMatte

    java.lang.Object
      org.havi.ui.HImageMatte

All Implemented Interfaces:
  HMatte

    public class HImageMatte

extends 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

Parameter | Description | Default value | Set method | Get 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

Description | Default value | Set 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(Image data)` Creates an `HImageMatte` object.

Method Summary
`Image` | `getMatteData()` Returns the data used for this matte.
`Point` | `getOffset()` Get the offset of the matte relative to its component in pixels.
`void` | `setMatteData(Image data)` Sets the data for this matte.
`void` | `setOffset(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(Image data)

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

Method Detail

### setMatteData

    public void setMatteData(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 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(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 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)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD