public final class RasterAttributes extends Object implements IDisposable
Raster dataset. RasterAttributes define the memory layout of
a Raster, and includes properties defining the order of each RasterBand that the raster contains, as specified by the RasterFormat.
It also describes the type of data, or RasterType of the contained bands, the Height and Width of the raster in pixels,
the RowAlignment of the raster, and other relevant properties.Raster,
Rasters and Filtering topic| Constructor and Description |
|---|
RasterAttributes(BufferedImage bitmap)
Initializes a new instance from a
BufferedImage. |
RasterAttributes(int width,
int height,
RasterFormat rasterFormat)
Initializes a new instance with the width and height of the raster in pixels, and the given
RasterFormat. |
RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType)
Initializes a new instance with the width and height of the raster in pixels, and the given
RasterFormat and RasterType. |
RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation)
Initializes a new instance with the width and height of the raster in pixels, and the given
RasterFormat, RasterType, and RasterOrientation. |
RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation,
int rowAlignment)
Initializes a new instance with the width and height of the raster in pixels, and the given
RasterFormat, RasterType, RasterOrientation, and row alignment. |
RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation,
int rowAlignment,
double pixelAspectRatio)
Initializes a new instance with the width and height of the raster in pixels, and the given
RasterFormat, RasterType, RasterOrientation, row alignment, and pixel aspect ratio. |
RasterAttributes(Raster raster)
Initializes a new instance with the attributes of the specified
Raster |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting
unmanaged resources.
|
protected void |
dispose(boolean disposing) |
protected void |
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
int |
getByteLength()
Gets the size of the raster data in bytes.
|
RasterFormat |
getFormat()
Gets the
RasterFormat associated with the attributes. |
int |
getHeight()
Gets the height of the raster in pixels.
|
int |
getNumberOfBands()
Gets the number of bands comprising the raster.
|
RasterOrientation |
getOrientation()
Gets the
RasterOrientation associated with the attributes. |
double |
getPixelAspectRatio()
Gets the pixel aspect ratio of the raster.
|
int |
getRowAlignment()
Gets the row alignment of the raster data in bytes.
|
int |
getRowStride()
Gets the stride or scan/row width in bytes of the raster data.
|
RasterType |
getType()
Gets the
RasterType associated with the attributes. |
int |
getWidth()
Gets the width of the raster in pixels.
|
boolean |
hasBand(RasterBand band)
Gets whether the raster contains the given band.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclosepublic RasterAttributes(int width,
int height,
RasterFormat rasterFormat)
RasterFormat.width - The width of the raster in pixels.height - The height of the raster in pixels.rasterFormat - The RasterFormat.public RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType)
RasterFormat and RasterType.width - The width of the raster in pixels.height - The height of the raster in pixels.rasterFormat - The RasterFormat.rasterType - The RasterType.public RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation)
RasterFormat, RasterType, and RasterOrientation.width - The width of the raster in pixels.height - The height of the raster in pixels.rasterFormat - The RasterFormat.rasterType - The RasterType.rasterOrientation - The RasterOrientation.public RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation,
int rowAlignment)
RasterFormat, RasterType, RasterOrientation, and row alignment.width - The width of the raster in pixels.height - The height of the raster in pixels.rasterFormat - The RasterFormat.rasterType - The RasterType.rasterOrientation - The RasterOrientation.rowAlignment - The row alignment, in bytes, of the raster.public RasterAttributes(int width,
int height,
RasterFormat rasterFormat,
RasterType rasterType,
RasterOrientation rasterOrientation,
int rowAlignment,
double pixelAspectRatio)
RasterFormat, RasterType, RasterOrientation, row alignment, and pixel aspect ratio.width - The width of the raster in pixels.height - The height of the raster in pixels.rasterFormat - The RasterFormat.rasterType - The RasterType.rasterOrientation - The RasterOrientation.rowAlignment - The row alignment, in bytes, of the raster.pixelAspectRatio - The pixel aspect ratio of the raster.public RasterAttributes(Raster raster)
Rasterraster - The Rasterto create the attributes from.public RasterAttributes(BufferedImage bitmap)
BufferedImage.bitmap - The
BufferedImage
to create the attributes from.protected void finalize()
throws Throwable
java.lang.Objectfinalize method to dispose of
system resources or to perform other cleanup.
The general contract of finalize is that it is invoked
if and when the Java™ virtual
machine has determined that there is no longer any
means by which this object can be accessed by any thread that has
not yet died, except as a result of an action taken by the
finalization of some other object or class which is ready to be
finalized. The finalize method may take any action, including
making this object available again to other threads; the usual purpose
of finalize, however, is to perform cleanup actions before
the object is irrevocably discarded. For example, the finalize method
for an object that represents an input/output connection might perform
explicit I/O transactions to break the connection before the object is
permanently discarded.
The finalize method of class Object performs no
special action; it simply returns normally. Subclasses of
Object may override this definition.
The Java programming language does not guarantee which thread will
invoke the finalize method for any given object. It is
guaranteed, however, that the thread that invokes finalize will not
be holding any user-visible synchronization locks when finalize is
invoked. If an uncaught exception is thrown by the finalize method,
the exception is ignored and finalization of that object terminates.
After the finalize method has been invoked for an object, no
further action is taken until the Java virtual machine has again
determined that there is no longer any means by which this object can
be accessed by any thread that has not yet died, including possible
actions by other objects or classes which are ready to be finalized,
at which point the object may be discarded.
The finalize method is never invoked more than once by a Java
virtual machine for any given object.
Any exception thrown by the finalize method causes
the finalization of this object to be halted, but is otherwise
ignored.
finalize in class ObjectThrowable - the Exception raised by this methodWeakReference,
PhantomReferencepublic final void dispose()
IDisposabledispose in interface IDisposableprotected void dispose(boolean disposing)
public final RasterFormat getFormat()
RasterFormat associated with the attributes.public final RasterType getType()
RasterType associated with the attributes.public final RasterOrientation getOrientation()
RasterOrientation associated with the attributes.public final int getByteLength()
public final int getWidth()
public final int getHeight()
public final double getPixelAspectRatio()
public final int getRowAlignment()
public final int getNumberOfBands()
public final int getRowStride()
public final boolean hasBand(RasterBand band)
band - The RasterBand to test.