Package org.apache.sis.image
Class BandSelectImage
java.lang.Object
org.apache.sis.image.PlanarImage
org.apache.sis.image.ComputedImage
org.apache.sis.image.SourceAlignedImage
org.apache.sis.image.BandSelectImage
- All Implemented Interfaces:
RenderedImage,Disposable
Selects or reorder bands from a source image. This operation avoid copying sample values;
it works by modifying the sample model and color model.
- Since:
- 1.1
- Version:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]The selected bands.Properties to inherit from the source image, after bands reduction if applicable.Fields inherited from class org.apache.sis.image.SourceAlignedImage
POSITIONAL_PROPERTIESFields inherited from class org.apache.sis.image.ComputedImage
sampleModel, SOURCE_PADDING_KEYFields inherited from class org.apache.sis.image.PlanarImage
GRID_GEOMETRY_KEY, MASK_KEY, POSITIONAL_ACCURACY_KEY, SAMPLE_RESOLUTIONS_KEY, STATISTICS_KEY -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBandSelectImage(RenderedImage source, ColorModel cm, int[] bands) Creates a new "band select" operation for the given source. -
Method Summary
Modifier and TypeMethodDescriptionprotected RastercomputeTile(int tileX, int tileY, WritableRaster previous) Creates a raster sharing the same data buffer than the source image but showing only a subset of the bands.(package private) static RenderedImagecreate(RenderedImage source, int[] bands) Creates a new "band select" operation for the given source.booleanCompares the given object with this image for equality.private static ObjectgetProperty(RenderedImage source, String key, int[] bands) Gets a property from the given image, reducing the number of dimensions if needed.getProperty(String key) Gets a property from this image.String[]Returns the names of all recognized properties, ornullif this image has no properties.inthashCode()Returns a hash code value for this image.Methods inherited from class org.apache.sis.image.SourceAlignedImage
filterPropertyNames, getColorModel, getHeight, getMinTileX, getMinTileY, getMinX, getMinY, getNumXTiles, getNumYTiles, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, getWidth, prefetchMethods inherited from class org.apache.sis.image.ComputedImage
clearErrorFlags, createTile, dispose, equalsBase, getDestination, getSampleModel, getSource, getSource, getSources, getTile, getWritableTileIndices, hashCodeBase, hasTileWriters, isTileWritable, markDirtyTiles, markTileWritable, reference, setDestination, sourceTileChanged
-
Field Details
-
INHERITED_PROPERTIES
Properties to inherit from the source image, after bands reduction if applicable.- See Also:
-
bands
private final int[] bandsThe selected bands.
-
-
Constructor Details
-
BandSelectImage
Creates a new "band select" operation for the given source. It is caller responsibility to verify the validity of givenbandsindices.- Parameters:
source- the image in which to select bands.cm- the color model to associate to this image.bands- the bands to select. Should be a clone of user-specified argument (this constructor retains the given array reference as-is, without cloning).
-
-
Method Details
-
create
Creates a new "band select" operation for the given source.- Parameters:
source- the image in which to select bands.bands- the bands to select.
-
getPropertyNames
Returns the names of all recognized properties, ornullif this image has no properties.- Specified by:
getPropertyNamesin interfaceRenderedImage- Overrides:
getPropertyNamesin classPlanarImage- Returns:
- names of all recognized properties, or
nullif none.
-
getProperty
Gets a property from this image.- Specified by:
getPropertyin interfaceRenderedImage- Overrides:
getPropertyin classPlanarImage- Parameters:
key- the name of the property to get.- Returns:
- the property value, or
Image.UndefinedPropertyif none.
-
getProperty
Gets a property from the given image, reducing the number of dimensions if needed. It is caller responsibility to verify that the given key is one of the keys enumerated inINHERITED_PROPERTIES. -
computeTile
Creates a raster sharing the same data buffer than the source image but showing only a subset of the bands.- Specified by:
computeTilein classComputedImage- Parameters:
tileX- the column index of the tile to compute.tileY- the row index of the tile to compute.previous- ignored.- Returns:
- computed tile for the given indices. May be the
previoustile after update but cannot be null.
-
hashCode
public int hashCode()Returns a hash code value for this image.- Overrides:
hashCodein classSourceAlignedImage
-
equals
Compares the given object with this image for equality.- Overrides:
equalsin classSourceAlignedImage
-