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 EditableImagecreateCopy(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 EditableImagecreateImage(java.awt.image.BufferedImage bufferedImage)intgetBandCount()java.awt.image.ColorModelgetColorModel()EditableImage.DataTypegetDataType()ImplementationFactorygetFactory()intgetHeight()<T> TgetInnerProperty(java.lang.Class<T> propertyClass)longgetMemorySize()Returns an estimate of the memory allocated by this image.intgetWidth()protected java.lang.ObjecttoObjectForDeserialization(java.awt.image.RenderedImage renderedImage)protected java.awt.image.RenderedImagetoRenderedImageForSerialization()-
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:
getFactoryin classImageModel
-
createImage
@Nonnull public static EditableImage createImage(@Nonnull java.awt.image.BufferedImage bufferedImage)
-
getWidth
@Nonnegative public int getWidth()
- Specified by:
getWidthin classImageModel
-
getHeight
@Nonnegative public int getHeight()
- Specified by:
getHeightin classImageModel
-
getDataType
@Nonnull public EditableImage.DataType getDataType()
- Specified by:
getDataTypein classImageModel
-
getBandCount
@Nonnegative public int getBandCount()
- Specified by:
getBandCountin classImageModel
-
getColorModel
@Nonnull public java.awt.image.ColorModel getColorModel()
- Specified by:
getColorModelin 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:
getMemorySizein 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:
createCopyin classImageModel- Returns:
- a new, similar image
-
getInnerProperty
@Nonnull public <T> T getInnerProperty(@Nonnull java.lang.Class<T> propertyClass)- Specified by:
getInnerPropertyin classImageModel
-
toRenderedImageForSerialization
@Nonnull protected java.awt.image.RenderedImage toRenderedImageForSerialization()
- Specified by:
toRenderedImageForSerializationin classImageModel
-
toObjectForDeserialization
@Nonnull protected java.lang.Object toObjectForDeserialization(@Nonnull java.awt.image.RenderedImage renderedImage)- Specified by:
toObjectForDeserializationin classImageModel
-
-