#include "Bitmap.h" #include namespace msdfgen { template Bitmap::Bitmap() : content(NULL), w(0), h(0) { } template Bitmap::Bitmap(int width, int height) : w(width), h(height) { content = new T[w*h]; } template Bitmap::Bitmap(const Bitmap &orig) : w(orig.w), h(orig.h) { content = new T[w*h]; memcpy(content, orig.content, w*h*sizeof(T)); } #ifdef MSDFGEN_USE_CPP11 template Bitmap::Bitmap(Bitmap &&orig) : content(orig.content), w(orig.w), h(orig.h) { orig.content = NULL; } #endif template Bitmap::~Bitmap() { delete [] content; } template Bitmap & Bitmap::operator=(const Bitmap &orig) { delete [] content; w = orig.w, h = orig.h; content = new T[w*h]; memcpy(content, orig.content, w*h*sizeof(T)); return *this; } #ifdef MSDFGEN_USE_CPP11 template Bitmap & Bitmap::operator=(Bitmap &&orig) { delete [] content; content = orig.content; w = orig.w, h = orig.h; orig.content = NULL; return *this; } #endif template int Bitmap::width() const { return w; } template int Bitmap::height() const { return h; } template T & Bitmap::operator()(int x, int y) { return content[y*w+x]; } template const T & Bitmap::operator()(int x, int y) const { return content[y*w+x]; } template class Bitmap; template class Bitmap; }