fmt(RGB),
width(0),
height(0),
- data(0)
+ pixels(0)
{ }
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;
Image::Data::~Data()
{
- delete[] data;
+ delete[] pixels;
}