-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathImage.cpp
More file actions
49 lines (49 loc) · 1.36 KB
/
Image.cpp
File metadata and controls
49 lines (49 loc) · 1.36 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
#include "Image.h"
Image::Image() : width(0),height(0),maxColor(0){
magicNumber = "";
name = "";
}
Image::Image(const char* mN, unsigned int w, unsigned int h, const char* n, unsigned int mC) : width(w), height(h),maxColor(mC) {
magicNumber = mN;
name = n;
}
Image::Image (std::string mN, unsigned int w, unsigned int h, std::string n, unsigned int mC) : width(w), height(h), maxColor(mC) {
magicNumber = mN;
name = n;
}
Image::Image(const Image& other) {
magicNumber = other.magicNumber;
width = other.width;
height = other.height;
name = other.name;
maxColor = other.maxColor;
}
Image& Image::operator=(const Image& other) {
if (this != &other) {
magicNumber = other.magicNumber;
width = other.width;
height = other.height;
name = other.name;
maxColor = other.maxColor;
}
return *this;
}
Image::~Image() {}
void Image::getInfo() {
std::cout << "Width:" << width << "\nHeight: " << height << "\nName: " << name << "\nMaximal Number for Color: " << maxColor;
}
void Image::setMagicNumber(const char* mN) {
magicNumber = mN;
}
void Image::setName(std::string n) {
name = n;
}
void Image::setWidth(int w) {
width = w;
}
void Image::setHeight(int h) {
height = h;
}
Image* Image::getCopy() {
return nullptr;
}