Krita Source Code Documentation
Loading...
Searching...
No Matches
HeifExport.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Dirk Farin <farin@struktur.de>
3 * SPDX-FileCopyrightText: 2020-2021 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
4 * SPDX-FileCopyrightText: 2021 Daniel Novomesky <dnovomesky@gmail.com>
5 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
6 *
7 * SPDX-License-Identifier: GPL-2.0-or-later
8 */
9
10#ifndef HEIF_EXPORT_H_
11#define HEIF_EXPORT_H_
12
13#include <QVariant>
14
16#include <kis_config_widget.h>
17
19#include "ui_WdgHeifExport.h"
20
21class KisWdgOptionsHeif : public KisConfigWidget, public Ui::WdgHeifExport
22{
23 Q_OBJECT
24
25public:
26 KisWdgOptionsHeif(QWidget *parent)
27 : KisConfigWidget(parent)
28 {
29 setupUi(this);
30 connect(chkLossless, SIGNAL(toggled(bool)), SLOT(toggleQualitySlider(bool)));
31 connect(chkHLGOOTF, SIGNAL(toggled(bool)), SLOT(toggleQualitySlider(bool)));
32 connect(cmbConversionPolicy, SIGNAL(currentIndexChanged(int)), SLOT(toggleExtraHDROptions(int)));
33 sliderQuality->setRange(0, 100, 0);
34 }
35
36 void setConfiguration(const KisPropertiesConfigurationSP cfg) override;
38
39private Q_SLOTS:
40
41 void toggleQualitySlider(bool toggle);
42 // Disable HLG OOTF options when the toggle is off.
43 void toggleHLGOptions(bool toggle);
44 // Disable all HLG options when the index is not for an HLG option.
45 void toggleExtraHDROptions(int index);
46private:
47
48 bool m_hasAlpha {false};
49
50};
51
52
54{
55 Q_OBJECT
56public:
57 HeifExport(QObject *parent, const QVariantList &);
58 ~HeifExport() override;
59
60 // This should return true if the library can work with a QIODevice, and doesn't want to open the file by itself
61 bool supportsIO() const override { return true; }
62
63 KisImportExportErrorCode convert(KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP configuration = 0) override;
64 KisPropertiesConfigurationSP defaultConfiguration(const QByteArray& from = "", const QByteArray& to = "") const override;
65 KisConfigWidget *createConfigurationWidget(QWidget *parent, const QByteArray& from = "", const QByteArray& to = "") const override;
66 void initializeCapabilities() override;
67};
68
69#endif
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
void initializeCapabilities() override
~HeifExport() override
KisConfigWidget * createConfigurationWidget(QWidget *parent, const QByteArray &from="", const QByteArray &to="") const override
createConfigurationWidget creates a widget that can be used to define the settings for a given import...
KisImportExportErrorCode convert(KisDocument *document, QIODevice *io, KisPropertiesConfigurationSP configuration=0) override
bool supportsIO() const override
Override and return false for the filters that use a library that cannot handle file handles,...
Definition HeifExport.h:61
KisPropertiesConfigurationSP defaultConfiguration(const QByteArray &from="", const QByteArray &to="") const override
defaultConfiguration defines the default settings for the given import export filter
HeifExport(QObject *parent, const QVariantList &)
The base class for import and export filters.
KisPropertiesConfigurationSP configuration() const override
void toggleQualitySlider(bool toggle)
void toggleHLGOptions(bool toggle)
void setConfiguration(const KisPropertiesConfigurationSP cfg) override
KisWdgOptionsHeif(QWidget *parent)
Definition HeifExport.h:26
void toggleExtraHDROptions(int index)