Class ContourPlot.BarycentricGradientPaintContext

java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.BarycentricGradientPaintContext
All Implemented Interfaces:
PaintContext
Enclosing class:
ContourPlot

public class ContourPlot.BarycentricGradientPaintContext extends Object implements PaintContext
This class is implements the PaintContext for ContourPlot.BarycentricGradientPaint.

The context operates solely in ARGB color space (blue on least significant bits) with an integer packing DirectColorModel.

A cache for raster memory is implemented to avoid costly memory allocations.

Author:
hageldave
  • Field Details

    • MSAA_SAMPLES

      protected final float[] MSAA_SAMPLES
    • x1

      protected final float x1
    • x2

      protected final float x2
    • x3

      protected final float x3
    • y1

      protected final float y1
    • y2

      protected final float y2
    • y3

      protected final float y3
    • x23

      protected final float x23
    • x13

      protected final float x13
    • y23

      protected final float y23
    • y13

      protected final float y13
    • denom

      protected final float denom
    • c1

      protected final int c1
    • c2

      protected final int c2
    • c3

      protected final int c3
    • cm

      protected final DirectColorModel cm
    • antialiasing

      protected final boolean antialiasing
    • saved

      protected WritableRaster saved
    • cache

      protected WeakReference<int[]> cache
  • Constructor Details

  • Method Details

    • dispose

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

      public ColorModel getColorModel()
      Specified by:
      getColorModel in interface PaintContext
    • getRaster

      public Raster getRaster(int xA, int yA, int w, int h)
      Specified by:
      getRaster in interface PaintContext
    • fillRaster

      protected void fillRaster(int xA, int yA, int w, int h, int[] data)
    • fillRasterMSAA

      protected void fillRasterMSAA(int xA, int yA, int w, int h, int[] data)
    • getCachedOrCreateRaster

      protected WritableRaster getCachedOrCreateRaster(int w, int h)
    • cacheRaster

      protected void cacheRaster(WritableRaster ras)
    • createRaster

      protected WritableRaster createRaster(int w, int h, int[] data)
    • dataFromRaster

      private int[] dataFromRaster(WritableRaster wr)
    • mixColor3

      private int mixColor3(int c1, int c2, int c3, float m1, float m2, float m3)
    • mixColor4

      private int mixColor4(int c1, int c2, int c3, int c4, float m1, float m2, float m3, float m4)
    • a

      private int a(int argb)
    • r

      private int r(int argb)
    • g

      private int g(int argb)
    • b

      private int b(int argb)
    • argb

      private int argb(int a, int r, int g, int b)
    • scaleColorAlpha

      private int scaleColorAlpha(int color, float m)