public abstract class ImagePyramidBase<T extends ImageSingleBand> extends java.lang.Object implements ImagePyramid<T>
Base class for image pyramids. Provides common functionality and data structures. The scale
is defined in its children PyramidDiscrete and PyramidFloat. This allows
it to be either integer or floating point and strongly typed.
When updating the pyramid, if the top most layer is at the same resolution as the original image then a reference can optionally be saved, avoiding an unnecessary image copy. This is done by setting the saveOriginalReference to true.
| Modifier and Type | Field and Description |
|---|---|
protected int |
bottomHeight |
protected int |
bottomWidth |
protected ImageGenerator<T> |
generator |
T[] |
layers |
protected boolean |
saveOriginalReference |
| Constructor and Description |
|---|
ImagePyramidBase(java.lang.Class<T> imageType,
boolean saveOriginalReference)
Specifies input image size and behavior of top most layer.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkScales()
Used to internally check that the provided scales are valid.
|
int |
getHeight(int layer)
Returns the height of an image at ths specified layer.
|
java.lang.Class<T> |
getImageType()
The type of image.
|
int |
getInputHeight()
Height of input image.
|
int |
getInputWidth()
Width of input image.
|
T |
getLayer(int layerNum)
Returns a layer in the pyramid.
|
int |
getWidth(int layer)
Returns the width of an image at ths specified layer.
|
void |
initialize(int width,
int height)
Initializes internal data structures based on the input image's size.
|
boolean |
isSaveOriginalReference() |
void |
setFirstLayer(T image) |
void |
setTo(ImagePyramid<T> input)
Set's this pyramid to be the same as input.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNumLayers, getSampleOffset, getScale, getSigma, processprotected int bottomWidth
protected int bottomHeight
public T extends ImageSingleBand[] layers
protected boolean saveOriginalReference
protected ImageGenerator<T extends ImageSingleBand> generator
public ImagePyramidBase(java.lang.Class<T> imageType, boolean saveOriginalReference)
imageType - Type of image which is processedsaveOriginalReference - If a reference to the full resolution image should be saved instead of copied.public void initialize(int width,
int height)
initialize in interface ImagePyramid<T extends ImageSingleBand>width - Image widthheight - Image heightprotected void checkScales()
public void setTo(ImagePyramid<T> input)
ImagePyramidsetTo in interface ImagePyramid<T extends ImageSingleBand>input - Input pyramid. Not modified.public T getLayer(int layerNum)
ImagePyramidgetLayer in interface ImagePyramid<T extends ImageSingleBand>layerNum - which image is to be returned.public void setFirstLayer(T image)
public int getWidth(int layer)
ImagePyramidgetWidth in interface ImagePyramid<T extends ImageSingleBand>layer - The layer being requested.public int getHeight(int layer)
ImagePyramidgetHeight in interface ImagePyramid<T extends ImageSingleBand>layer - The layer being requested.public java.lang.Class<T> getImageType()
ImagePyramidgetImageType in interface ImagePyramid<T extends ImageSingleBand>public int getInputWidth()
ImagePyramidgetInputWidth in interface ImagePyramid<T extends ImageSingleBand>public int getInputHeight()
ImagePyramidgetInputHeight in interface ImagePyramid<T extends ImageSingleBand>public boolean isSaveOriginalReference()