Documentation of 'ec.app.mona.Picture' Java class
Picture
ec.app.mona

Class Picture

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class Picture
    extends java.lang.Object
    implements java.lang.Cloneable, java.io.Serializable
    Picture contains two images: an ORIGINAL image which is loaded from a file, and writable IMAGE, which you scribble on and try to make as similar to the ORIGINAL.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      java.awt.Graphics graphics 
      java.awt.image.BufferedImage image 
      java.awt.image.BufferedImage original 
    • Constructor Summary

      Constructors 
      Constructor and Description
      Picture() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addPolygon(double[] vals, int offset, int numVertices)
      Adds a polygon with the given colors.
      void clear()
      Erases the image.
      java.lang.Object clone() 
      java.awt.image.BufferedImage copyImage(java.awt.image.BufferedImage image) 
      void display(java.lang.String title)
      For debugging only.
      void disposeGraphics() 
      double error()
      Computes the sum squared error between the image and the original.
      void load(java.io.File file)
      Loads the original and creates a new blank image to scribble on, and a new graphics object.
      void save(java.io.File file)
      Saves the image (not the original) out to a PNG file so you can compare.
      • Methods inherited from class java.lang.Object

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

      • original

        public java.awt.image.BufferedImage original
      • image

        public java.awt.image.BufferedImage image
      • graphics

        public java.awt.Graphics graphics
    • Constructor Detail

      • Picture

        public Picture()
    • Method Detail

      • disposeGraphics

        public void disposeGraphics()
      • addPolygon

        public void addPolygon(double[] vals,
                               int offset,
                               int numVertices)
        Adds a polygon with the given colors. ALL double values passed in must be 0.0 ... 1.0. The values are taken starting at vals[offset]. The first four values are colors and alpha. The remaining values are the x and y values of the polygon vertices. You must call graphics.dispose() after you're done with all your polygon-drawing.
      • clear

        public void clear()
        Erases the image.
      • error

        public double error()
        Computes the sum squared error between the image and the original. This is defined as the sum, for all pixels, and for all three colors in the pixel, of the squared difference between the images with regard to that color on that pixel. Error goes from 0 to 1.
      • load

        public void load(java.io.File file)
        Loads the original and creates a new blank image to scribble on, and a new graphics object.
      • display

        public void display(java.lang.String title)
        For debugging only.
      • save

        public void save(java.io.File file)
        Saves the image (not the original) out to a PNG file so you can compare.
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object
      • copyImage

        public java.awt.image.BufferedImage copyImage(java.awt.image.BufferedImage image)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.