ioutput.h 724 Bytes
Newer Older
wester committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
#ifndef IOUTPUT_H
#define IOUTPUT_H

#include <cstdio>

#include "_cvcommon.h"

struct CvMat;
struct CvRect;

class IOutput
{
public:
    enum OutputType {PNG_DATASET, JPG_DATASET};
public:
    virtual bool write( const CvMat& img,
                        const CvRect& boundingBox ) =0;

    virtual ~IOutput();

    static IOutput* createOutput( const char *filename, OutputType type );
protected:
    IOutput();
    /* finds the beginning of the last token in the path */
    void findFilePathPart( char **partOfPath, char *fullPath );
    virtual bool init( const char* filename );
protected:
    int  currentIdx;
    char imgFullPath[PATH_MAX];
    char* imgFileName;
    FILE* annotationsList;
};

#endif // IOUTPUT_H