class ExportConverter {
}
class MergeDown : public ExportConverter {
}
class ConvertToRgb : public ExportConverter {
}
list (id, Covnerter)
class ImportExportCheck {
enum Level {
block, // COnversion is needed, otherwise we cannot save
warn, // We will save this, but the result might be degraded
go // We fully support this, yay
}
ImportExportCheck(Level level, customWarning)
Level check();
QString warning();
bool convert();
}
class RgbU8Check : public ImportExportCheck
{
check() {
image->colorSpace9) == RGBU8
}
convert() {
return converterId;
}
}
// Means: we can save multiple layers
class SingleLayerCheck : public ImpexCheck {
check() {
return image->layercount == 1
}
convert() {
// merge down to one layer or just get the projection and replace layerstack
}
warning() {
File format X does not support multiple layers, your image will be merged down, and make sure you also save as KRA because if you ond't you're effed.
}
}
class LayerStyleCheck : public ImpexCheck {
convert() {
if (filtercaps.contains(singlelayercheck && singlelayercheck = go)
ask: merge down, skip styles or save layers & merged imafge as a new layer
}
}
}
conversion checker
list of checks
- singlelayercheck GO
- RgbU8Check WARN
if (check == BLOCK) {
converters << check->converter
}
- LayerStyleCheck -> not in document, skip
...
converters.sort(priority) // unique set
foreach(converter) convert;
// check blockers
all checks that are not in the capabilities
check whether those are used
all warnings in the capabilities
check whether those are used
if warnings, the image is not marked as saved, it's still dirty
impexfilter
list<checks> capabilities() {
list<checks> list;
list << check(warn, "message")
list << check(go)
}
Export To PNG
PNG does not support the following feature you are using in your image:
* Multiple Layers
* 32 bit floating point
* LAB
* Layer Styles
* Filter Layers
* And the kitchen sink
Krita will convert your image before export to PNG:
* Flatten
* Convert to RGB
If you don't want to lose your image, also save as KRA
Save, Cancel