1 #include <msp/core/refptr.h>
2 #include <msp/fs/utils.h>
3 #include <msp/io/file.h>
4 #include <msp/io/memory.h>
6 #include "imageloader.h"
20 Image::Data::Data(const Data &other):
25 data(other.data ? new char[stride*height] : 0)
28 copy(other.data, other.data+stride*height, data);
31 Image::Data &Image::Data::operator=(const Data &other)
38 height = other.height;
39 stride = other.stride;
43 data = new char[stride*height];
44 copy(other.data, other.data+stride*height, data);
56 void Image::load_file(const string &fn)
58 RefPtr<ImageLoader> loader = ImageLoader::open_file(fn);
62 void Image::load_io(IO::Seekable &io)
64 RefPtr<ImageLoader> loader = ImageLoader::open_io(io);
68 void Image::load(ImageLoader &loader)
73 } // namespace Graphics