PGMImg.h
Go to the documentation of this file.00001 #ifndef __PGMIMG_H
00002 #define __PGMIMG_H
00003
00004 #include <vector>
00005 #include <fstream>
00006 #include <string>
00007
00008 class keypoint;
00009 class keypointPair;
00010
00011 class PGMImg{
00012 private:
00013 int width;
00014 int height;
00015 int base;
00016 unsigned char* pixels;
00017 std::string filename;
00018
00019 void setPixel(int x, int y, unsigned char color);
00020
00021 public:
00022 int id;
00023 PGMImg();
00024 PGMImg(PGMImg* img1, PGMImg* img2, std::vector<keypointPair*>* matches);
00025
00026 ~PGMImg();
00027
00028 int getHeight();
00029 int getWidth();
00030
00031 void fromFile(std::string imageFilename);
00032 void toFile(std::string imageFilename);
00033
00034 unsigned char getPixel(int x, int y);
00035
00036 void drawLine(int x1, int y1, int x2, int y2, unsigned char color);
00037 void drawKeypoint(keypoint* key);
00038 void drawKeypoints(std::vector<keypoint*> keys);
00039
00040
00041 void translate(int x, int y, unsigned char color);
00042 void rotate(double s, unsigned char color);
00043 void doubleSize(double s, unsigned char color);
00044 void halfSize(double s, unsigned char color);
00045 void cropImage(int startx, int starty, int endx, int endy, unsigned char color);
00046
00047 private:
00048 PGMImg(const PGMImg&);
00049 PGMImg& operator=(const PGMImg&);
00050 };
00051
00052 #endif