struct mrpt::img::CVideoFileWriter::Impl

Overview

struct Impl
{
    // fields

    FILE* fp {nullptr};
    VideoCodec codec {VideoCodec::MJPEG};
    int width {0};
    int height {0};
    double fps {0.0};
    int jpegQuality {90};
    uint32_t frameCount {0};
    uint32_t maxFrameBytes {0};
    bool isGrayscale {false};
    bool headersWritten {false};
    long pos_riff_size {0};
    long pos_hdrl_size {0};
    long pos_avih_totalframes {0};
    long pos_avih_maxbytespersec {0};
    long pos_avih_suggestedbuf {0};
    long pos_strh_length {0};
    long pos_strh_suggestedbuf {0};
    long pos_movi_size {0};
    long pos_movi_data_start {0};
    uint32_t frameFcc {0};
    std::vector<AviIndexEntry> index;

    // construction

    Impl();
    Impl(const Impl&);
    Impl(Impl&&);

    // methods

    bool writeHeaders();
    bool appendFrame(const mrpt::img::CImage& img);
    bool appendFrameUncompressed(const mrpt::img::CImage& img);
    bool appendFrameMJPEG(const mrpt::img::CImage& img);
    bool finalizeFile();
    Impl& operator = (const Impl&);
    Impl& operator = (Impl&&);
};

Fields

uint32_t maxFrameBytes {0}

Largest frame written (for dwSuggestedBufferSize)

bool isGrayscale {false}

Set from the first frame; all subsequent frames must match.

bool headersWritten {false}

Headers are deferred to the first appendFrame() call so that we know the actual channel layout before writing the BitmapInfoHeader.

long pos_movi_data_start {0}

Byte offset just after the ‘movi’ LIST type fourCC.

uint32_t frameFcc {0}

‘00dc’ (compressed) or ‘00db’ (uncompressed)