X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fimage.h;h=51147cefdcf341a882a426933efe52576721d155;hb=917c43de100807f4397e36b66b1a748dbf44370e;hp=bfaeef84a00fbf7b945dbac8cc51d0fc593673bd;hpb=cfd3548464e6424fc9decf0539d6cd04b031ba10;p=libs%2Fgui.git diff --git a/source/graphics/image.h b/source/graphics/image.h index bfaeef8..51147ce 100644 --- a/source/graphics/image.h +++ b/source/graphics/image.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include "pixelformat.h" namespace Msp { @@ -19,9 +19,13 @@ public: PixelFormat fmt; unsigned width; unsigned height; - char *data; + unsigned stride; + char *owned_pixels; + char *pixels; Data(); + Data(const Data &); + Data &operator=(const Data &); ~Data(); }; @@ -30,13 +34,17 @@ private: public: void load_file(const std::string &); - void load_io(IO::Base &); + void load_io(IO::Seekable &); void load(ImageLoader &); + void load_into(ImageLoader &, void *); + void load_headers(ImageLoader &); PixelFormat get_format() const { return data.fmt; } unsigned get_width() const { return data.width; } unsigned get_height() const { return data.height; } - const void *get_data() const { return data.data; } + unsigned get_stride() const { return data.stride; } + DEPRECATED const void *get_data() const { return data.pixels; } + const void *get_pixels() const { return data.pixels; } }; } // namespace Graphics