Package it.tidalwave.image
Class ImageModel
- java.lang.Object
-
- it.tidalwave.image.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 Summary
Fields Modifier and Type Field Description protected java.lang.Object
model
-
Constructor Summary
Constructors Constructor Description ImageModel()
Default constructor for serialization.ImageModel(java.lang.Object model)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description 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).void
dispose()
boolean
equals(java.lang.Object object)
protected void
finalize()
abstract int
getBandCount()
abstract java.awt.image.ColorModel
getColorModel()
abstract EditableImage.DataType
getDataType()
abstract ImplementationFactory
getFactory()
abstract int
getHeight()
java.io.Serializable
getId()
java.lang.Object
getImage()
abstract <T> T
getInnerProperty(java.lang.Class<T> propertyClass)
long
getMemorySize()
Returns an estimate of the memory allocated by this image.java.lang.String
getNickName()
abstract int
getWidth()
int
hashCode()
void
readExternal(java.io.ObjectInput in)
protected void
readRaster(java.io.InputStream in)
TODO: check performancevoid
setImage(java.lang.Object image)
void
setNickName(java.lang.String nickName)
protected abstract java.lang.Object
toObjectForDeserialization(java.awt.image.RenderedImage renderedImage)
protected abstract java.awt.image.RenderedImage
toRenderedImageForSerialization()
java.lang.String
toString()
void
writeExternal(java.io.ObjectOutput out)
protected void
writeRaster(java.io.OutputStream out)
TODO: check performance
-
-
-
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 classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.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()
-
getDataType
public abstract EditableImage.DataType getDataType()
-
getBandCount
public abstract int getBandCount()
-
getFactory
public abstract ImplementationFactory getFactory()
-
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 interfacejava.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 interfacejava.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 classjava.lang.Object
-
finalize
protected void finalize()
- Overrides:
finalize
in classjava.lang.Object
-
-