Krita Source Code Documentation
Loading...
Searching...
No Matches
KisDlgAnimationRenderer.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Boudewijn Rempt <boud@valdyas.org>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6#ifndef DLG_ANIMATIONRENDERERIMAGE
7#define DLG_ANIMATIONRENDERERIMAGE
8
9#include <KoDialog.h>
11
12#include "ui_wdg_animationrenderer.h"
13
14#include <kis_types.h>
15
16#ifdef Q_OS_ANDROID
17#include <QVariantMap>
18#endif
19
20#include "kritaui_export.h"
21
22class KisDocument;
24class KisConfigWidget;
25class QButtonGroup;
26class QHBoxLayout;
30
31class WdgAnimationRenderer : public QWidget, public Ui::WdgAnimationRenderer
32{
33 Q_OBJECT
34
35public:
36 WdgAnimationRenderer(QWidget *parent)
37 : QWidget(parent)
38 {
39 setupUi(this);
40 }
41};
42
43class KRITAUI_EXPORT KisDlgAnimationRenderer: public KoDialog
44{
45
46 Q_OBJECT
47
48public:
49
50 KisDlgAnimationRenderer(KisDocument *doc, QWidget *parent = 0);
51 ~KisDlgAnimationRenderer() override;
52
53 KisAnimationRenderingOptions getEncoderOptions() const;
54
55private Q_SLOTS:
56#ifndef Q_OS_ANDROID
57 void selectRenderType(int i);
58#endif
59 void selectRenderOptions();
64 void sequenceMimeTypeOptionsClicked();
65
66 void slotLockAspectRatioDimensionsWidth(int width);
67 void slotLockAspectRatioDimensionsHeight(int height);
68
69 void slotExportTypeChanged();
70 void slotRenderTypeChanged();
71#ifndef Q_OS_ANDROID
72 void setFFmpegPath(const QString& path);
73#endif
74
75 void slotCheckWarnings();
76
77 static void setPngHdr(KisPropertiesConfigurationSP cfg, bool enable = true);
78 static bool getPngHdr(KisPropertiesConfigurationSP cfg, bool wantsRenderWithHdr);
79
80protected Q_SLOTS:
81#ifndef Q_OS_ANDROID
82 void slotButtonClicked(int button) override;
83#endif
84 void slotDialogAccepted();
85
86
87private:
88#ifndef Q_OS_ANDROID
90 VALID = 1,
92 NOT_A_BINARY = -1,
93 COMPRESSED_FORMAT = -2
94 };
95#endif
96
97 void initializeRenderSettings(const KisDocument &doc, const KisAnimationRenderingOptions &lastUsedOptions);
98
99 bool wantImageSequenceExport() const;
100 bool wantVideoExport() const;
101
102 void updateWarnings();
103
104#ifndef Q_OS_ANDROID
105 FFmpegValidationResult validateFFmpeg(const QString &ffmpegPath);
106
107 static QString defaultVideoFileName(KisDocument *doc, const QString &mimeType);
108
109 static void getDefaultVideoEncoderOptions(const QString &mimeType,
111 const QStringList &availableEncoders,
112 QString *customFFMpegOptionsString,
113 bool *forceHDRVideo);
114#endif
115
116 static void filterSequenceMimeTypes(QStringList &mimeTypes);
117
118#ifndef Q_OS_ANDROID
119 static QStringList makeVideoMimeTypesList();
120 QStringList filterMimeTypeListByAvailableEncoders(const QStringList &mimeTypes);
121#endif
122 static bool imageMimeSupportsHDR(QString &hdr);
123
124#ifdef Q_OS_ANDROID
125 static QVariantMap loadVideoFormatPreferences();
126 static void saveVideoFormatPreferences(const QVariantMap &value);
127#endif
128
129 static KisPropertiesConfigurationSP loadLastConfiguration(QString configurationID);
130 static void saveLastUsedConfiguration(QString configurationID, KisPropertiesConfigurationSP config);
131
132 static bool looksLikeGif(const QString &videoType);
133 static bool supportsAudio(const QString &videoType);
134
135private:
136 KisHDRMetadataOptions optionsFromImage();
137
140
141#ifdef Q_OS_ANDROID
142 QButtonGroup *m_exportButtonGroup;
143 QString m_imageDirectory;
144 QString m_videoFileName;
145 QVariantMap m_videoFormatPreferences;
146#else
148 QString ffmpegVersion = "None";
149
150 QStringList ffmpegCodecs = QStringList(); // List of all supported output formats.
151 QMap<QString, QStringList> ffmpegEncoderTypes; // Maps supported output format to available list of encoder(s)
152
153 bool m_wantsRenderWithHDR = false;
154#endif
155
157};
158
159#endif // DLG_ANIMATIONRENDERERIMAGE
float value(const T *src, size_t ch)
QList< QString > QStringList
QMap< QString, QStringList > ffmpegEncoderTypes
The base class for import and export filters.
A dialog base class with standard buttons and predefined layouts.
Definition KoDialog.h:116
virtual void slotButtonClicked(int button)
Definition KoDialog.cpp:811
WdgAnimationRenderer(QWidget *parent)
@ INVALID
Definition kis_brush.h:31
QString button(const QWheelEvent &ev)