Class ContourPlot.BarycentricGradientPaint

java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.BarycentricGradientPaint
All Implemented Interfaces:
Paint, Transparency
Enclosing class:
ContourPlot

public class ContourPlot.BarycentricGradientPaint extends Object implements Paint
The BarycentricGradientPaint class provides a way to fill a Shape with a triangular color gradient. Colors are specified for the vertices of a triangle and interpolated within the triangle according to barycentric coordinates. Only areas of the filled shape that are intersecting with the triangle of this paint are colored.

This paint supports the ANTIALIASING rendering hint (RenderingHints) using a 4x multisampling approach. When enabled, the edges of the triangle will appear anti-aliased. It is recommended to disable AA when filling a triangle mesh (where triangles are adjacent), since otherwise triangle edges become visible.

Note that it is not necessary to use a triangular Shape to render a triangle. Instead a rectangle can be used as well, since only the intersecting area will be filled.

Author:
hageldave
  • Field Details

  • Constructor Details

    • BarycentricGradientPaint

      public BarycentricGradientPaint(Point2D p1, Point2D p2, Point2D p3, Color color1, Color color2, Color color3)
      Creates a new ContourPlot.BarycentricGradientPaint object with specified triangle vertices and vertex colors.
      Parameters:
      p1 - vertex of triangle
      p2 - vertex of triangle
      p3 - vertex of triangle
      color1 - color of vertex
      color2 - color of vertex
      color3 - color of vertex
    • BarycentricGradientPaint

      public BarycentricGradientPaint(float[] x, float[] y, Color color1, Color color2, Color color3)
      Creates a new ContourPlot.BarycentricGradientPaint object with specified triangle vertices and vertex colors.
      Parameters:
      x - x-coordinates for the triangle vertices
      y - y-coordinates for the triangle vertices
      color1 - color of vertex
      color2 - color of vertex
      color3 - color of vertex
    • BarycentricGradientPaint

      public BarycentricGradientPaint(double x1, double y1, double x2, double y2, double x3, double y3, Color color1, Color color2, Color color3)
      Creates a new ContourPlot.BarycentricGradientPaint object with specified triangle vertices and vertex colors.
      Parameters:
      x1 - x-coord of triangle vertex
      y1 - y-coord of triangle vertex
      x2 - x-coord of triangle vertex
      y2 - y-coord of triangle vertex
      x3 - x-coord of triangle vertex
      y3 - y-coord of triangle vertex
      color1 - color of vertex
      color2 - color of vertex
      color3 - color of vertex
    • BarycentricGradientPaint

      public BarycentricGradientPaint(float x1, float y1, float x2, float y2, float x3, float y3, Color color1, Color color2, Color color3)
      Creates a new ContourPlot.BarycentricGradientPaint object with specified triangle vertices and vertex colors.
      Parameters:
      x1 - x-coord of triangle vertex
      y1 - y-coord of triangle vertex
      x2 - x-coord of triangle vertex
      y2 - y-coord of triangle vertex
      x3 - x-coord of triangle vertex
      y3 - y-coord of triangle vertex
      color1 - color of vertex
      color2 - color of vertex
      color3 - color of vertex
  • Method Details