-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPPM.h
More file actions
58 lines (47 loc) · 1.28 KB
/
Copy pathPPM.h
File metadata and controls
58 lines (47 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#ifndef PPM_H
#define PPM_H
#include <vector>
#include <string>
#include <fstream>
#include "Pixel.h"
class PPM {
private:
std::string comment;
std::string magic;
unsigned int width;
unsigned int height;
unsigned int maxColor;
std::vector<Pixel> pixels;
public:
// Constructors
PPM();
PPM(const PPM& other);
PPM(PPM&& other) noexcept;
PPM(std::ifstream& inputFile);
// Destructor
~PPM();
// Assignment operators
PPM& operator=(const PPM& other);
PPM& operator=(PPM&& other) noexcept;
// Indexing Operators for accessing Pixels
const Pixel& operator[](unsigned int index) const;
Pixel& operator[](unsigned int index);
// Getters
std::string getComment() const;
std::string getMagic() const;
unsigned int getWidth() const;
unsigned int getHeight() const;
unsigned int getMaxColor() const;
unsigned int getSize() const;
// Setters
void setComment(std::string comment);
void setMagic(std::string magic);
void setWidth(unsigned int width);
void setHeight(unsigned int height);
void setMaxColor(unsigned int maxColor);
// Image manipulations
void resize(unsigned int newSize);
void saveImageToFile(std::string filename) const;
};
#include "PPM_cpp.h";
#endif