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