Package VASSAL.tools.imageop
Class SourceOpDiskCacheBitmapImpl
java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
VASSAL.tools.imageop.AbstractTileOpImpl
VASSAL.tools.imageop.SourceOpDiskCacheBitmapImpl
- All Implemented Interfaces:
ImageOp
,SourceOp
,Op<BufferedImage>
An
ImageOp
which loads tiles from the tile cache.- Since:
- 3.2.0
- Author:
- Joel Uckelman
-
Field Summary
Modifier and TypeFieldDescriptionprotected final int
The cached hash code of this object.protected final String
The name of the image file.protected double
protected final ImageTileSource
protected final int
protected final int
Fields inherited from class VASSAL.tools.imageop.AbstractOpImpl
cache, size
-
Constructor Summary
ConstructorDescriptionSourceOpDiskCacheBitmapImpl
(String name, int tileX, int tileY, double scale) Constructs anImageOp
which will load the given file.SourceOpDiskCacheBitmapImpl
(String name, int tileX, int tileY, double scale, ImageTileSource tileSrc) -
Method Summary
Modifier and TypeMethodDescriptionboolean
eval()
Runs theOp
.protected void
fixSize()
Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.protected Dimension
getName()
Returns the name of the image whichAbstractOpImpl.getImage()
will produce.Returns a list ofOp
s on which thisOp
depends.int
hashCode()
toString()
Methods inherited from class VASSAL.tools.imageop.AbstractTileOpImpl
getFutureTile, getNumXTiles, getNumYTiles, getTile, getTileHeight, getTileIndices, getTileOp, getTileSize, getTileWidth
Methods inherited from class VASSAL.tools.imageop.AbstractOpImpl
clearCache, getFutureImage, getFutureTile, getHeight, getImage, getImage, getSize, getSizeFromCache, getTile, getTileOp, getWidth
Methods inherited from class VASSAL.tools.opcache.AbstractOpImpl
get, get, getFuture, newKey, update
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface VASSAL.tools.imageop.ImageOp
getFutureImage, getFutureTile, getFutureTile, getHeight, getImage, getImage, getNumXTiles, getNumYTiles, getSize, getTile, getTile, getTileHeight, getTileIndices, getTileOp, getTileOp, getTileSize, getTileWidth, getWidth
-
Field Details
-
name
The name of the image file. -
hash
protected final int hashThe cached hash code of this object. -
tileX
protected final int tileX -
tileY
protected final int tileY -
scale
protected double scale -
tileSrc
-
-
Constructor Details
-
SourceOpDiskCacheBitmapImpl
Constructs anImageOp
which will load the given file.- Parameters:
name
- the name of the image to load- Throws:
IllegalArgumentException
- ifname
isnull
.
-
SourceOpDiskCacheBitmapImpl
public SourceOpDiskCacheBitmapImpl(String name, int tileX, int tileY, double scale, ImageTileSource tileSrc)
-
-
Method Details
-
getSources
Description copied from class:AbstractOpImpl
Returns a list ofOp
s on which thisOp
depends.- Specified by:
getSources
in interfaceOp<BufferedImage>
- Specified by:
getSources
in classAbstractOpImpl<BufferedImage>
- Returns:
- the
Op
s on which thisOp
depends
-
eval
Runs theOp
. This method should be called only by the caching framework.- Specified by:
eval
in interfaceImageOp
- Specified by:
eval
in interfaceOp<BufferedImage>
- Specified by:
eval
in classAbstractOpImpl
- Returns:
- the result of running this
Op
- Throws:
IOException
- if the image cannot be loaded from the image file.ImageIOException
-
fixSize
protected void fixSize()Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.- Specified by:
fixSize
in classAbstractOpImpl
-
getImageSize
-
getName
Returns the name of the image whichAbstractOpImpl.getImage()
will produce.- Specified by:
getName
in interfaceSourceOp
- Returns:
- the name of the image in the
DataArchive
.
-
equals
-
hashCode
-
toString
-