Subversion Repositories seema-scanner

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 jakw 1
#ifndef CODEC_H
2
#define CODEC_H
3
 
4
#include <vector>
5
#include <opencv2/opencv.hpp>
27 jakw 6
#include "SMTypes.h"
4 jakw 7
 
8
enum CodecDir {CodecDirNone = 0,
9
               CodecDirHorizontal = 1 << 0,
10
               CodecDirVertical = 1 << 1,
11
               CodecDirBoth = CodecDirHorizontal | CodecDirVertical};
12
 
13
// Base class for all encoders
14
class Encoder {
15
    public:
16
        Encoder(unsigned int _screenCols, unsigned int _screenRows, CodecDir _dir = CodecDirHorizontal) : N(0),screenCols(_screenCols), screenRows(_screenRows),  dir(_dir){}
17
        unsigned int getNPatterns(){return N;}
18
        CodecDir getDir(){return dir;}
19
        // Encoding
20
        virtual cv::Mat getEncodingPattern(unsigned int depth) = 0;
21
        virtual ~Encoder(){}
22
    protected:
23
        unsigned int N;
24
        unsigned int screenCols, screenRows;
25
        CodecDir dir;
26
};
27
 
28
class Decoder {
29
    public:
27 jakw 30
        Decoder(CodecDir _dir = CodecDirHorizontal) : dir(_dir){}
4 jakw 31
        CodecDir getDir(){return dir;}
32
        // Decoding
27 jakw 33
        virtual void decodeFrames(const std::vector<cv::Mat> frames, cv::Mat &up, cv::Mat &vp, cv::Mat &mask, cv::Mat &shading) = 0;
4 jakw 34
        virtual ~Decoder(){}
35
    protected:
36
        CodecDir dir;
37
};
38
 
39
#endif // CODEC_H