public abstract class AbstractBuffer extends BaseWeakReferencingObservable implements Buffer
Modifier and Type | Field and Description |
---|---|
protected java.util.List<Band> |
bands |
protected BufferDimensions |
dimensions |
protected static Logger |
logger |
protected IProjection |
projection |
protected Statistics |
statistics |
INTERPOLATION_BicubicSpline, INTERPOLATION_Bilinear, INTERPOLATION_BSpline, INTERPOLATION_InverseDistance, INTERPOLATION_NearestNeighbour, INTERPOLATION_Undefined
Constructor and Description |
---|
AbstractBuffer() |
Modifier and Type | Method and Description |
---|---|
void |
addBand(Band band)
Adds a band
|
boolean |
areAllBandsOfTheSameType() |
Buffer |
clip(Envelope envelope) |
Buffer |
convert(ICoordTrans ct,
SimpleTaskStatus status)
Converts buffer using specified coordinate transformation
|
Buffer |
createInterpolated(int rows,
int columns,
int interpolationMode,
SimpleTaskStatus status)
Creates a interpolated buffer
|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
void |
doDispose()
Internal implementation for the
dispose() method. |
protected void |
finalize() |
Band |
getBand(int pos)
Gets the band in the "pos" position
|
Band.BandByte |
getBandByte(int pos) |
int |
getBandCount() |
Band.BandDouble |
getBandDouble(int pos) |
Band.BandFloat |
getBandFloat(int pos) |
Band.BandInt |
getBandInt(int pos) |
NoData[] |
getBandNoData() |
Band[] |
getBands() |
Band.BandShort |
getBandShort(int pos) |
BandInfo[] |
getBandsInfo() |
int[] |
getBandTypes() |
int |
getColumns() |
BufferDimensions |
getDimensions() |
Envelope |
getEnvelope() |
double |
getPixelSizeX() |
double |
getPixelSizeY() |
IProjection |
getProjection() |
int |
getRows() |
Statistics |
getStatistics(SimpleTaskStatus status)
Gets the statistics of the object than implements this interface
|
boolean |
isInside(int cellX,
int cellY)
Returns true if passed as parameter cell is inside of the buffer, else returns false.
|
boolean |
isInside(Point point)
Returns true if passed as parameter point is inside of the buffer, else returns false.
|
java.util.Iterator<Band> |
iterator() |
void |
removeBand(int pos)
Removes the band in the "pos" position
|
void |
setBand(int pos,
Band band)
Sets a band in the "pos" position
|
void |
switchBands(int[] positions)
Switches the bands as indicated by the parameter
|
void |
switchBands(int pos1,
int pos2)
Switches two bands
|
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
addObserver, addObserver, addObservers, beginComplexNotification, clearChanged, clone, countObservers, deleteObserver, deleteObserver, deleteObservers, disableNotifications, enableNotifications, endComplexNotification, hasChanged, inComplex, isEnabledNotifications, notify, notifyObservers, notifyObservers, setChanged
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBufferedImage
addObserver, deleteObserver, deleteObservers
protected static final Logger logger
protected java.util.List<Band> bands
protected IProjection projection
protected Statistics statistics
protected BufferDimensions dimensions
public Statistics getStatistics(SimpleTaskStatus status)
StatisticsCapable
getStatistics
in interface StatisticsCapable
public java.util.Iterator<Band> iterator()
iterator
in interface java.lang.Iterable<Band>
public void update(Observable observable, java.lang.Object notification)
Observer
Observable
object is changed and this
Observer
has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer
and other Observer
s listening to the same
Observable
.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver
and prepare this method
implementation to handle receiving DefaultComplexNotification
instances
as well as direct notification objects.
public int getBandCount()
getBandCount
in interface Buffer
public Band[] getBands()
public int getColumns()
getColumns
in interface Buffer
public Envelope getEnvelope()
getEnvelope
in interface Buffer
public BufferDimensions getDimensions()
getDimensions
in interface Buffer
public IProjection getProjection()
getProjection
in interface Buffer
public boolean isInside(int cellX, int cellY)
Buffer
public boolean isInside(Point point)
Buffer
public void setBand(int pos, Band band) throws BandException
Buffer
setBand
in interface Buffer
BandException
public void removeBand(int pos)
Buffer
removeBand
in interface Buffer
public Band getBand(int pos)
Buffer
public Band.BandByte getBandByte(int pos)
getBandByte
in interface Buffer
public Band.BandShort getBandShort(int pos)
getBandShort
in interface Buffer
public Band.BandInt getBandInt(int pos)
getBandInt
in interface Buffer
public Band.BandFloat getBandFloat(int pos)
getBandFloat
in interface Buffer
public Band.BandDouble getBandDouble(int pos)
getBandDouble
in interface Buffer
public void switchBands(int[] positions)
Buffer
switchBands
in interface Buffer
public void switchBands(int pos1, int pos2)
Buffer
switchBands
in interface Buffer
public Buffer createInterpolated(int rows, int columns, int interpolationMode, SimpleTaskStatus status) throws BufferException
Buffer
createInterpolated
in interface Buffer
BufferException
public Buffer convert(ICoordTrans ct, SimpleTaskStatus status) throws BufferException
Buffer
convert
in interface Buffer
ct
- Coordinate transformation to convert bufferBufferException
- If there are problems converting bufferpublic int[] getBandTypes()
getBandTypes
in interface Buffer
public boolean areAllBandsOfTheSameType()
areAllBandsOfTheSameType
in interface Buffer
public NoData[] getBandNoData()
getBandNoData
in interface Buffer
public Buffer clip(Envelope envelope) throws BufferException
clip
in interface Buffer
BufferException
public double getPixelSizeX()
getPixelSizeX
in interface Buffer
public double getPixelSizeY()
getPixelSizeY
in interface Buffer
public final void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
public void doDispose() throws BaseException
dispose()
method.BaseException
dispose()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public BandInfo[] getBandsInfo()
getBandsInfo
in interface Buffer