Class GlyphPaper
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.GlyphPaper
-
- All Implemented Interfaces:
Paper
public abstract class GlyphPaper extends java.lang.Object implements Paper
Translates Glyph paint operations into pixel iterators. This class provides an implementation of thePaper
interface which means it can be painted on by aShapePainter
. Concrete subclasses are handed a Pixer giving the pixels actually painted by each received glyph.- Since:
- 1 Oct 2015
- Author:
- Mark Taylor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
GlyphPaper.GlyphPaperType
Type of paper used by this object.
-
Constructor Summary
Constructors Constructor Description GlyphPaper(java.awt.Rectangle plotBounds)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canMerge()
Returns false.Paper
createSheet()
Returns a blank Paper instance that is compatible with this one.GlyphPaper.GlyphPaperType
getPaperType()
Returns a partial PaperType implementation to use with this object.abstract void
glyphPixels(Pixer pixer)
For each glyph painted on this paper, a pixer will be passed to this method that iterates over all the pixels within this paper's bounds.void
mergeSheet(Paper other)
Merges the contents of a compatible paper instance with this one.
-
-
-
Method Detail
-
glyphPixels
public abstract void glyphPixels(Pixer pixer)
For each glyph painted on this paper, a pixer will be passed to this method that iterates over all the pixels within this paper's bounds. The supplied pixer will not contain any pixels outside the plot bounds.- Parameters:
pixer
- pixel iterator
-
getPaperType
public GlyphPaper.GlyphPaperType getPaperType()
Returns a partial PaperType implementation to use with this object. The returned value is private to this paper instance.- Specified by:
getPaperType
in interfacePaper
- Returns:
- paper type
-
canMerge
public boolean canMerge()
Returns false. Use of this paper type is expected to be parallel already, so parallelising paint operations is not necessary.
-
createSheet
public Paper createSheet()
Description copied from interface:Paper
Returns a blank Paper instance that is compatible with this one. That essentially means an instance like this but with nothing yet painted on it.May only be invoked if
Paper.canMerge()
returns true.- Specified by:
createSheet
in interfacePaper
- Returns:
- new compatible paper instance
-
mergeSheet
public void mergeSheet(Paper other)
Description copied from interface:Paper
Merges the contents of a compatible paper instance with this one. The supplied sheet is assumed to have been created by an earlier invocation ofPaper.createSheet()
on this instance or on a compatible instance.The effect is as if everything that has been painted to the supplied sheet will now be painted on this one.
This is intended for use in parallelising painting of a large number of 2D or 3D
Glyph
s. Merging papers on whichDecal
s have been placed may or may not work.May only be invoked if
Paper.canMerge()
returns true.- Specified by:
mergeSheet
in interfacePaper
- Parameters:
other
- compatible paper instance
-
-