Class ShaderType2.Type2PaintContext

  • All Implemented Interfaces:
    java.awt.PaintContext
    Enclosing class:
    ShaderType2

    class ShaderType2.Type2PaintContext
    extends java.lang.Object
    implements java.awt.PaintContext
    A simple paint context that uses an existing raster in device space to generate pixels
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.image.ColorModel colorModel
      the color model
      private java.awt.geom.Point2D end
      the end of the axis
      private java.awt.geom.Point2D start
      the start of the axis
    • Constructor Summary

      Constructors 
      Constructor Description
      Type2PaintContext​(java.awt.image.ColorModel colorModel, java.awt.geom.Point2D start, java.awt.geom.Point2D end)
      Create a paint context
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()  
      java.awt.image.ColorModel getColorModel()  
      java.awt.image.Raster getRaster​(int x, int y, int w, int h)  
      private float getT​(float xp)
      t = t0 + (t1 - t0) x x'
      private float getXPrime​(float x, float y, float x0, float y0, float x1, float y1)
      x' = (x1 - x0) * (x - x0) + (y1 - y0) * (y - y0) ------------------------------------------- (x1 - x0)^2 + (y1 - y0)^2
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • colorModel

        private java.awt.image.ColorModel colorModel
        the color model
      • start

        private java.awt.geom.Point2D start
        the start of the axis
      • end

        private java.awt.geom.Point2D end
        the end of the axis
    • Constructor Detail

      • Type2PaintContext

        Type2PaintContext​(java.awt.image.ColorModel colorModel,
                          java.awt.geom.Point2D start,
                          java.awt.geom.Point2D end)
        Create a paint context
    • Method Detail

      • dispose

        public void dispose()
        Specified by:
        dispose in interface java.awt.PaintContext
      • getColorModel

        public java.awt.image.ColorModel getColorModel()
        Specified by:
        getColorModel in interface java.awt.PaintContext
      • getRaster

        public java.awt.image.Raster getRaster​(int x,
                                               int y,
                                               int w,
                                               int h)
        Specified by:
        getRaster in interface java.awt.PaintContext
      • getXPrime

        private float getXPrime​(float x,
                                float y,
                                float x0,
                                float y0,
                                float x1,
                                float y1)
        x' = (x1 - x0) * (x - x0) + (y1 - y0) * (y - y0) ------------------------------------------- (x1 - x0)^2 + (y1 - y0)^2
      • getT

        private float getT​(float xp)
        t = t0 + (t1 - t0) x x'