Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

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   // Transformations
00041   void translate(int x, int y, unsigned char color); // increases size if necessary
00042   void rotate(double s, unsigned char color);
00043   void doubleSize(double s, unsigned char color);    // doubles the image s times
00044   void halfSize(double s, unsigned char color);      // halves the image s times
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

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:45 2016 by Doxygen 1.6.3