Package VASSAL.tools.imageop
Class ScaleOpBitmapImpl
java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
VASSAL.tools.imageop.AbstractTiledOpImpl
VASSAL.tools.imageop.ScaleOpBitmapImpl
- All Implemented Interfaces:
ImageOp
,ScaleOp
,Op<BufferedImage>
- Direct Known Subclasses:
ScaleOpTiledBitmapImpl
public class ScaleOpBitmapImpl extends AbstractTiledOpImpl implements ScaleOp
An
ImageOp
which scales its source.- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Field Summary
Fields Modifier and Type Field Description protected static RenderingHints
defaultHints
protected int
hash
protected RenderingHints
hints
protected double
scale
protected ImageOp
sop
Fields inherited from class VASSAL.tools.imageop.AbstractTiledOpImpl
numXTiles, numYTiles, tiles, tileSize
Fields inherited from class VASSAL.tools.imageop.AbstractOpImpl
cache, size
-
Constructor Summary
Constructors Constructor Description ScaleOpBitmapImpl(ImageOp sop, double scale)
Constructs anImageOp
which will scale the image produced by its sourceImageOp
.ScaleOpBitmapImpl(ImageOp sop, double scale, RenderingHints hints)
Constructs anImageOp
which will scale the image produced by its sourceImageOp
. -
Method Summary
Modifier and Type Method Description protected ImageOp
createTileOp(int tileX, int tileY)
boolean
equals(Object o)
BufferedImage
eval()
Runs theOp
.protected void
fixSize()
Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.RenderingHints
getHints()
double
getScale()
Returns the scale factor.List<Op<?>>
getSources()
Returns a list ofOp
s on which thisOp
depends.int
hashCode()
String
toString()
Methods inherited from class VASSAL.tools.imageop.AbstractTiledOpImpl
fixTileSize, 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
-
sop
-
scale
protected final double scale -
hints
-
hash
protected final int hash -
defaultHints
-
-
Constructor Details
-
ScaleOpBitmapImpl
Constructs anImageOp
which will scale the image produced by its sourceImageOp
.- Parameters:
sop
- the source operationscale
- the scale factor
-
ScaleOpBitmapImpl
Constructs anImageOp
which will scale the image produced by its sourceImageOp
.- Parameters:
sop
- the source operationscale
- the scale factorhints
- rendering hints
-
-
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:
Exception
- passed up from the sourceImageOp
.
-
fixSize
protected void fixSize()Sets thesize
which is used byAbstractOpImpl.getSize()
,AbstractOpImpl.getHeight()
, andAbstractOpImpl.getWidth()
.- Specified by:
fixSize
in classAbstractOpImpl
-
createTileOp
- Specified by:
createTileOp
in classAbstractTiledOpImpl
-
getHints
-
getScale
public double getScale()Returns the scale factor. -
equals
-
hashCode
public int hashCode() -
toString
-