25 lines
473 B
C++
25 lines
473 B
C++
#ifndef DEMO_BITMAP_HPP
|
|
#define DEMO_BITMAP_HPP
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class Bitmap {
|
|
public:
|
|
Bitmap();
|
|
explicit Bitmap(const std::string &file);
|
|
void load(const std::string &file);
|
|
int getWidth();
|
|
int getHeight();
|
|
char *getData();
|
|
int getBitsPerPixel();
|
|
unsigned int getPixel(int x, int y);
|
|
private:
|
|
int width;
|
|
int height;
|
|
int offset;
|
|
int bitsPerPixel;
|
|
std::vector<char> data;
|
|
};
|
|
#endif //DEMO_BITMAP_HPP
|