Package it.tidalwave.image.java2d
Class ImageModelJ2D
- java.lang.Object
-
- it.tidalwave.image.ImageModel
-
- it.tidalwave.image.java2d.ImageModelJ2D
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
public class ImageModelJ2D extends ImageModel
An opaque class which encapsulates all the image manipulation logics, and allows the implementation of these logics to be transparently changed (e.g. by using or not JAI, etc...)- Author:
- Fabrizio Giudici
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class it.tidalwave.image.ImageModel
model
-
-
Constructor Summary
Constructors Constructor Description ImageModelJ2D(java.lang.Object bufferedImage)
Creates a new EditableImage given a BufferedImage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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).static EditableImage
createImage(java.awt.image.BufferedImage bufferedImage)
int
getBandCount()
java.awt.image.ColorModel
getColorModel()
EditableImage.DataType
getDataType()
ImplementationFactory
getFactory()
int
getHeight()
<T> T
getInnerProperty(java.lang.Class<T> propertyClass)
long
getMemorySize()
Returns an estimate of the memory allocated by this image.int
getWidth()
protected java.lang.Object
toObjectForDeserialization(java.awt.image.RenderedImage renderedImage)
protected java.awt.image.RenderedImage
toRenderedImageForSerialization()
-
Methods inherited from class it.tidalwave.image.ImageModel
dispose, equals, finalize, getId, getImage, getNickName, hashCode, readExternal, readRaster, setImage, setNickName, toString, writeExternal, writeRaster
-
-
-
-
Method Detail
-
getFactory
@Nonnull public ImplementationFactory getFactory()
- Specified by:
getFactory
in classImageModel
-
createImage
@Nonnull public static EditableImage createImage(@Nonnull java.awt.image.BufferedImage bufferedImage)
-
getWidth
@Nonnegative public int getWidth()
- Specified by:
getWidth
in classImageModel
-
getHeight
@Nonnegative public int getHeight()
- Specified by:
getHeight
in classImageModel
-
getDataType
@Nonnull public EditableImage.DataType getDataType()
- Specified by:
getDataType
in classImageModel
-
getBandCount
@Nonnegative public int getBandCount()
- Specified by:
getBandCount
in classImageModel
-
getColorModel
@Nonnull public java.awt.image.ColorModel getColorModel()
- Specified by:
getColorModel
in classImageModel
-
getMemorySize
@Nonnegative 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.- Overrides:
getMemorySize
in classImageModel
- Returns:
- the memory allocated for this image
-
createCopy
@Nonnull public 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).- Specified by:
createCopy
in classImageModel
- Returns:
- a new, similar image
-
getInnerProperty
@Nonnull public <T> T getInnerProperty(@Nonnull java.lang.Class<T> propertyClass)
- Specified by:
getInnerProperty
in classImageModel
-
toRenderedImageForSerialization
@Nonnull protected java.awt.image.RenderedImage toRenderedImageForSerialization()
- Specified by:
toRenderedImageForSerialization
in classImageModel
-
toObjectForDeserialization
@Nonnull protected java.lang.Object toObjectForDeserialization(@Nonnull java.awt.image.RenderedImage renderedImage)
- Specified by:
toObjectForDeserialization
in classImageModel
-
-