#include <HxImageSeqAVIMedia.h>
Inheritance diagram for HxImageSeqAVIMedia::
Public Methods | |
HxImageSeqAVIMedia (HxString fileName, int bufSize) | |
Constructor. More... | |
virtual | ~HxImageSeqAVIMedia () |
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.
00021 : HxImageSeqData(bufSize) 00022 { 00023 _handle = HxAVILoadVideo(fileName.c_str()); 00024 if (_handle) { 00025 _sizes = HxSizes(frameWidth(), frameHeight(), 1); 00026 } else { 00027 HxEnvironment::instance()->errorStream() << 00028 "HxImageSeqAVIMedia : unable to load file " << fileName << STD_ENDL; 00029 HxEnvironment::instance()->flush(); 00030 } 00031 } |
|
Destructor.
00040 { 00041 if (_handle) 00042 { 00043 HxAVICloseVideo(_handle); 00044 } 00045 } |
|
Is this a valid object?
Reimplemented from HxImageSeqData.
00035 { 00036 return (_handle != NULL); 00037 } |
|
The frame width.
Reimplemented from HxImageSeqData.
00049 { 00050 return (_handle) ? HxAVIGetFrameWidth(_handle) : -1; 00051 } |
|
The frame height.
Reimplemented from HxImageSeqData.
00055 { 00056 return (_handle) ? HxAVIGetFrameHeight(_handle) : -1; 00057 } |
|
The frame depth.
Reimplemented from HxImageSeqData.
00061 { 00062 return 1; 00063 } |
|
The number of frames.
Reimplemented from HxImageSeqData.
00067 { 00068 return (_handle) ? HxAVIGetLength(_handle) : 0; 00069 } |
|
Display the specified frame in the given buffer in ARGB format using the given displayMode. Optimized version : does not require HxImageRep. Reimplemented from HxImageSeqData.
00086 { 00087 if(!_handle) return; 00088 00089 if(displayMode == "Direct") getRgbPixels2d(fn, pixels); 00090 else 00091 HxImageSeqData::getRgb2d(fn, pixels, displayMode); 00092 } |
|
Display the specified frame in the given buffer in ARGB format using the given displayMode. Optimized version : does not require HxImageRep. Reimplemented from HxImageSeqData.
00074 { 00075 if(!_handle) return; 00076 00077 if((displayMode == "Direct") && (resWidth == -1) && (resHeight == -1)) 00078 getRgbPixels2d(fn, pixels); 00079 else 00080 HxImageSeqData::getRgbPixels2d(fn, pixels, displayMode, 00081 resWidth, resHeight, gi); 00082 } |
|
"construct" an HxImageRep for the specified frame.
Reimplemented from HxImageSeqData.
00114 { 00115 HxImageSignature sig(2, 3, INT_VALUE, 8); 00116 unsigned char* data = HxAVIGetFrame(_handle, fn); 00117 if (data) { 00118 //HxTagList tags; 00119 //HxAddTag(tags, "dataPtr", data); 00120 //return HxImageFactory::instance().fromImport(sig, _sizes, 00121 // "importBgr", tags); 00122 00123 HxImageRep im = HxMakeFromByteData(3, 2, _sizes, data); 00124 return im; 00125 } 00126 HxImageRep im2 = HxMakeFromSignature(sig, _sizes); 00127 return im2; 00128 } |