11#include <QApplication>
13#include <kpluginfactory.h>
53 options.
alpha = configuration->getBool(
"alpha",
true);
54 options.
interlace = configuration->getBool(
"interlaced",
false);
55 options.
compression = configuration->getInt(
"compression", 3);
60 options.
saveSRGBProfile = configuration->getBool(
"saveSRGBProfile",
false);
61 options.
forceSRGB = configuration->getBool(
"forceSRGB",
true);
62 options.
storeAuthor = configuration->getBool(
"storeAuthor",
false);
63 options.
storeMetaData = configuration->getBool(
"storeMetaData",
false);
64 options.
saveAsHDR = configuration->getBool(
"saveAsHDR",
false);
65 options.
downsample = configuration->getBool(
"downsample",
false);
92 cfg->setProperty(
"alpha",
true);
93 cfg->setProperty(
"indexed",
false);
94 cfg->setProperty(
"compression", 3);
95 cfg->setProperty(
"interlaced",
false);
101 v.setValue(fill_color);
103 cfg->setProperty(
"transparencyFillcolor",
v);
104 cfg->setProperty(
"saveSRGBProfile",
false);
105 cfg->setProperty(
"forceSRGB",
true);
106 cfg->setProperty(
"saveAsHDR",
false);
107 cfg->setProperty(
"storeMetaData",
false);
108 cfg->setProperty(
"storeAuthor",
false);
109 cfg->setProperty(
"downsample",
false);
122 supportedColorModels << QPair<KoID, KoID>()
147 alpha->setChecked(cfg->getBool(
"alpha", isThereAlpha));
149 bnTransparencyFillColor->setEnabled(!alpha->isChecked());
152 tryToSaveAsIndexed->setVisible(
true);
153 if (alpha->isChecked()) {
154 tryToSaveAsIndexed->setChecked(
false);
157 tryToSaveAsIndexed->setChecked(cfg->getBool(
"indexed",
false));
161 tryToSaveAsIndexed->setVisible(
false);
163 interlacing->setChecked(cfg->getBool(
"interlaced",
false));
164 compressionLevel->setValue(cfg->getInt(
"compression", 3));
165 compressionLevel->setRange(1, 9, 0);
167 tryToSaveAsIndexed->setVisible(!isThereAlpha);
172 chkSRGB->setChecked(cfg->getBool(
"saveSRGBProfile",
true));
175 chkForceSRGB->setChecked(cfg->getBool(
"forceSRGB",
false));
177 chkSaveAsHDR->setChecked(cfg->getBool(
"saveAsHDR",
false));
180 chkAuthor->setChecked(cfg->getBool(
"storeAuthor",
false));
181 chkMetaData->setChecked(cfg->getBool(
"storeMetaData",
false));
185 bnTransparencyFillColor->setDefaultColor(background);
186 bnTransparencyFillColor->setColor(cfg->getColor(
"transparencyFillcolor", background));
188 chkDownsample->setChecked(cfg->getBool(
"downsample",
false));
196 bool alpha = this->alpha->isChecked();
197 bool interlace = interlacing->isChecked();
198 int compression = (int)compressionLevel->value();
199 bool saveAsHDR = chkSaveAsHDR->isChecked();
200 bool tryToSaveAsIndexed = !saveAsHDR && this->tryToSaveAsIndexed->isChecked();
201 bool saveSRGB = !saveAsHDR && chkSRGB->isChecked();
202 bool forceSRGB = !saveAsHDR && chkForceSRGB->isChecked();
203 bool storeAuthor = chkAuthor->isChecked();
204 bool storeMetaData = chkMetaData->isChecked();
205 bool downsample = chkDownsample->isChecked();
208 QVariant transparencyFillcolor;
209 transparencyFillcolor.setValue(bnTransparencyFillColor->color());
211 cfg->setProperty(
"alpha", alpha);
212 cfg->setProperty(
"indexed", tryToSaveAsIndexed);
213 cfg->setProperty(
"compression", compression);
214 cfg->setProperty(
"interlaced", interlace);
215 cfg->setProperty(
"transparencyFillcolor", transparencyFillcolor);
216 cfg->setProperty(
"saveAsHDR", saveAsHDR);
217 cfg->setProperty(
"saveSRGBProfile", saveSRGB);
218 cfg->setProperty(
"forceSRGB", forceSRGB);
219 cfg->setProperty(
"storeAuthor", storeAuthor);
220 cfg->setProperty(
"storeMetaData", storeMetaData);
221 cfg->setProperty(
"downsample", downsample);
227 bnTransparencyFillColor->setEnabled(!checked);
232 tryToSaveAsIndexed->setDisabled(
value);
233 chkForceSRGB->setDisabled(
value);
234 chkSRGB->setDisabled(
value);
237#include "kis_png_export.moc"
float value(const T *src, size_t ch)
VertexDescriptor get(PredecessorMap const &m, VertexDescriptor v)
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
const KoID RGBAColorModelID("RGBA", ki18n("RGB/Alpha"))
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
The KisExifInfoVisitor class looks for a layer with metadata.
KisMetaData::Store * exifInfo()
bool visit(KisNode *) override
static KisExportCheckRegistry * instance()
vKisAnnotationSP_it endAnnotations()
KisGroupLayerSP rootLayer() const
KisPaintDeviceSP projection() const
QRect bounds() const override
vKisAnnotationSP_it beginAnnotations()
The base class for import and export filters.
static const QString ColorModelIDTag
void addSupportedColorModels(QList< QPair< KoID, KoID > > supportedColorModels, const QString &name, KisExportCheckBase::Level level=KisExportCheckBase::PARTIALLY)
static const QString ImageContainsTransparencyTag
static const QString sRGBTag
void addCapability(KisExportCheckBase *capability)
KisImportExportErrorCode buildFile(const QString &filename, const QRect &imageRect, const qreal xRes, const qreal yRes, KisPaintDeviceSP device, vKisAnnotationSP_it annotationsStart, vKisAnnotationSP_it annotationsEnd, KisPNGOptions options, KisMetaData::Store *metaData)
KisPropertiesConfigurationSP defaultConfiguration(const QByteArray &from="", const QByteArray &to="") const override
defaultConfiguration defines the default settings for the given import export filter
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
void initializeCapabilities() override
KisPNGExport(QObject *parent, const QVariantList &)
KisWdgOptionsPNG(QWidget *parent)
void slotUseHDRChanged(bool value)
void on_alpha_toggled(bool checked)
KisPropertiesConfigurationSP configuration() const override
void setConfiguration(const KisPropertiesConfigurationSP config) override
void fromQColor(const QColor &c)
Convenient function for converting from a QColor.
K_PLUGIN_FACTORY_WITH_JSON(KritaASCCDLFactory, "kritaasccdl.json", registerPlugin< KritaASCCDL >();) KritaASCCDL
#define KIS_SAFE_ASSERT_RECOVER_NOOP(cond)
vKisAnnotationSP::iterator vKisAnnotationSP_it
QColor transparencyFillColor
static KoColorSpaceRegistry * instance()