Class GlyphPaper
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.GlyphPaper
- All Implemented Interfaces:
Paper
Translates Glyph paint operations into pixel iterators.
This class provides an implementation of the
Paper interface
which means it can be painted on by a ShapePainter.
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 ClassesModifier and TypeClassDescriptionstatic interfaceType of paper used by this object. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanMerge()Returns false.Returns a blank Paper instance that is compatible with this one.Returns a partial PaperType implementation to use with this object.abstract voidglyphPixels(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.voidmergeSheet(Paper other) Merges the contents of a compatible paper instance with this one.
-
Constructor Details
-
GlyphPaper
Constructor.- Parameters:
plotBounds- bounds within which all pixels must be contained
-
-
Method Details
-
glyphPixels
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
Returns a partial PaperType implementation to use with this object. The returned value is private to this paper instance.- Specified by:
getPaperTypein interfacePaper- Returns:
- paper type
-
canMerge
-
createSheet
Description copied from interface:PaperReturns 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:
createSheetin interfacePaper- Returns:
- new compatible paper instance
-
mergeSheet
Description copied from interface:PaperMerges 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
Glyphs. Merging papers on whichDecals have been placed may or may not work.May only be invoked if
Paper.canMerge()returns true.- Specified by:
mergeSheetin interfacePaper- Parameters:
other- compatible paper instance
-