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

Public Methods | |
| HxImageSeqMDC (HxString fileName, int bufSize) | |
| Constructor. More... | |
| virtual | ~HxImageSeqMDC () |
| Destructor. More... | |
| virtual int | valid () |
| Is this a valid object? More... | |
| virtual int | frameWidth () |
| The frame width. More... | |
| virtual int | frameHeight () |
| The frame height. More... | |
| virtual int | frameDepth () |
| The frame depth. More... | |
| virtual int | nrFrames () |
| The number of frames. More... | |
| virtual void | getRgb2d (int fn, int *pixels, HxString displayMode) |
| Display the specified frame in the given buffer in ARGB format using the given displayMode. More... | |
| virtual void | getRgbPixels2d (int fn, int *pixels, HxString displayMode, int resWidth, int resHeight, HxGeoIntType gi) |
| Display the specified frame in the given buffer in ARGB format using the given displayMode. More... | |
| virtual HxImageRep | frame2HxImageRep (int) |
| "construct" an HxImageRep for the specified frame. More... | |
|
||||||||||||
|
Constructor.
00019 : HxImageSeqData(bufSize) 00020 { 00021 long lResult = _mpvDecoder.Initialize(fileName.c_str()); 00022 if (lResult == MDC_SUCCESS) { 00023 if (_mpvDecoder.InitializeGenDisplayBuffer() <= 0) { 00024 _valid = 0; 00025 } else { 00026 _mpvDecoder.SetSpeed(0); 00027 _mpvDecoder.PrepareRandomAccess(); 00028 _mpvDecoder.JumpToEndingPicture(); 00029 if (_mpvDecoder.GetCurFrameNum(&lResult) == MDC_SUCCESS) 00030 _nrFrames = lResult; 00031 else 00032 _nrFrames = 0; 00033 WORD width = _mpvDecoder.FrameWidth(); 00034 WORD height = _mpvDecoder.FrameHeight(); 00035 _sizes = HxSizes(width, height, 1); 00036 _pnOutBuf = new BYTE [width*height*3]; 00037 _valid = 1; 00038 } 00039 } else { 00040 _valid = 0; 00041 } 00042 if (! _valid) { 00043 HxEnvironment::instance()->errorStream() << 00044 "HxImageSeqMDC : unable to load file " << fileName << STD_ENDL; 00045 HxEnvironment::instance()->flush(); 00046 } 00047 } |
|
|
Destructor.
00056 {
00057 if (_valid) {
00058 _mpvDecoder.DeleteGenDisplayBuffer();
00059 _valid = false;
00060 }
00061 }
|
|
|
Is this a valid object?
Reimplemented from HxImageSeqData.
00051 {
00052 return _valid;
00053 }
|
|
|
The frame width.
Reimplemented from HxImageSeqData.
00065 {
00066 return (_valid) ? _sizes.x() : -1;
00067 }
|
|
|
The frame height.
Reimplemented from HxImageSeqData.
00071 {
00072 return (_valid) ? _sizes.y() : -1;
00073 }
|
|
|
The frame depth.
Reimplemented from HxImageSeqData.
00077 {
00078 return 1;
00079 }
|
|
|
The number of frames.
Reimplemented from HxImageSeqData.
00083 {
00084 return _nrFrames;
00085 }
|
|
||||||||||||||||
|
Display the specified frame in the given buffer in ARGB format using the given displayMode. Optimized version : does not require HxImageRep. Reimplemented from HxImageSeqData.
00102 {
00103 if(!_valid) return;
00104
00105 if(displayMode == "Direct") getRgbPixels2d(fn, pixels);
00106 else
00107 HxImageSeqData::getRgb2d(fn, pixels, displayMode);
00108 }
|
|
||||||||||||||||||||||||||||
|
Display the specified frame in the given buffer in ARGB format using the given displayMode. Optimized version : does not require HxImageRep. Reimplemented from HxImageSeqData.
00090 {
00091 if(!_valid) return;
00092
00093 if((displayMode == "Direct") && (resWidth == -1) && (resHeight == -1))
00094 getRgbPixels2d(fn, pixels);
00095 else
00096 HxImageSeqData::getRgbPixels2d(fn, pixels, displayMode,
00097 resWidth, resHeight, gi);
00098 }
|
|
|
"construct" an HxImageRep for the specified frame.
Reimplemented from HxImageSeqData.
00136 {
00137 HxImageSignature sig(2, 3, INT_VALUE, 8);
00138 //unsigned char* data = HxDXGetFrame(_handle, fn);
00139 WORD OutPicWidth, OutPicHeight;
00140 long lItemNum = _mpvDecoder.GetBufferedFrame(_pnOutBuf, &OutPicWidth,
00141 &OutPicHeight, PPM, fn);
00142 if (lItemNum > 0) {
00143 //HxTagList tags;
00144 //HxAddTag(tags, "dataPtr", data);
00145 //return HxImageFactory::instance().fromImport(sig, _sizes,
00146 // "importBgr", tags);
00147
00148 HxImageRep im = HxMakeFromByteData(3, 2, _sizes, _pnOutBuf);
00149 return im;
00150 }
00151 HxImageRep im2 = HxMakeFromSignature(sig, _sizes);
00152 return im2;
00153 }
|
1.2.12 written by Dimitri van Heesch,
© 1997-2001