#include <HxImageSeqData.h>
Inheritance diagram for HxImageSeqData::

| Public Methods | |
| HxImageSeqData (int bufsize) | |
| Constructor. More... | |
| virtual | ~HxImageSeqData () | 
| Destructor. More... | |
| int | ident () const | 
| The identity of the sequence. More... | |
| virtual int | valid ()=0 | 
| Is this a valid object? More... | |
| virtual int | frameWidth ()=0 | 
| The frame width. More... | |
| virtual int | frameHeight ()=0 | 
| The frame height. More... | |
| virtual int | frameDepth ()=0 | 
| The frame depth. More... | |
| virtual int | nrFrames ()=0 | 
| The number of frames. More... | |
| HxImageRep | getFrame (int fn) | 
| Get the specified frame. More... | |
| virtual void | getRgb2d (int fn, int *pixels, HxString displayMode) | 
| Displays the specified frame in the buffer by calling getRgbPixels2d of the HxImageRep corresponding to the given frame number. More... | |
| virtual void | getRgbPixels2d (int nr, int *pixels, HxString displayMode, int resWidth, int resHeight, HxGeoIntType gi) | 
| Displays the specified frame in the buffer by calling getRgbPixels2d of the HxImageRep corresponding to the given frame number. More... | |
| virtual HxImageRep | frame2HxImageRep (int)=0 | 
| "construct" an HxImageRep for the specified frame. More... | |
The actual (pixel) data is read by specializations of this class. For that purpose, specializations have to implement the function frame2HxImageRep. The specializations also have to implement inquiry functions to provide information about image dimensions and the number of frames in the sequence.
The main purpose of this class is to provide a buffering mechanism for HxImageRep's of the sequence as we expect processing of such a sequence will be done in a small sliding window so multiple requests for the same frame will occur.
This class also provides a default implementation
| 
 | 
| Constructor. 
 
 00021 {
00022     _ident = _nr++;
00023     // if == INT_MAX
00024     _bufsize = bufsize;
00025     _current = -1;
00026     _size = 0; // nothing in the buffer
00027     _buffer.clear();
00028 }
 | 
| 
 | 
| Destructor. 
 
 00031 {
00032     _buffer.clear();
00033 }
 | 
| 
 | 
| The identity of the sequence. 
 
 00083 {
00084     return _ident;
00085 }
 | 
| 
 | 
| Is this a valid object? 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
| 
 | 
| The frame width. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
| 
 | 
| The frame height. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
| 
 | 
| The frame depth. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
| 
 | 
| The number of frames. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
| 
 | 
| Get the specified frame. 
 
 00037 {
00038     if (_bufsize <= 0) // we are not buffering
00039         return frame2HxImageRep(fn);
00040 
00041     if (fn == _current+1) { 
00042         HxImageRep tmp = frame2HxImageRep(fn);
00043         if (_size < _bufsize) {
00044             _size++;
00045         } else {
00046             _buffer.pop_back();
00047         }
00048         _current++;
00049         _buffer.push_front(tmp);
00050         return tmp;
00051     }
00052     // check whether requested frame is in the buffer
00053     if ((fn <= _current) && (fn > _current - _size)) {
00054         std::list<HxImageRep>::iterator i = _buffer.begin();
00055         for (int j = 0; j < _current-fn; j++, i++);
00056         return *i;
00057     }
00058     // looks like we are "jumping" in the sequence
00059     HxImageRep tmp = frame2HxImageRep(fn);
00060     _current = fn;
00061     _size = 1;
00062     _buffer.clear();
00063     _buffer.push_front(tmp);
00064     return tmp;
00065 }
 | 
| 
 | ||||||||||||||||
| Displays the specified frame in the buffer by calling getRgbPixels2d of the HxImageRep corresponding to the given frame number. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. 
 00069 {
00070     HxImageRep frame = getFrame(fn);
00071     frame.getRgbPixels2d(pixels, displayMode);
00072 }
 | 
| 
 | ||||||||||||||||||||||||||||
| Displays the specified frame in the buffer by calling getRgbPixels2d of the HxImageRep corresponding to the given frame number. 
 Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. 
 00077 {
00078     HxImageRep frame = getFrame(fn);
00079     frame.getRgbPixels2d(pixels, displayMode, resWidth, resHeight, gi);
00080 }
 | 
| 
 | 
| "construct" an HxImageRep for the specified frame. Derived classes are to implement this function to deliver the actual image data. Reimplemented in HxImageSeqAVIMedia, HxImageSeqDXMedia, and HxImageSeqMDC. | 
 1.2.12 written by Dimitri van Heesch,
 © 1997-2001
1.2.12 written by Dimitri van Heesch,
 © 1997-2001