71 for (QDomNode node = doc.firstChild(); !node.isNull(); node = node.nextSibling()) {
72 if (node.isElement() && node.nodeName() ==
"image") {
73 QDomElement subelem = node.toElement();
76 if (!subelem.attribute(
"w").isNull()) {
77 width = subelem.attribute(
"w").toInt();
81 if (!subelem.attribute(
"h").isNull()) {
82 height = subelem.attribute(
"h").toInt();
86 if (!subelem.attribute(
"xres").isNull()){
91 if (!subelem.attribute(
"yres").isNull()){
97 for (QDomNode node2 = node.firstChild(); !node2.isNull(); node2 = node2.nextSibling()) {
98 if (node2.isElement() && node2.nodeName() ==
"stack") {
99 QDomElement subelem2 = node2.toElement();
110 layer->
setName(elem.attribute(
"name"));
111 layer->
setX(elem.attribute(
"x").toInt());
112 layer->
setY(elem.attribute(
"y").toInt());
113 if (elem.attribute(
"visibility") ==
"hidden") {
118 if (elem.hasAttribute(
"edit-locked")) {
119 layer->
setUserLocked(elem.attribute(
"edit-locked") ==
"true");
121 if (elem.hasAttribute(
"selected") && elem.attribute(
"selected") ==
"true") {
125 QString compop = elem.attribute(
"composite-op");
126 if (compop.startsWith(
"svg:")) {
160 else if (compop.startsWith(
"krita:")) {
161 compop = compop.remove(0, 6);
171 if (elem.hasAttribute(
"alpha-preserve") && elem.attribute(
"alpha-preserve") ==
"true") {
185 dbgFile <<
"Loading was unsuccessful";
192 for (QDomNode node = elem.firstChild(); !node.isNull(); node = node.nextSibling()) {
193 if (node.isElement()) {
194 QDomElement subelem = node.toElement();
195 if (node.nodeName() ==
"stack") {
196 double opacity = 1.0;
197 if (!subelem.attribute(
"opacity").isNull()) {
201 bool passThrough =
false;
202 if (subelem.attribute(
"isolation")==
"auto") {
208 }
else if (node.nodeName() ==
"layer") {
209 QString filename = subelem.attribute(
"src");
210 if (!filename.isNull()) {
222 dbgFile <<
"Loading was successful";
225 }
else if (node.nodeName() ==
"filter") {
227 QString filterType = subelem.attribute(
"type");
228 QStringList filterTypeSplit = filterType.split(
':');
230 if (filterTypeSplit[0] ==
"applications" && filterTypeSplit[1] ==
"krita") {
234 kfc->createLocalResourcesSnapshot();
240 dbgFile <<
"Unknown element : " << node.nodeName();
const QString COMPOSITE_OVER
const QString COMPOSITE_DARKEN
const QString COMPOSITE_OVERLAY
const QString COMPOSITE_DODGE
const QString COMPOSITE_SOFT_LIGHT_SVG
const QString COMPOSITE_ADD
const QString COMPOSITE_LIGHTEN
const QString COMPOSITE_MULT
const QString COMPOSITE_SATURATION
const QString COMPOSITE_DESTINATION_ATOP
const QString COMPOSITE_HARD_LIGHT
const QString COMPOSITE_SCREEN
const QString COMPOSITE_DIFF
const QString COMPOSITE_ERASE
const QString COMPOSITE_HUE
const QString COMPOSITE_BURN
const QString COMPOSITE_COLOR
const QString COMPOSITE_DESTINATION_IN
const QString COMPOSITE_LUMINIZE
static KisFilterRegistry * instance()
static KisResourcesInterfaceSP instance()
KisGroupLayerSP rootLayer() const
KisPaintDeviceSP projection() const
void setResolution(double xres, double yres)
KisImageSP loadDeviceData(const QString &fileName)
void loadPaintLayer(const QDomElement &elem, KisPaintLayerSP pL)
void loadAdjustmentLayer(const QDomElement &elem, KisAdjustmentLayerSP pL)
KisOpenRasterStackLoadVisitor(KisUndoStore *undoStore, KisOpenRasterLoadContext *orlc)
virtual ~KisOpenRasterStackLoadVisitor()
void loadGroupLayer(const QDomElement &elem, KisGroupLayerSP groupLayer)
void loadLayerInfo(const QDomElement &elem, KisLayerSP layer)
const T value(const QString &id) const
double toDouble(const QString &str, bool *ok=nullptr)
virtual void setUserLocked(bool l)
virtual void setVisible(bool visible, bool loading=false)
void setName(const QString &name)
void setCompositeOpId(const QString &compositeOpId)
void setPassThroughMode(bool value)
void disableAlphaChannel(bool disable)
void setX(qint32 x) override
void setY(qint32 y) override
bool addNode(KisNodeSP node, KisNodeSP parent=KisNodeSP(), KisNodeAdditionFlags flags=KisNodeAdditionFlag::None)
KisOpenRasterLoadContext * loadContext
static KoColorSpaceRegistry * instance()
const KoColorSpace * rgb8(const QString &profileName=QString())