# Class LayerOpt

java.lang.Object
uk.ac.starlink.ttools.plot2.LayerOpt

@Equality public class LayerOpt extends Object
Defines characteristics of a plot layer that may enable plotting optimisations.

Since:
  12 Feb 2013
Author:
  Mark Taylor

## Field Summary

Fields
Modifier and Type
Field
Description
`static LayerOpt`
`NO_SPECIAL`
Indicates layer with no known optimisation assumptions.
`static LayerOpt`
`OPAQUE`
Indicates opaque multicoloured layer.

## Constructor Summary

Constructors
Constructor
Description
`LayerOpt(Color singleColor, boolean opaque)`
Constructs a LayerOpt with explicit options.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`Color`
`getSingleColor()`
Returns a colour if the only painting done by this layer is in a single colour.
`int`
`hashCode()`
`boolean`
`isOpaque()`
Indicates whether it's safe to assume that all drawing is opaque.
`String`
`toString()`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### OPAQUE

public static LayerOpt OPAQUE
Indicates opaque multicoloured layer.

### NO_SPECIAL

public static LayerOpt NO_SPECIAL
Indicates layer with no known optimisation assumptions.

## Constructor Details

### LayerOpt

public LayerOpt(Color singleColor, boolean opaque)
Constructs a LayerOpt with explicit options.

Parameters:
  `singleColor` - colour if only one is used by the layer, else null
  `opaque` - true if only opaque pixels are generated by the layer

## Method Details

### getSingleColor

public Color getSingleColor()
Returns a colour if the only painting done by this layer is in a single colour. Different alphas are permitted, but not different RGB values.

Returns:
  single colour, or null

### isOpaque

public boolean isOpaque()
Indicates whether it's safe to assume that all drawing is opaque.

Returns:
  true if no transparency is used

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`