public class ImageData extends Data
Starting in version 0.9 of the FITS library, this routine allows users to defer the reading of images if the FITS data is being read from a file. An ImageTiler object is supplied which can return an arbitrary subset of the image as a one dimensional array -- suitable for manipulation by standard Java libraries. A call to the getData() method will still return a multi-dimensional array, but the image data will not be read until the user explicitly requests. it.
Modifier and Type | Class and Description |
---|---|
protected static class |
ImageData.ArrayDesc
This class describes an array
|
protected class |
ImageData.ImageDataTiler
This inner class allows the ImageTiler to see if the user has read in the
data.
|
dataSize, fileOffset, input
Constructor and Description |
---|
ImageData()
Create the equivalent of a null data element.
|
ImageData(Header h)
Create an array from a header description.
|
ImageData(Object x)
Create an ImageData object using the specified object to initialize the
data array.
|
Modifier and Type | Method and Description |
---|---|
protected void |
fillHeader(Header head)
Fill header with keywords that describe image data.
|
Object |
getData()
Return the actual data.
|
StandardImageTiler |
getTiler() |
protected long |
getTrueSize()
Get the size in bytes of the data
|
protected ImageData.ArrayDesc |
parseHeader(Header h) |
void |
read(ArrayDataInput i)
Read a data array into the current object and if needed position to the
beginning of the next FITS block.
|
void |
setBuffer(Buffer data) |
void |
write(ArrayDataOutput o)
Write the data -- including any buffering needed
|
getFileOffset, getKernel, getSize, reset, rewrite, rewriteable, setFileOffset
public ImageData()
public ImageData(Header h) throws FitsException
h
- header to be used as a template.FitsException
- if there was a problem with the header description.public ImageData(Object x)
x
- The initial data array. This should be a primitive array but
this is not checked currently.protected void fillHeader(Header head) throws FitsException
head
- The FITS headerFitsException
- if the object does not contain valid image data.public Object getData()
public StandardImageTiler getTiler()
protected long getTrueSize()
protected ImageData.ArrayDesc parseHeader(Header h) throws FitsException
FitsException
public void read(ArrayDataInput i) throws FitsException
FitsElement
read
in interface FitsElement
read
in class Data
i
- The input data streamFitsException
- if the read was unsuccessful.public void setBuffer(Buffer data)
public void write(ArrayDataOutput o) throws FitsException
Data
write
in interface FitsElement
write
in class Data
o
- The output stream on which to write the data.FitsException
- if the write was unsuccessful.Copyright © 1996–2016 nom-tam-fits. All rights reserved.