]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/image.cpp
Rename Image::Data::data to pixels
[libs/gui.git] / source / graphics / image.cpp
index a0e6e380ad24d54b20c5144c6001208147f9dbc5..e22d8eaef79958eb7ff83d389de018d0365c53c5 100644 (file)
@@ -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;
 }