Image type: some more docs

This commit is contained in:
Olivier Goffart 2021-05-28 12:40:43 +02:00 committed by Olivier Goffart
parent 0b3fecf300
commit 8e44ac2351
4 changed files with 16 additions and 7 deletions

View file

@ -21,18 +21,20 @@ struct Image
public:
Image() : data(Data::None()) { }
/// Load an image from an image file
static Image load_from_path(const SharedString &file_path) {
Image img;
img.data = Data::AbsoluteFilePath(file_path);
return img;
}
/*
static Image load_from_argb(int width, int height, const SharedVector<uint32_t> &data) {
Image img;
img.data = Data::EmbeddedRgbaImage(width, height, data);
return img;
}
*/
friend bool operator==(const Image &a, const Image &b) {
return a.data == b.data;
}
@ -40,7 +42,6 @@ public:
return a.data != b.data;
}
private:
using Tag = cbindgen_private::types::ImageReference::Tag;
using Data = cbindgen_private::types::Image;