data(0)
{ }
+Image::Data::Data(const Data &other):
+ fmt(other.fmt),
+ width(other.width),
+ height(other.height),
+ stride(other.stride),
+ data(other.data ? new char[stride*height] : 0)
+{
+ if(data)
+ copy(other.data, other.data+stride*height, data);
+}
+
+Image::Data &Image::Data::operator=(const Data &other)
+{
+ delete[] data;
+ data = 0;
+
+ fmt = other.fmt;
+ width = other.width;
+ height = other.height;
+ stride = other.stride;
+
+ if(other.data)
+ {
+ data = new char[stride*height];
+ copy(other.data, other.data+stride*height, data);
+ }
+
+ return *this;
+}
+
Image::Data::~Data()
{
delete[] data;