Skip to content

Create Your Own Output Class

Andrés Solís Montero edited this page Oct 18, 2015 · 1 revision

The Ouput class is an abstract class defined in the "output.h" header. To create an output compatible with the vivalib framework you need to create a derived class from the Output class and implement the bool writeFrame(Mat &frame) method.

The Output Class:

 class Output
    {
    protected:
        Size _size;
        bool _convert;
        int  _conversionFlag;
    public:
        Output(const Size &size = Size(-1, -1), int  conversionFlag = -1):
                _size(size),
                _convert(false),
                _conversionFlag(conversionFlag)
        {
            if (conversionFlag != -1)
                _convert = true;
        }
        virtual ~Output(){}
        virtual bool  writeFrame(Mat &frame)= 0;
        virtual void  close() {}
    };

Clone this wiki locally