jsky.image.fits.codec
Class FITSData

java.lang.Object
  extended by jsky.image.fits.codec.FITSData
Direct Known Subclasses:
FITSDataByte, FITSDataDouble, FITSDataFloat, FITSDataInt, FITSDataShort

public abstract class FITSData
extends java.lang.Object

An abstract base class for performing data type specific operations on 2D FITS data.

Version:
$Revision: 1.1 $
Author:
Allan Brighton

Field Summary
protected  FITSImage _fitsImage
          Reference to the class managing the image access
protected  int _height
          The number of FITS pixels in the Y direction
protected  int _naxis
          Number of axes (Currently only the width and height are considerred)
protected  int _width
          The number of FITS pixels in the X direction
 
Constructor Summary
FITSData(FITSImage fitsImage)
          Constructor.
 
Method Summary
protected  void fillTile(java.lang.Object destArray, int x, int y, int w, int h)
          Fill the given array with image data starting at the given offsets and with the given width and height in image pixels.
abstract  java.awt.image.Raster getPreviewImage(java.awt.image.Raster tile, int factor)
          Return a prescaled preview image at "1/factor" of the normal size in the given raster tile.
abstract  java.awt.image.Raster getTile(java.awt.image.Raster tile, int subsample, int width, int height)
          Fill in the given tile with the appropriate image data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_fitsImage

protected FITSImage _fitsImage
Reference to the class managing the image access


_naxis

protected int _naxis
Number of axes (Currently only the width and height are considerred)


_width

protected int _width
The number of FITS pixels in the X direction


_height

protected int _height
The number of FITS pixels in the Y direction

Constructor Detail

FITSData

public FITSData(FITSImage fitsImage)
Constructor.

Parameters:
fitsImage - the FITS image
Method Detail

fillTile

protected void fillTile(java.lang.Object destArray,
                        int x,
                        int y,
                        int w,
                        int h)
                 throws java.io.IOException
Fill the given array with image data starting at the given offsets and with the given width and height in image pixels.

Parameters:
destArray - the image data array
x - the x offset in the image data
y - the y offset in the image data
w - the width of the data to get
h - the height of the data to get
Throws:
java.io.IOException

getTile

public abstract java.awt.image.Raster getTile(java.awt.image.Raster tile,
                                              int subsample,
                                              int width,
                                              int height)
                                       throws java.io.IOException
Fill in the given tile with the appropriate image data.

Parameters:
tile - the tile to fill with data
subsample - the increment to use when zooming out using the mapped byte buffer
width - the total image width in pixels
height - the total image height in pixels
Returns:
the tile argument
Throws:
java.io.IOException

getPreviewImage

public abstract java.awt.image.Raster getPreviewImage(java.awt.image.Raster tile,
                                                      int factor)
                                               throws java.io.IOException
Return a prescaled preview image at "1/factor" of the normal size in the given raster tile.

Throws:
java.io.IOException