Class GraphicsGlyph
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.GraphicsGlyph
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionGraphicsGlyph
(Rectangle bounds) Constructs a GraphicsGlyph that may cover pixels within a given bounding rectangle. -
Method Summary
Modifier and TypeMethodDescriptioncreatePixer
(Rectangle clip) Returns an iterator over pixel offsets for this glyph's shape, considered to be at the origin.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface uk.ac.starlink.ttools.plot2.Glyph
paintGlyph
-
Constructor Details
-
GraphicsGlyph
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
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 interfaceGlyph
- Parameters:
clip
- clip rectangle- Returns:
- pixel iterator for the intersection of this glyph's shape and the given clip, or null for no pixels
-