uk.ac.starlink.jaiutil
Class NDArrayData

java.lang.Object
  extended by uk.ac.starlink.jaiutil.NDArrayData
Direct Known Subclasses:
NDArrayDataByte, NDArrayDataDouble, NDArrayDataFloat, NDArrayDataInt, NDArrayDataShort

public abstract class NDArrayData
extends Object

An abstract base class for performing data type specific operations when accessing NDArray data.

Version:
$Id$
Author:
Peter W. Draper

Field Summary
protected  int height
          Height in pixels of the image data
protected  int naxis
          Number of axes (Currently only the width and height are considered)
protected  ArrayAccess tiler
          Object used to access the image tiles
protected  int width
          Width in pixels of the image data
 
Constructor Summary
NDArrayData(NDArray nda)
          Constructor.
NDArrayData(NDArray nda, int[] axes)
          Constructor.
 
Method Summary
protected  void fillTile(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  Raster getPreviewImage(Raster tile, int factor)
          Return a prescaled preview image at "1/factor" of the normal size in the given raster tile.
abstract  Raster getTile(Raster tile, int subsample, int width, int height)
          Fill 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

tiler

protected ArrayAccess tiler
Object used to access the image tiles


width

protected int width
Width in pixels of the image data


height

protected int height
Height in pixels of the image data


naxis

protected int naxis
Number of axes (Currently only the width and height are considered)

Constructor Detail

NDArrayData

public NDArrayData(NDArray nda)
            throws IOException
Constructor.

Parameters:
tiler - the NDArray
Throws:
IOException

NDArrayData

public NDArrayData(NDArray nda,
                   int[] axes)
            throws IOException
Constructor.

Parameters:
tiler - the NDArray
axes - an array containing the dimensions of the image
Throws:
IOException
Method Detail

fillTile

protected void fillTile(Object destArray,
                        int x,
                        int y,
                        int w,
                        int h)
                 throws 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:
IOException

getTile

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

Throws:
IOException

getPreviewImage

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

Throws:
IOException


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.