Class FixedScaleOpBitmapImpl
java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
VASSAL.tools.imageop.AbstractTiledOpImpl
VASSAL.tools.imageop.FixedScaleOpBitmapImpl
- All Implemented Interfaces:
ImageOp, ScaleOp, Op<BufferedImage>
- Direct Known Subclasses:
FixedScaleOpTiledBitmapImpl
An
ImageOp which scales its source.- Since:
- 3.1.0
- Author:
- Joel Uckelman
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final RenderingHintsprotected final intprotected final RenderingHintsprotected final doubleprotected final ImageOpFields inherited from class AbstractTiledOpImpl
numXTiles, numYTiles, tiles, tileSize -
Constructor Summary
ConstructorsConstructorDescriptionFixedScaleOpBitmapImpl(ImageOp sop, double scale, int width, int height) Constructs anImageOpwhich will scale the image produced by its sourceImageOp.FixedScaleOpBitmapImpl(ImageOp sop, double scale, int width, int height, RenderingHints hints) Constructs anImageOpwhich will scale the image produced by its sourceImageOp. -
Method Summary
Modifier and TypeMethodDescriptionprotected ImageOpcreateTileOp(int tileX, int tileY) booleaneval()Runs theOp.protected voidfixSize()Sets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().getHints()doublegetScale()Returns the scale factor.Returns a list ofOps on which thisOpdepends.inthashCode()toString()Methods inherited from class AbstractTiledOpImpl
fixTileSize, getFutureTile, getNumXTiles, getNumYTiles, getTile, getTileHeight, getTileIndices, getTileOp, getTileSize, getTileWidthModifier and TypeMethodDescriptionprotected voidSets thetileSizewhich is used byAbstractTiledOpImpl.getTileSize(),AbstractTiledOpImpl.getTileHeight(),AbstractTiledOpImpl.getTileWidth(),AbstractTiledOpImpl.getNumXTiles(),AbstractTiledOpImpl.getNumYTiles(), and all other tile methods.getFutureTile(int tileX, int tileY, ImageOpObserver obs) Submits a request for tile(tileX,tileY), and returns a reference to that request.intReturns the number of tiles along the x-axis.intReturns the number of tiles along the y-axis.getTile(int tileX, int tileY, ImageOpObserver obs) Calculates tile(tileX,tileY), and reports completion or failure to the specifiedImageOpObserver.intReturns the standard height of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).Point[]getTileIndices(Rectangle rect) Returns an array ofPoints representing the tiles intersecting the givenRectangle.getTileOp(int tileX, int tileY) Returns theImageOpwhich produces tile(tileX,tileY), creating it if necessary.Returns the standard size of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).intReturns the standard width of theBufferedImagetiles which are returned byImageOp.getTile(Point, ImageOpObserver).Methods inherited from class AbstractOpImpl
clearCache, getFutureImage, getFutureTile, getHeight, getImage, getImage, getSize, getSizeFromCache, getTile, getTileOp, getWidthModifier and TypeMethodDescriptionstatic voidSubmits a request for theBufferedImageproduced by this operation, and returns a reference to that request.getFutureTile(Point p, ImageOpObserver obs) Submits a request for tile(tileX,tileY), and returns a reference to that request.intReturns the height of theBufferedImagewhich would be returned byImageOp.getImage().getImage()Calculates theBufferedImageproduced by this operation.getImage(ImageOpObserver obs) Calculates theBufferedImageproduced by this operation, and reports completion or failure to the specifiedImageOpObserver.getSize()Returns the size of theBufferedImagewhich would be returned byImageOp.getImage().protected DimensionA utility method for retrieving the size of the computedImagefrom the cache if theImageis cached.getTile(Point p, ImageOpObserver obs) Calculates tile(p.x,p.y), and reports completion or failure to the specifiedImageOpObserver.Returns anImageOpwhich can produce the requested tile.intgetWidth()Returns the width of theBufferedImagewhich would be returned byImageOp.getImage().Methods inherited from class AbstractOpImpl
get, get, getFuture, newKey, updateModifier and TypeMethodDescriptionget()get(OpObserver<BufferedImage> obs) getFuture(OpObserver<BufferedImage> obs) newKey()Returns the current cache key for thisOp.voidupdate()Invalidates the current cache key for thisOp.
-
Field Details
-
sop
-
hints
-
scale
protected final double scale -
hash
protected final int hash -
defaultHints
-
-
Constructor Details
-
FixedScaleOpBitmapImpl
Constructs anImageOpwhich will scale the image produced by its sourceImageOp.- Parameters:
sop- the source operationscale- the scale factor
-
FixedScaleOpBitmapImpl
public FixedScaleOpBitmapImpl(ImageOp sop, double scale, int width, int height, RenderingHints hints) Constructs anImageOpwhich will scale the image produced by its sourceImageOp.- Parameters:
sop- the source operationscale- the scale factorhints- rendering hints
-
-
Method Details
-
fixSize
protected void fixSize()Description copied from class:AbstractOpImplSets thesizewhich is used byAbstractOpImpl.getSize(),AbstractOpImpl.getHeight(), andAbstractOpImpl.getWidth().- Specified by:
fixSizein classAbstractOpImpl
-
getSources
Description copied from class:AbstractOpImplReturns a list ofOps on which thisOpdepends.- Specified by:
getSourcesin interfaceOp<BufferedImage>- Specified by:
getSourcesin classAbstractOpImpl<BufferedImage>- Returns:
- the
Ops on which thisOpdepends
-
eval
Runs theOp. This method should be called only by the caching framework.- Specified by:
evalin interfaceImageOp- Specified by:
evalin interfaceOp<BufferedImage>- Specified by:
evalin classAbstractOpImpl- Returns:
- the result of running this
Op - Throws:
Exception- passed up from the sourceImageOp.
-
createTileOp
- Specified by:
createTileOpin classAbstractTiledOpImpl
-
getHints
-
getScale
-
equals
-
hashCode
-
toString
-