Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef BITMAP_H
- #define BITMAP_H
- #include <string>
- #include <cstdint>
- #include <memory>
- //Short for cave of programming. Since this is a tutorial I am following in there
- namespace cop
- {
- class Bitmap
- {
- private:
- int m_width{ 0 };
- int m_height{ 0 };
- std::unique_ptr<uint8_t[]> m_pPixel{nullptr}; //Here I have the unique pointer
- public:
- Bitmap(int witdh, int height);
- //Set a pixel to a color
- void setPixel(int x, int y, uint8_t red, uint8_t green, uint8_t blue);
- //Check whether we can or can't write a file to disk
- bool write(std::string filename);
- ~Bitmap();
- };
- }
- #endif //BITMAP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement