CADI.Client
Class ImageData

java.lang.Object
  extended by CADI.Client.ImageData

public class ImageData
extends java.lang.Object

This class wraps several image types.

Version:
1.0 2008/03/22
Author:
Group on Interactive Coding of Images (GICI)

Field Summary
static int BUFFERED
          Image is represented as a BufferedImage.
private  java.awt.image.BufferedImage bufImage
          Image is represented as a BufferedImage.
private  int[] components
          Is an one-dimensional array with the indexes of the decompressed image components.
private  int dataType
          Indicates which is the image data type.
private  int[] fsiz
          Definition in ViewWindowField.fsiz.
private  float[][][] imageSamplesFloat
          Image is represented as a thre-dimensional array of floats.
private  int layers
          Definition in ViewWindowField.layers.
private  int maxComponents
          Is the maximum number of image components
private  int maxLayers
           
private  int maxResolutionLevels
          Indicates the maximum resolution level of the image.
private  int[] precision
          Is the precision, in bits per sample, for each image component.
private  int quality
          Definition in DataLimitField.quality.
static int RASTER
          Image is represented as a Raster image.
private  java.awt.image.Raster rasterImage
          Image is represented as a Raster.
private  int resolutionLevel
          Is the resolution level of the decompressed image.
private  int[] roff
          Definition in ViewWindowField.roff.
private  int[] rsiz
          Definition in ViewWindowField.rsiz.
static int SAMPLES_FLOAT
          The image is represented as a thre-dimensional array of floats.
static int UNDEFINED
          Indicates the data type has not defined yet.
 
Constructor Summary
ImageData(int dataType)
          Constructor.
 
Method Summary
 java.awt.image.BufferedImage getBufferedImage()
          Get the buffered image (bufImage attribute).
 int[] getComponents()
          Returns the components attribute.
 int[] getFrameSize()
          Returns the fsiz attribute.
 int getFrameSizeHeight()
          Returns the height of the frame size.
 int getFrameSizeWidth()
          Returns the width of the frame size.
 int getLayers()
          Gets the layers attribute.
 int getMaxComponents()
          Returns the maxComponents attribute.
 int getMaxLayers()
          Gets the maxLayers attribute.
 int getMaxResolutionLevels()
          Gets the maxResolutionLevels attribute.
 int[] getPrecision()
          Returns the precision attribute.
 int getQuality()
          Gets the quality attribute.
 java.awt.image.Raster getRasterImage()
          Get the rasterimage (rasterImage attribute).
 int[] getRegionOffset()
          Gets the roff attribute.
 int[] getRegionSize()
          Gets the rsiz attribute.
 int getResolutionLevel()
          Returns the resolutionLevel attribute.
 float[][][] getSamplesFloat()
          Get the image samples float (imageSamplesFloat attribute).
 int getType()
          Returns the type of the image.
 void list(java.io.PrintStream out)
          Prints this Image data fields out to the specified output stream.
 void setComponents(int[] components)
          Sets the components attribute.
 void setData(java.awt.image.BufferedImage bufImage)
          Sets the bufImage attribute.
 void setData(float[][][] imageSamples)
          Sets the imageSamplesFloat attribute.
 void setData(java.awt.image.Raster rasterImage)
          Sets the rasterImage attribute.
 void setFrameSize(int[] fsiz)
          Sets the fsiz attribute.
 void setFrameSize(int width, int height)
          Sets the fsiz atribute.
 void setLayers(int layers)
          Sets the layers attribute.
 void setMaxComponents(int maxComponents)
          Sets the maxComponents attribute.
 void setMaxLayers(int maxLayers)
          Sets the maxLayers attribute.
 void setMaxResolutionLevel(int maxResolutionLevels)
          Sets the maxResolutionLevels attribute.
 void setPrecision(int[] precision)
          Sets the precision attribute.
 void setQuality(int quality)
          Sets the quality attribute.
 void setRegionOffset(int[] roff)
          Sets the roff parameter.
 void setRegionOffset(int x, int y)
          Sets the top-left coordinates of the region.
 void setRegionSize(int[] rsiz)
          Sets the rsiz attribute.
 void setRegionSize(int width, int height)
          Sets the with and height of the region.
 void setResolutionLevel(int resolutionLevel)
          Sets the resolutionLevel attribute.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataType

private int dataType
Indicates which is the image data type. Allowed values are:
  • UNDEFINED
  • SAMPLES_FLOAT
  • BUFFERED
  • RASTER


  • UNDEFINED

    public static final int UNDEFINED
    Indicates the data type has not defined yet.

    See Also:
    Constant Field Values

    SAMPLES_FLOAT

    public static final int SAMPLES_FLOAT
    The image is represented as a thre-dimensional array of floats. See imageSamplesFloat.

    See Also:
    Constant Field Values

    BUFFERED

    public static final int BUFFERED
    Image is represented as a BufferedImage. See bufImage.

    See Also:
    Constant Field Values

    RASTER

    public static final int RASTER
    Image is represented as a Raster image. See rasterImage.

    See Also:
    Constant Field Values

    imageSamplesFloat

    private float[][][] imageSamplesFloat
    Image is represented as a thre-dimensional array of floats. Indexes meaning imageSamples[z][y][x]:
      z: image component
      y: coordinate in the ordinate axis (y-axis)
      x: coordinate in the abcisse axis (x-axis)


    bufImage

    private java.awt.image.BufferedImage bufImage
    Image is represented as a BufferedImage. See BufferedImage.


    rasterImage

    private java.awt.image.Raster rasterImage
    Image is represented as a Raster. See Raster.


    maxComponents

    private int maxComponents
    Is the maximum number of image components


    components

    private int[] components
    Is an one-dimensional array with the indexes of the decompressed image components.


    fsiz

    private int[] fsiz
    Definition in ViewWindowField.fsiz.


    roff

    private int[] roff
    Definition in ViewWindowField.roff.


    rsiz

    private int[] rsiz
    Definition in ViewWindowField.rsiz.


    maxResolutionLevels

    private int maxResolutionLevels
    Indicates the maximum resolution level of the image.


    resolutionLevel

    private int resolutionLevel
    Is the resolution level of the decompressed image.


    maxLayers

    private int maxLayers

    layers

    private int layers
    Definition in ViewWindowField.layers.


    quality

    private int quality
    Definition in DataLimitField.quality.


    precision

    private int[] precision
    Is the precision, in bits per sample, for each image component.

    Constructor Detail

    ImageData

    public ImageData(int dataType)
    Constructor.

    Parameters:
    dataType - definition in dataType.
    Method Detail

    getType

    public int getType()
    Returns the type of the image. See dataType attribute.

    Returns:
    the type of the image.

    setMaxComponents

    public void setMaxComponents(int maxComponents)
    Sets the maxComponents attribute.

    Parameters:
    maxComponents - definition in maxComponents.

    getMaxComponents

    public int getMaxComponents()
    Returns the maxComponents attribute.

    Returns:
    definition in maxComponents.

    setComponents

    public void setComponents(int[] components)
    Sets the components attribute.

    Parameters:
    components - definition in components.

    getComponents

    public int[] getComponents()
    Returns the components attribute.

    Returns:
    definition in components.

    setFrameSize

    public void setFrameSize(int width,
                             int height)
    Sets the fsiz atribute.

    Parameters:
    width - is the width of the frame size.
    height - is the height of the frame size.

    setFrameSize

    public void setFrameSize(int[] fsiz)
    Sets the fsiz attribute.

    Parameters:
    fsiz - definition in fsiz.

    getFrameSizeWidth

    public int getFrameSizeWidth()
    Returns the width of the frame size.

    Returns:
    with of the frame size.

    getFrameSizeHeight

    public int getFrameSizeHeight()
    Returns the height of the frame size.

    Returns:
    height of the frame size.

    getFrameSize

    public int[] getFrameSize()
    Returns the fsiz attribute.

    Returns:
    definition in fsiz.

    setRegionOffset

    public void setRegionOffset(int x,
                                int y)
    Sets the top-left coordinates of the region. See roff attribute.

    Parameters:
    x - left coordinate.
    y - top coordinate.

    setRegionOffset

    public void setRegionOffset(int[] roff)
    Sets the roff parameter.

    Parameters:
    roff - definition in roff

    getRegionOffset

    public int[] getRegionOffset()
    Gets the roff attribute.

    Returns:
    definition in roff.

    setRegionSize

    public void setRegionSize(int width,
                              int height)
    Sets the with and height of the region. See rsiz.

    Parameters:
    width - width of the region.
    height - height of the region.

    setRegionSize

    public void setRegionSize(int[] rsiz)
    Sets the rsiz attribute.

    Parameters:
    rsiz - definition in rsiz.

    getRegionSize

    public int[] getRegionSize()
    Gets the rsiz attribute.

    Returns:
    definition in rsiz.

    setMaxResolutionLevel

    public void setMaxResolutionLevel(int maxResolutionLevels)
    Sets the maxResolutionLevels attribute.

    Parameters:
    maxResolutionLevels - definition in maxResolutionLevels.

    getMaxResolutionLevels

    public int getMaxResolutionLevels()
    Gets the maxResolutionLevels attribute.

    Returns:
    definition in maxResolutionLevels

    setResolutionLevel

    public void setResolutionLevel(int resolutionLevel)
    Sets the resolutionLevel attribute.

    Parameters:
    resolutionLevel - definition in resolutionLevel.

    getResolutionLevel

    public int getResolutionLevel()
    Returns the resolutionLevel attribute.

    Returns:
    definition in resolutionLevel.

    setMaxLayers

    public void setMaxLayers(int maxLayers)
    Sets the maxLayers attribute.

    Parameters:
    maxLayers - definition in maxLayers.

    getMaxLayers

    public int getMaxLayers()
    Gets the maxLayers attribute.

    Returns:
    definition in maxLayers.

    setLayers

    public void setLayers(int layers)
    Sets the layers attribute.

    Parameters:
    layers - definition in layers.

    getLayers

    public int getLayers()
    Gets the layers attribute.

    Returns:
    the layers attribute.

    setQuality

    public void setQuality(int quality)
    Sets the quality attribute.

    Parameters:
    quality - definition in quality.

    getQuality

    public int getQuality()
    Gets the quality attribute.

    Returns:
    the quality attribute.

    setPrecision

    public void setPrecision(int[] precision)
    Sets the precision attribute.

    Parameters:
    precision - definition in precision.

    getPrecision

    public int[] getPrecision()
    Returns the precision attribute.

    Returns:
    the precision attribute.

    setData

    public void setData(float[][][] imageSamples)
    Sets the imageSamplesFloat attribute.

    Parameters:
    imageSamples - definition in imageSamplesFloat.

    setData

    public void setData(java.awt.image.BufferedImage bufImage)
    Sets the bufImage attribute.

    Parameters:
    bufImage - definition in bufImage.

    setData

    public void setData(java.awt.image.Raster rasterImage)
    Sets the rasterImage attribute.

    Parameters:
    rasterImage - definition in rasterImage.

    getSamplesFloat

    public float[][][] getSamplesFloat()
                                throws java.lang.IllegalAccessException
    Get the image samples float (imageSamplesFloat attribute).

    Returns:
    the image samples float.
    Throws:
    java.lang.IllegalAccessException - if the method is called but the data type is not a image of sample floats. See getType() method.

    getBufferedImage

    public java.awt.image.BufferedImage getBufferedImage()
                                                  throws java.lang.IllegalAccessException
    Get the buffered image (bufImage attribute).

    Returns:
    the buffered image.
    Throws:
    java.lang.IllegalAccessException - if the method is called but the data type is not a buffered image. See getType() method.

    getRasterImage

    public java.awt.image.Raster getRasterImage()
                                         throws java.lang.IllegalAccessException
    Get the rasterimage (rasterImage attribute).

    Returns:
    the raster image.
    Throws:
    java.lang.IllegalAccessException - if the method is called but the data type is not a raster image. See getType() method.

    toString

    public java.lang.String toString()
    Overrides:
    toString in class java.lang.Object

    list

    public void list(java.io.PrintStream out)
    Prints this Image data fields out to the specified output stream. This method is useful for debugging.

    Parameters:
    out - an output stream.


    CADI - Copyright (C) 2007
    This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

    Group on Interactive Coding of Images (GICI) (contact)