X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fimage.h;h=3f8f556e85a42fa88e5f7f886918037b3143434e;hb=3c5bbaeadb33d288c0f9e487b52904b7ed7e4319;hp=6905461a49557ed64df428902e538d85a9d271fc;hpb=8e403dbbcde6efee1862f6d501ce30a3e7ba81c4;p=libs%2Fgui.git diff --git a/source/graphics/image.h b/source/graphics/image.h index 6905461..3f8f556 100644 --- a/source/graphics/image.h +++ b/source/graphics/image.h @@ -16,12 +16,16 @@ class Image public: struct Data { - PixelFormat fmt; - unsigned width; - unsigned height; - char *data; - - Data(); + PixelFormat fmt = RGB; + unsigned width = 0; + unsigned height = 0; + unsigned stride = 0; + char *owned_pixels = nullptr; + char *pixels = nullptr; + + Data() = default; + Data(const Data &); + Data &operator=(const Data &); ~Data(); }; @@ -32,11 +36,15 @@ public: void load_file(const std::string &); 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