Class OpacityTransform
- java.lang.Object
-
- uk.ac.rdg.resc.edal.graphics.style.Drawable
-
- uk.ac.rdg.resc.edal.graphics.style.ImageLayer
-
- uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
-
- uk.ac.rdg.resc.edal.graphics.style.OpacityTransform
-
- Direct Known Subclasses:
FlatOpacity,OpacityMap
public abstract class OpacityTransform extends GriddedImageLayer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
GriddedImageLayer.MapFeatureDataReader
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.ImageLayer
ImageLayer.MetadataFilter
-
Nested classes/interfaces inherited from class uk.ac.rdg.resc.edal.graphics.style.Drawable
Drawable.NameAndRange
-
-
Constructor Summary
Constructors Constructor Description OpacityTransform()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidapplyOpacityToImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader)protected intblendPixel(int original, int alpha)Applies an alpha value to a pixel.protected voiddrawIntoImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader)Draws the data into the supplied image.-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.GriddedImageLayer
drawIntoImage, supportedFeatureTypes
-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.ImageLayer
drawImage, getMetadataFilter
-
Methods inherited from class uk.ac.rdg.resc.edal.graphics.style.Drawable
getFieldsWithScales, getOpacityTransform, setOpacityTransform
-
-
-
-
Method Detail
-
applyOpacityToImage
protected abstract void applyOpacityToImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader) throws EdalException
- Throws:
EdalException
-
drawIntoImage
protected final void drawIntoImage(BufferedImage image, GriddedImageLayer.MapFeatureDataReader dataReader) throws EdalException
Description copied from class:GriddedImageLayerDraws the data into the supplied image.- Specified by:
drawIntoImagein classGriddedImageLayer- Parameters:
image- ABufferedImageto draw intodataReader- AGriddedImageLayer.MapFeatureDataReaderwhich is used to obtain the actual data values and domain. TheMapDomainreturned will match the size of the image, and pixels are georeferenced to the GridCell2Ds which comprise the domain- Throws:
EdalException- If there is a problem reading the data or drawing into the image
-
blendPixel
protected int blendPixel(int original, int alpha)Applies an alpha value to a pixel.- Parameters:
original- The original pixel valuealpha- An alpha value (0-255)- Returns:
- The alpha-blended pixel
-
-