mirror of
https://github.com/yuzu-emu/FasTC.git
synced 2025-01-09 04:05:37 +00:00
Add assignment operator
This commit is contained in:
parent
26005bfd27
commit
b3a07e21f7
|
@ -84,6 +84,14 @@ Image::Image(const Image &other)
|
||||||
memcpy(m_Pixels, other.m_Pixels, m_Width * m_Height * sizeof(Pixel));
|
memcpy(m_Pixels, other.m_Pixels, m_Width * m_Height * sizeof(Pixel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Image &Image::operator=(const Image &other) {
|
||||||
|
m_Width = other.m_Width;
|
||||||
|
m_Height = other.m_Height;
|
||||||
|
m_Pixels = new Pixel[other.m_Width * other.m_Height];
|
||||||
|
memcpy(m_Pixels, other.m_Pixels, m_Width * m_Height * sizeof(Pixel));
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
Image::~Image() {
|
Image::~Image() {
|
||||||
assert(m_Pixels);
|
assert(m_Pixels);
|
||||||
delete [] m_Pixels;
|
delete [] m_Pixels;
|
||||||
|
|
|
@ -65,6 +65,7 @@ class Image {
|
||||||
Image(uint32 height, uint32 width);
|
Image(uint32 height, uint32 width);
|
||||||
Image(uint32 height, uint32 width, const Pixel *pixels);
|
Image(uint32 height, uint32 width, const Pixel *pixels);
|
||||||
Image(const Image &);
|
Image(const Image &);
|
||||||
|
Image &operator=(const Image &);
|
||||||
~Image();
|
~Image();
|
||||||
|
|
||||||
void BilinearUpscale(uint32 times, EWrapMode wrapMode = eWrapMode_Clamp);
|
void BilinearUpscale(uint32 times, EWrapMode wrapMode = eWrapMode_Clamp);
|
||||||
|
|
Loading…
Reference in a new issue