File indexing completed on 2024-12-22 04:12:16
0001 /* 0002 * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <dimula73@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef VIDEO_EXPORT_OPTIONS_DIALOG_H 0008 #define VIDEO_EXPORT_OPTIONS_DIALOG_H 0009 0010 #include <kis_config_widget.h> 0011 #include <kis_properties_configuration.h> 0012 0013 #include "KisVideoSaver.h" 0014 0015 #include <QScopedPointer> 0016 0017 namespace Ui { 0018 class VideoExportOptionsDialog; 0019 } 0020 0021 class KisVideoExportOptionsDialog : public KisConfigWidget 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 enum ContainerType { 0027 DEFAULT = 0, 0028 MP4 = 0, 0029 MKV, 0030 WEBM, 0031 GIF, 0032 APNG, 0033 WEBP, 0034 OGV, 0035 NUM_CONTAINER_TYPE 0036 }; 0037 0038 enum CodecPageIndex { 0039 CODEC_OPENH264, 0040 CODEC_H264, 0041 CODEC_H265, 0042 CODEC_THEORA, 0043 CODEC_VP9, 0044 CODEC_GIF, 0045 CODEC_APNG, 0046 CODEC_WEBP 0047 }; 0048 0049 public: 0050 explicit KisVideoExportOptionsDialog(ContainerType containerType, const QStringList& validEncoders, QWidget *parent = 0); 0051 ~KisVideoExportOptionsDialog() override; 0052 0053 void setSupportsHDR(bool value); 0054 0055 QStringList customUserOptions() const; 0056 QString customUserOptionsString() const; 0057 bool videoConfiguredForHDR() const; 0058 void setHDRConfiguration(bool value); 0059 0060 void setConfiguration(const KisPropertiesConfigurationSP config) override; 0061 KisPropertiesConfigurationSP configuration() const override; 0062 0063 static ContainerType mimeToContainer(const QString & mimeType); 0064 static QVector<KoID> encoderIdentifiers(ContainerType type); 0065 0066 private Q_SLOTS: 0067 void slotCustomLineToggled(bool value); 0068 void slotSaveCustomLine(); 0069 void slotResetCustomLine(); 0070 0071 void slotCodecSelected(int index); 0072 0073 void slotH265ProfileChanged(int index); 0074 void slotEditHDRMetadata(); 0075 void slotBayerFilterSelected(int index); 0076 0077 private: 0078 Ui::VideoExportOptionsDialog *ui; 0079 0080 private: 0081 QStringList generateCustomLine() const; 0082 0083 QString currentCodecId() const; 0084 0085 private: 0086 struct Private; 0087 const QScopedPointer<Private> m_d; 0088 }; 0089 0090 #endif // VIDEO_EXPORT_OPTIONS_DIALOG_H