Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • app
  • src
importimageseqdialog.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17
18#ifndef IMPORTIMAGESEQDIALOG_H
19#define IMPORTIMAGESEQDIALOG_H
20
21#include "importexportdialog.h"
22#include "pencilerror.h"
23#include "predefinedsetmodel.h"
24#include "importimageconfig.h"
25
26class Editor;
27
28namespace Ui {
29class ImportImageSeqOptions;
30class ImportImageSeqPreviewGroupBox;
31}
32
33struct PredefinedKeySetParams
34{
35 int dot = 0;
36 int digits = 0;
37 QStringList filenames;
38 QStringList absolutePaths;
39 QString folderPath;
40 QString prefix;
41};
42
43enum ImportCriteria { Arbitrary, PredefinedSet };
44
45class ImportImageSeqDialog : public ImportExportDialog
46{
47 Q_OBJECT
48
49public:
50 explicit ImportImageSeqDialog(QWidget *parent = nullptr,
51 Mode mode = ImportExportDialog::Import,
52 FileType fileType = FileType::IMAGE_SEQUENCE,
53 ImportCriteria importCriteria = ImportCriteria::Arbitrary);
54 ~ImportImageSeqDialog() override;
55
56 void importArbitrarySequence(const ImportImageConfig importImageConfig);
57 void importPredefinedSet(const ImportImageConfig importImageConfig);
58 int getSpace();
59
60 void setCore(Editor* editor) { mEditor = editor; }
61
62signals:
63 void notifyAnimationLengthChanged();
64
65protected:
66 Mode getMode();
67 FileType getFileType();
68
69private slots:
70 void setSpace(int number);
71 void updatePreviewList(const QStringList& list);
72
73 const PredefinedKeySetParams predefinedKeySetParams() const;
74
75private:
76 int keyFramePosFromFilePath(const QString& path);
77
78private:
79 const PredefinedKeySet generatePredefinedKeySet() const;
80 void setPreviewModel(const PredefinedKeySet& predefinedKeySet);
81 void setupLayout();
82 void setupPredefinedLayout();
83 Status validateKeySet(const PredefinedKeySet& keySet, const QStringList& filepaths);
84 Status validateFiles(const QStringList& filepaths);
85
86 Ui::ImportImageSeqOptions *uiOptionsBox;
87 Ui::ImportImageSeqPreviewGroupBox *uiGroupBoxPreview;
88
89 QStringList getFilePaths();
90
91 Editor* mEditor = nullptr;
92 QWidget* mParent = nullptr;
93 ImportCriteria mImportCriteria = ImportCriteria::Arbitrary;
94 FileType mFileType = FileType::IMAGE_SEQUENCE;
95};
96
97#endif // IMPORTIMAGESEQDIALOG_H
Editor
Definition: editor.h:71
ImportExportDialog
Definition: importexportdialog.h:32
ImportImageSeqDialog
Definition: importimageseqdialog.h:46
Status
Definition: pencilerror.h:40
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QString
QStringList
QWidget
ImportImageConfig
Definition: importimageconfig.h:22
PredefinedKeySet
Definition: predefinedsetmodel.h:25
PredefinedKeySetParams
Definition: importimageseqdialog.h:34
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39