image_read.h 751 Bytes
Newer Older
1 2 3 4
#ifndef IMAGE_READ_H
#define IMAGE_READ_H

#include <utility>
5 6
#include <jpeglib.h>
#include <png.h>
7 8 9 10 11 12 13 14 15 16 17 18 19 20

#ifndef _MSC_VER
extern "C" {
#include <ppm.h>
#include <pm.h>
#include <pam.h>
}
  #ifndef _MSC_VER
    #define PROGNAME "pano_interface"
  #endif
#endif

enum FileType{
    JPEG,
21 22
    PNG,
    PNM,
23 24 25 26 27 28 29 30 31 32
    UNKNOWN
};

class FileRead{
    private:
        static enum FileType get_file_type(const char*);
    protected:
        static unsigned char *read_image(const char*,int*,int*);
    private:
        static unsigned char *jpgRead(const char*,int*,int*);
33
        static unsigned char *pngRead(const char*,int*,int*);
34 35 36 37 38 39
#ifndef _MSC_VER
        static unsigned char *pnmRead(const char * const,const char*,int*,int*);
#endif
};

#endif // IMAGE_READ_H