]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/image.h
Use nullptr in place of 0 or NULL
[libs/gui.git] / source / graphics / image.h
index 86cfa4589824d9413fbb5996f6e695d4a2e8a93f..3f8f556e85a42fa88e5f7f886918037b3143434e 100644 (file)
@@ -16,13 +16,14 @@ class Image
 public:
        struct Data
        {
-               PixelFormat fmt;
-               unsigned width;
-               unsigned height;
-               unsigned stride;
-               char *pixels;
-
-               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();
@@ -35,6 +36,8 @@ 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; }