X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fgraphics%2Fimage.cpp;h=e22d8eaef79958eb7ff83d389de018d0365c53c5;hb=b74b0945b2e19c32f05d8bcb016cc9434c99979d;hp=a0e6e380ad24d54b20c5144c6001208147f9dbc5;hpb=d3bc6c9c2cfaaedaabfd4b5b7bf4e1da2de51331;p=libs%2Fgui.git diff --git a/source/graphics/image.cpp b/source/graphics/image.cpp index a0e6e38..e22d8ea 100644 --- a/source/graphics/image.cpp +++ b/source/graphics/image.cpp @@ -14,7 +14,7 @@ Image::Data::Data(): fmt(RGB), width(0), height(0), - data(0) + pixels(0) { } Image::Data::Data(const Data &other): @@ -22,26 +22,26 @@ Image::Data::Data(const Data &other): width(other.width), height(other.height), stride(other.stride), - data(other.data ? new char[stride*height] : 0) + pixels(other.pixels ? new char[stride*height] : 0) { - if(data) - copy(other.data, other.data+stride*height, data); + if(pixels) + copy(other.pixels, other.pixels+stride*height, pixels); } Image::Data &Image::Data::operator=(const Data &other) { - delete[] data; - data = 0; + delete[] pixels; + pixels = 0; fmt = other.fmt; width = other.width; height = other.height; stride = other.stride; - if(other.data) + if(other.pixels) { - data = new char[stride*height]; - copy(other.data, other.data+stride*height, data); + pixels = new char[stride*height]; + copy(other.pixels, other.pixels+stride*height, pixels); } return *this; @@ -49,7 +49,7 @@ Image::Data &Image::Data::operator=(const Data &other) Image::Data::~Data() { - delete[] data; + delete[] pixels; }