Class ImageModel

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable
    Direct Known Subclasses:
    ImageModelJ2D

    public abstract class ImageModel
    extends java.lang.Object
    implements java.io.Externalizable
    Author:
    Fabrizio Giudici
    See Also:
    Serialized Form
    • Field Detail

      • model

        protected transient java.lang.Object model
    • Constructor Detail

      • ImageModel

        public ImageModel()
        Default constructor for serialization. DO NOT CALL.
      • ImageModel

        public ImageModel​(java.lang.Object model)
    • Method Detail

      • dispose

        public void dispose()
      • getId

        public final java.io.Serializable getId()
      • setNickName

        public void setNickName​(java.lang.String nickName)
      • getNickName

        public java.lang.String getNickName()
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public final boolean equals​(java.lang.Object object)
        Overrides:
        equals in class java.lang.Object
      • setImage

        public void setImage​(java.lang.Object image)
      • getImage

        public final java.lang.Object getImage()
      • getWidth

        public abstract int getWidth()
      • getHeight

        public abstract int getHeight()
      • getBandCount

        public abstract int getBandCount()
      • getColorModel

        public abstract java.awt.image.ColorModel getColorModel()
      • createCopy

        public abstract EditableImage createCopy​(boolean copyContents)
        Creates a similar image, that is a blank image with the same characteristics of this image (width, height, data type, sample model, color model).
        Returns:
        a new, similar image
      • getInnerProperty

        public abstract <T> T getInnerProperty​(java.lang.Class<T> propertyClass)
      • getMemorySize

        public long getMemorySize()
        Returns an estimate of the memory allocated by this image. The default implementation returns the number of pixels multiplied by the number of bands multiplied the size in bytes of each pixel. Can be overridden for more accurate implementations.
        Returns:
        the memory allocated for this image
      • writeExternal

        public final void writeExternal​(java.io.ObjectOutput out)
                                 throws java.io.IOException
        Specified by:
        writeExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
      • readExternal

        public final void readExternal​(java.io.ObjectInput in)
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
        Specified by:
        readExternal in interface java.io.Externalizable
        Throws:
        java.io.IOException
        java.lang.ClassNotFoundException
      • toRenderedImageForSerialization

        protected abstract java.awt.image.RenderedImage toRenderedImageForSerialization()
      • toObjectForDeserialization

        protected abstract java.lang.Object toObjectForDeserialization​(java.awt.image.RenderedImage renderedImage)
      • writeRaster

        protected void writeRaster​(java.io.OutputStream out)
                            throws java.io.IOException
        TODO: check performance
        Throws:
        java.io.IOException
      • readRaster

        protected void readRaster​(java.io.InputStream in)
                           throws java.io.IOException
        TODO: check performance
        Throws:
        java.io.IOException
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • finalize

        protected void finalize()
        Overrides:
        finalize in class java.lang.Object