Class DrawTools


  • public final class DrawTools
    extends java.lang.Object
    Author:
    Calixte DENIZET
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawTools()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void drawParallelogramTexture​(java.awt.Graphics2D g2d, java.awt.image.BufferedImage image, double[] ximg, double[] yimg, double[] xdest, double[] ydest, java.lang.Object key)
      Draw a texture (ie a BufferedImage) in a parallelogram
      static void drawTriangleTexture​(java.awt.Graphics2D g2d, java.awt.image.BufferedImage image, double[] ximg, double[] yimg, double[] xdest, double[] ydest, java.lang.Object key)
      Draw a texture (ie a BufferedImage) in a triangle
      static void fillGouraud​(java.awt.Graphics2D g2d, Triangle t)
      Fill a triangle in using a Gouraud shading Only two gradient are used rather than three.
      • Methods inherited from class java.lang.Object

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

      • DrawTools

        public DrawTools()
    • Method Detail

      • fillGouraud

        public static final void fillGouraud​(java.awt.Graphics2D g2d,
                                             Triangle t)
        Fill a triangle in using a Gouraud shading Only two gradient are used rather than three.
        Parameters:
        g2d - the Graphics2D where to draw
        t - the Triangle to fill
      • drawTriangleTexture

        public static final void drawTriangleTexture​(java.awt.Graphics2D g2d,
                                                     java.awt.image.BufferedImage image,
                                                     double[] ximg,
                                                     double[] yimg,
                                                     double[] xdest,
                                                     double[] ydest,
                                                     java.lang.Object key)
        Draw a texture (ie a BufferedImage) in a triangle
        Parameters:
        g2d - the Graphics2D where to draw
        image - the texture to apply
        ximg - the x-coordinates of the triangle to use in the texture
        yimg - the y-coordinates of the triangle to use in the texture
        xdest - the x-coordinates of the destination triangle
        ydest - the y-coordinates of the destination triangle
        key - the rendering hint to use for interpolation
      • drawParallelogramTexture

        public static final void drawParallelogramTexture​(java.awt.Graphics2D g2d,
                                                          java.awt.image.BufferedImage image,
                                                          double[] ximg,
                                                          double[] yimg,
                                                          double[] xdest,
                                                          double[] ydest,
                                                          java.lang.Object key)
        Draw a texture (ie a BufferedImage) in a parallelogram
        Parameters:
        g2d - the Graphics2D where to draw
        image - the texture to apply
        ximg - the x-coordinates of the parallelogram to use in the texture
        yimg - the y-coordinates of the parallelogram to use in the texture
        xdest - the x-coordinates of the destination parallelogram
        ydest - the y-coordinates of the destination parallelogram
        key - the rendering hint to use for interpolation