Class MonoPaperType

java.lang.Object
uk.ac.starlink.ttools.plot2.paper.RgbPaperType
uk.ac.starlink.ttools.plot2.paper.MonoPaperType
All Implemented Interfaces:
PaperType, PaperType2D, PaperType3D

public class MonoPaperType extends RgbPaperType implements PaperType2D, PaperType3D
Bitmapped PaperType which can paint transparent or opaque pixels as long as they are all the same colour. That means all painted glyphs and decals must have the same RGB (as specified at construction time), though they may have different alphas.

Since the compositing is pretty much the same (no attention needs to be paid to the depth coordinate) this class implements both the 2D and 3D PaperType interfaces.

Since:
14 Feb 2013
Author:
Mark Taylor
  • Constructor Details

    • MonoPaperType

      public MonoPaperType(Color color, Compositor compositor)
      Constructor.
      Parameters:
      color - single RGB colour for all drawing (alpha component is ignored)
      compositor - compositing strategy for translating alphas to displayed colours
  • Method Details

    • createPaper

      protected RgbPaperType.RgbPaper createPaper(Rectangle bounds)
      Description copied from class: RgbPaperType
      Creates a paper object for given bounds.
      Specified by:
      createPaper in class RgbPaperType
      Parameters:
      bounds - plot bounds
      Returns:
      new paper instance
    • placeGlyph

      public void placeGlyph(Paper paper, double dx, double dy, Glyph glyph, Color color)
      Description copied from interface: PaperType2D
      Places a glyph at a 2-d position on the paper.
      Specified by:
      placeGlyph in interface PaperType2D
      Parameters:
      paper - graphics destination specific to this PaperType
      dx - X coordinate
      dy - Y coordinate
      glyph - graphics shape
      color - colour for glyph
    • placeGlyph

      public void placeGlyph(Paper paper, double dx, double dy, double dz, Glyph glyph, Color color)
      Description copied from interface: PaperType3D
      Places a glyph at a 3-d position in the space.
      Specified by:
      placeGlyph in interface PaperType3D
      Parameters:
      paper - graphics destination specific to this PaperType
      dx - graphics X coordinate
      dy - graphics Y coordinate
      dz - Z-buffer coordinate; lower values are closer to the viewer
      glyph - graphics shape
      color - colour for glyph