fr.esrf.tangoatk.widget.image
Class IImageFormat

java.lang.Object
  extended by fr.esrf.tangoatk.widget.image.IImageFormat
Direct Known Subclasses:
Mono16ImageFormat, Mono8ImageFormat, RGB24ImageFormat

public abstract class IImageFormat
extends java.lang.Object

An abstract class for image format (Used by the RawImageViewer).


Constructor Summary
IImageFormat()
           
 
Method Summary
abstract  void computeFitting()
          Compute the fitting bounds (Monochrome only)
 int getHeight()
          Returns the height of the image depending on the format.
abstract  int getHistogramWidth()
          Returns the histogram width.
abstract  java.lang.String getName()
          Returns the format name.
abstract  int getRGB(boolean negative, int[] colormap16, int x, int y)
          Returns the pixel at the specifed pos
abstract  double getValue(int x, int y)
          Gets the pixel value as double (Used for table and profile display).
abstract  java.lang.String getValueStr(int x, int y)
          Gets the pixel value as string (Used for pixel info display).
abstract  int getWidth()
          Returns the width of the image depending on the format.
 void initDefault(JGradientViewer gradTool)
          Init static variable.
abstract  boolean isColorFormat()
          Returns true if this format is a color format, false otherwise.
 boolean isNull()
          Returns true if the image has a null size, false otherwise
abstract  void setData(byte[] rawData)
          Sets and decode the data.
 boolean setFitting(boolean bestFit, double min, double max)
          Set manual fitting parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IImageFormat

public IImageFormat()
Method Detail

setData

public abstract void setData(byte[] rawData)
                      throws java.io.IOException
Sets and decode the data.

Parameters:
rawData - Pointer to image data
Throws:
java.io.IOException

initDefault

public void initDefault(JGradientViewer gradTool)
Init static variable.

Parameters:
gradTool - Gradient viewer

isNull

public boolean isNull()
Returns true if the image has a null size, false otherwise


setFitting

public boolean setFitting(boolean bestFit,
                          double min,
                          double max)
Set manual fitting parameters

Parameters:
bestFit - Enable automatic fitting
min - minumun fitting value (0..100%)
max - maximum fitting value (0..100%)

getWidth

public abstract int getWidth()
Returns the width of the image depending on the format.


getHeight

public int getHeight()
Returns the height of the image depending on the format.


isColorFormat

public abstract boolean isColorFormat()
Returns true if this format is a color format, false otherwise.


getName

public abstract java.lang.String getName()
Returns the format name.


getValue

public abstract double getValue(int x,
                                int y)
Gets the pixel value as double (Used for table and profile display).

Parameters:
x - horizontal coordinate
y - vertical coordinate

getValueStr

public abstract java.lang.String getValueStr(int x,
                                             int y)
Gets the pixel value as string (Used for pixel info display).

Parameters:
x - horizontal coordinate
y - vertical coordinate

getHistogramWidth

public abstract int getHistogramWidth()
Returns the histogram width. (The number of possible value for a pixel)


computeFitting

public abstract void computeFitting()
Compute the fitting bounds (Monochrome only)


getRGB

public abstract int getRGB(boolean negative,
                           int[] colormap16,
                           int x,
                           int y)
Returns the pixel at the specifed pos

Parameters:
x - horizontal coordinate
y - vertical coordinate
negative - Negative flag
colormap16 - 16Bit colormap (Monochrome only)