1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 22:17:44 +00:00

PixelPaint: Support opening more image file formats

Previously we could only open .pp files, now we can open all formats
supported by Gfx::Bitmap::load_from_file
This commit is contained in:
Marco Cutecchia 2021-06-01 08:34:40 +02:00 committed by Andreas Kling
parent 566d3cb393
commit 76adac103e
3 changed files with 34 additions and 3 deletions

View file

@ -37,7 +37,8 @@ protected:
class Image : public RefCounted<Image> {
public:
static RefPtr<Image> create_with_size(const Gfx::IntSize&);
static RefPtr<Image> create_from_file(const String& file_path);
static RefPtr<Image> create_from_file(String const& file_path);
static RefPtr<Image> create_from_bitmap(RefPtr<Gfx::Bitmap> bitmap);
size_t layer_count() const { return m_layers.size(); }
const Layer& layer(size_t index) const { return m_layers.at(index); }
@ -74,6 +75,8 @@ public:
private:
explicit Image(const Gfx::IntSize&);
static RefPtr<Image> create_from_pixel_paint_file(String const& file_path);
void did_change();
void did_modify_layer_stack();