iSpike
2.1
Spike conversion library for robotics
|
00001 #ifndef BITMAP_HPP_ 00002 #define BITMAP_HPP_ 00003 00004 //Other includes 00005 #include <string> 00006 using namespace std; 00007 00008 namespace ispike { 00009 00014 class Bitmap { 00015 00016 public: 00017 00018 Bitmap(); 00019 Bitmap(unsigned width, unsigned height, unsigned depth); 00020 Bitmap(unsigned width, unsigned height, unsigned depth, unsigned char initVal); 00021 Bitmap(const Bitmap& copy_from_me); 00022 ~Bitmap(); 00023 Bitmap& operator=(const Bitmap& rhs); 00024 unsigned char* getContents() const { return contents; } 00025 unsigned char getPixel(unsigned x, unsigned y, unsigned d) ; 00026 unsigned getDepth() const { return depth; } 00027 unsigned getHeight() const { return height; } 00028 unsigned getWidth() const { return width; } 00029 bool isEmpty() const { return size() == 0; } 00030 void reset(unsigned width, unsigned height, unsigned depth); 00031 00033 unsigned size() const; 00034 00035 private: 00036 00037 unsigned width; 00038 unsigned height; 00039 unsigned depth; 00040 unsigned char* contents; 00041 }; 00042 00043 } 00044 00045 #endif /* BITMAP_HPP_ */