aboutsummaryrefslogtreecommitdiff
path: root/src/image.cpp
blob: e23e3f6035bfb154a3c0e8d8f1b558c4be56924e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "image.h"
#include <algorithm>
#include <cstdint>

Image::Image(const Image& other)
{
	this->colorValues = other.colorValues;
	this->bpp = other.bpp;
	
	this->width = other.width;
	this->height = other.height;
	this->bitDepth = other.bitDepth;
	this->colorType = other.colorType;
	this->compressionMethod = other.compressionMethod;
	this->filterMethod = other.filterMethod;
	this->interlaceMethod = other.interlaceMethod;
	
	unsigned long imageDataSize = width * height * bpp;
	imageData = std::make_unique<uint8_t[]>(imageDataSize);
	std::copy_n(other.imageData.get(), imageDataSize, imageData.get());
}