Package gov.nih.mipav.model.algorithms
Class ContourPlot.BarycentricGradientPaintContext
java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.BarycentricGradientPaintContext
- All Implemented Interfaces:
PaintContext
- Enclosing class:
ContourPlot
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 Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final intprotected final intprotected final intprotected WeakReference<int[]> protected final DirectColorModelprotected final floatprotected final float[]protected WritableRasterprotected final floatprotected final floatprotected final floatprotected final floatprotected final floatprotected final floatprotected final floatprotected final floatprotected final floatprotected final float -
Constructor Summary
ConstructorsConstructorDescriptionBarycentricGradientPaintContext(Point2D.Float p1, Point2D.Float p2, Point2D.Float p3, Color color1, Color color2, Color color3, AffineTransform xform, boolean antialiasing) -
Method Summary
Modifier and TypeMethodDescriptionprivate inta(int argb) private intargb(int a, int r, int g, int b) private intb(int argb) protected voidprotected WritableRastercreateRaster(int w, int h, int[] data) private int[]voiddispose()protected voidfillRaster(int xA, int yA, int w, int h, int[] data) protected voidfillRasterMSAA(int xA, int yA, int w, int h, int[] data) private intg(int argb) protected WritableRastergetCachedOrCreateRaster(int w, int h) getRaster(int xA, int yA, int w, int h) private intmixColor3(int c1, int c2, int c3, float m1, float m2, float m3) private intmixColor4(int c1, int c2, int c3, int c4, float m1, float m2, float m3, float m4) private intr(int argb) private intscaleColorAlpha(int color, float m)
-
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
-
antialiasing
protected final boolean antialiasing -
saved
-
cache
-
-
Constructor Details
-
BarycentricGradientPaintContext
public BarycentricGradientPaintContext(Point2D.Float p1, Point2D.Float p2, Point2D.Float p3, Color color1, Color color2, Color color3, AffineTransform xform, boolean antialiasing)
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfacePaintContext
-
getColorModel
- Specified by:
getColorModelin interfacePaintContext
-
getRaster
- Specified by:
getRasterin interfacePaintContext
-
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
-
cacheRaster
-
createRaster
-
dataFromRaster
-
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)
-