Imp
[using it]
Interface Manipulation Package v4.0 (2008-06-25) a-projector ©copyright Author


imp.ima
Class RgbImageSequence

java.lang.Object
  extended by imp.ima.RgbImageSequence

public class RgbImageSequence
extends Object

This class encapsulates an image sequence.


Constructor Summary
RgbImageSequence(String[] images)
          Constructs an image sequence from a sequence of URLs.
 
Method Summary
 RgbImageSequence clear()
          Clears the image buffers (stored files and memory buffers).
static String[] files(String images)
          Returns all files corresponding to a path wild-card
 RgbImage get(int index, String channel)
          Gets an image from the sequence.
 RgbImage getFiltered(int index, String channel)
          Called when an image must be computed.
 int getHeight()
          Returns the images height (constant in the sequence)
 String getName(int index)
          Returns the image name of the given index
 int getWidth()
          Returns the images width (constant in the sequence)
 int length()
          Returns the image sequence length.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RgbImageSequence

public RgbImageSequence(String[] images)
Constructs an image sequence from a sequence of URLs.

Parameters:
images - The images URLs.
As String:
A list of images URL separated by ' ' or '\t'.
As String:
A path wild-card, e.g. mypath/seq.*.pgn may also be specified. The ``*'' char must be unique and must only define the file pattern, not the directory.
As RgbImage[]:
The images of the sequence.
Method Detail

clear

public RgbImageSequence clear()
Clears the image buffers (stored files and memory buffers).


files

public static String[] files(String images)
Returns all files corresponding to a path wild-card

Parameters:
images - A path wild-card, e.g. mypath/seq.*.pgn may also be specified. The ``*'' char must be unique and must only define the file pattern, not the directory.
Returns:
An array of file name locations, eventually of zero length.

get

public RgbImage get(int index,
                    String channel)
             throws IOException
Gets an image from the sequence.
A cache mechanism is implemented:
  • Images are computed once calling the getFiltered() method and then maintained in memory.
  • When local images are used, computed images are loaded/stored from/into files, into the images folder to be reused. Their suffix is of the form channel.index.ppm.

Parameters:
index - Image index, from 0, in the sequence.
channel - [optional, default is "intensity"] Image channel.
Throws:
IOException

getFiltered

public RgbImage getFiltered(int index,
                            String channel)
                     throws IOException
Called when an image must be computed.
This method must be overwritten to implement channel computations.

Parameters:
index - Image index in the sequence.
channel - Image channel (this method is not called for the "intensity" channel).
Throws:
IllegalArgumentException - If the channel is undefined.
IOException

getHeight

public int getHeight()
              throws IOException
Returns the images height (constant in the sequence)

Throws:
IOException

getName

public String getName(int index)
Returns the image name of the given index

Parameters:
index - The image index.
Returns:
The image name if any else null.

getWidth

public int getWidth()
             throws IOException
Returns the images width (constant in the sequence)

Throws:
IOException

length

public int length()
Returns the image sequence length.