# Class GraphicsGlyph

java.lang.Object
uk.ac.starlink.ttools.plot2.layer.GraphicsGlyph

All Implemented Interfaces:
  `Glyph`

public abstract class GraphicsGlyph extends Object implements Glyph
Glyph implementation whose Pixer is generated by drawing onto a bitmap. This provides an easy way to generate a Glyph, but the Pixer implementation is typically inefficient, since it needs first to paint to, and then to interrogate, a BufferedImage (GreyImage).

Since:
  27 Jan 2021
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`GraphicsGlyph(Rectangle bounds)`
Constructs a GraphicsGlyph that may cover pixels within a given bounding rectangle.

## Method Summary

Modifier and Type
Method
Description
`Pixer`
`createPixer(Rectangle clip)`
Returns an iterator over pixel offsets for this glyph's shape, considered to be at the origin.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface Glyph

`paintGlyph`

## Constructor Details

### GraphicsGlyph

public GraphicsGlyph(Rectangle bounds)
Constructs a GraphicsGlyph that may cover pixels within a given bounding rectangle. For reasons of efficiency, the extent of this rectangle should be kept as small as possible based on knowledge of the size of the output painting and the eventual visible region.

Parameters:
  `bounds` - maximum extent of the image that this glyph covers

## Method Details

### createPixer

public Pixer createPixer(Rectangle clip)
Description copied from interface: `Glyph`
Returns an iterator over pixel offsets for this glyph's shape, considered to be at the origin. Typically this means the pixel collection is centred at that point. The returned iterator must not include any points outside of the given clip rectangle. A null return indicates that no pixels fall within the given clip.

Specified by:
  `createPixer` in interface `Glyph`
Parameters:
  `clip` - clip rectangle
Returns:
  pixel iterator for the intersection of this glyph's shape and the given clip, or null for no pixels