File indexing completed on 2025-01-05 04:01:16

0001 /*
0002  * SPDX-FileCopyrightText: 2019-2023 Mattia Basaglia <dev@dragon.best>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #pragma once
0008 
0009 #include <QImageReader>
0010 
0011 #include "io/base.hpp"
0012 #include "io/io_registry.hpp"
0013 
0014 namespace glaxnimate::io::raster {
0015 
0016 
0017 class SpritesheetFormat : public ImportExport
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     QString slug() const override { return "spritesheet"; }
0023     QString name() const override { return i18n("Sprite Sheet"); }
0024     QStringList extensions() const override;
0025 
0026     std::unique_ptr<app::settings::SettingsGroup> save_settings(model::Composition* comp) const override;
0027 
0028     bool can_save() const override { return true; }
0029     bool can_open() const override { return false; }
0030     int priority() const override { return -2; }
0031 
0032 protected:
0033     bool on_save(QIODevice & file, const QString & filename, model::Composition* comp, const QVariantMap & setting_values) override;
0034 
0035 private:
0036     static Autoreg<SpritesheetFormat> autoreg;
0037 };
0038 
0039 
0040 } // namespace glaxnimate::io::raster
0041 
0042