Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- class Image {
- int type;
- syze_t width, height;
- unsigned char *data;
- public:
- void Read (const std::string&);
- void Write (const std::string&);
- int Type() const;
- };
- void Read(const std::string&) {
- std::ifstream in("task1.pgm", "rb");
- std::string a;
- a = in.getline();
- if (a == "P2") type = 2;
- else if (a == "P3") type = 3;
- else if (a == "P5") type = 5;
- else if (a == "P6") type = 6;
- else throw std::string ("unsupported type");
- char c
- }
- int main () {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement