Class AbstractOpImpl

java.lang.Object
VASSAL.tools.opcache.AbstractOpImpl<BufferedImage>
VASSAL.tools.imageop.AbstractOpImpl
All Implemented Interfaces:
ImageOp, Op<BufferedImage>
Direct Known Subclasses:
AbstractTiledOpImpl, AbstractTileOpImpl

public abstract class AbstractOpImpl extends AbstractOpImpl<BufferedImage> implements ImageOp
An abstract representation of an operation which may be applied to an Image. ImageOp is the base class for all such operations. The results of all operations are memoized (using a memory-sensitive cache), so retrieving results is both fast and memory-efficient.

Warning: For efficiency reasons, the methods getImage() and getTile(java.awt.Point, VASSAL.tools.imageop.ImageOpObserver) do not return Images defensively, nor do the Future<Image>s returned by getFutureImage(VASSAL.tools.imageop.ImageOpObserver) and getFutureTile(java.awt.Point, VASSAL.tools.imageop.ImageOpObserver). That is, the Image returned is possibly the one retained internally by the ImageOp. Therefore, Images obtained from an ImageOp must not be altered, as this might interfere with image caching. If an Image obtained this way needs to be modified, copy the Image first and alter the copy.

Since:
3.1.0
Author:
Joel Uckelman