Low-level class to write mgz files. More...
#include <Media/MgzEncoder.H>
Public Member Functions | |
MgzEncoder (const std::string &fname, const int complev) | |
Constructor. | |
virtual | ~MgzEncoder () |
Destructor. | |
virtual int | close () |
Close the file cleanly. | |
virtual void | writeFrame (const GenericFrame &frame) |
Write a frame into the file. |
Low-level class to write mgz files.
You probably want to use MgzOutputStream instead, which relies on MgzEncoder internally for its implementation but offers a richer, higher-level interface. MGZ is a custom format which basically consists of just dumping raw frames into a gzip-compressed file, using zlib as the back-end compression engine. As far as MgzEncoder is concerned, frames could be of any size and any type. Applications using the encoder, however, may want to enforce that a given MGZ file only contains frames of a given size and type.
Definition at line 57 of file MgzEncoder.H.
MgzEncoder::MgzEncoder | ( | const std::string & | fname, | |
const int | complev | |||
) |
Constructor.
fname | the file name | |
complev | the zlib compression level (1..9) |
Definition at line 52 of file MgzEncoder.C.
References sformat().
MgzEncoder::~MgzEncoder | ( | ) | [virtual] |
int MgzEncoder::close | ( | ) | [virtual] |
Close the file cleanly.
Implements LowLevelEncoder.
Definition at line 76 of file MgzEncoder.C.
Referenced by ~MgzEncoder().
void MgzEncoder::writeFrame | ( | const GenericFrame & | frame | ) | [virtual] |
Write a frame into the file.
Implements LowLevelEncoder.
Definition at line 98 of file MgzEncoder.C.
References GenericFrame::asRgbF32(), GenericFrame::asVideo(), GenericFrame::floatFlags(), Image< T >::getArrayPtr(), VideoFrame::getBuffer(), VideoFrame::getBufSize(), VideoFrame::getByteSwap(), GenericFrame::getDims(), VideoFrame::getMode(), GenericFrame::GRAY_F32, GenericFrame::GRAY_U8, Dims::h(), GenericFrame::nativeType(), GenericFrame::nativeTypeName(), GenericFrame::NONE, GenericFrame::RGB_F32, GenericFrame::RGB_U8, Dims::sz(), and Dims::w().