Class GraphicsGlyph

  • All Implemented Interfaces:
    Glyph

    public abstract class GraphicsGlyph
    extends java.lang.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​(java.awt.Rectangle bounds)
      Constructs a GraphicsGlyph that may cover pixels within a given bounding rectangle.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Pixer createPixer​(java.awt.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 Detail

      • GraphicsGlyph

        public GraphicsGlyph​(java.awt.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 Detail

      • createPixer

        public Pixer createPixer​(java.awt.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