Commit 8267c043 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Implement loading/saving of Colorize Masks

parent 5ba2ed29
......@@ -220,6 +220,21 @@ bool loadValue(const QDomElement &e, QVector<T> *array)
return true;
}
template <typename T, typename E>
bool loadValue(const QDomElement &e, QVector<T> *array, const E &env)
{
if (!Private::checkType(e, "array")) return false;
QDomElement child = e.firstChildElement();
while (!child.isNull()) {
T value;
if (!loadValue(child, &value, env)) return false;
*array << value;
child = child.nextSiblingElement();
}
return true;
}
template <typename T>
bool loadValue(const QDomElement &parent, const QString &tag, T *value)
{
......@@ -229,6 +244,17 @@ bool loadValue(const QDomElement &parent, const QString &tag, T *value)
return loadValue(e, value);
}
template <typename T, typename E>
bool loadValue(const QDomElement &parent, const QString &tag, T *value, const E &env)
{
QDomElement e;
if (!findOnlyElement(parent, tag, &e)) return false;
return loadValue(e, value, env);
}
KRITAGLOBAL_EXPORT QDomElement findElementByAttibute(QDomNode parent,
const QString &tag,
const QString &attribute,
......
......@@ -71,6 +71,7 @@ public:
void visit(KisTransformMask *mask, KisUndoAdapter*) { KIS_ASSERT_RECOVER_NOOP(!mask->selection()); }
void visit(KisTransparencyMask *mask, KisUndoAdapter*) { mask->selection()->updateProjection(); }
void visit(KisSelectionMask *mask, KisUndoAdapter*) { mask->selection()->updateProjection(); }
void visit(KisColorizeMask *, KisUndoAdapter*) {}
};
......
......@@ -192,6 +192,9 @@ public:
bool visit(KisSelectionMask*) {
return true;
}
bool visit(KisColorizeMask*) {
return true;
}
private:
QRect m_updateRect;
......
......@@ -23,6 +23,7 @@
#include "kis_types.h"
#include "kis_node_visitor.h"
#include "kis_paint_layer.h"
#include "lazybrush/kis_colorize_mask.h"
#include "kis_adjustment_layer.h"
#include "generator/kis_generator_layer.h"
#include "kis_group_layer.h"
......@@ -102,6 +103,13 @@ public:
return true;
}
bool visit(KisColorizeMask *mask) {
if (mask->colorSpace()->colorModelId() == m_oldColorSpace->colorModelId()) {
mask->setProfile(m_dstColorSpace->profile());
}
return true;
}
private:
bool updatePaintDevice(KisLayer *layer) {
......
......@@ -23,6 +23,7 @@
#include "kis_adjustment_layer.h"
#include "kis_paint_layer.h"
#include "kis_group_layer.h"
#include "lazybrush/kis_colorize_mask.h"
#include "kis_external_layer_iface.h"
#include "filter/kis_filter_configuration.h"
#include "filter/kis_filter_registry.h"
......@@ -113,26 +114,23 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(KisLayer* layer)
if (layer->original()) {
KUndo2Command* cmd = layer->original()->convertTo(m_dstColorSpace, m_renderingIntent, m_conversionFlags);
if (cmd)
if (cmd) {
m_image->undoAdapter()->addCommand(cmd);
else
delete cmd;
}
}
if (layer->paintDevice()) {
KUndo2Command* cmd = layer->paintDevice()->convertTo(m_dstColorSpace, m_renderingIntent, m_conversionFlags);
if (cmd)
if (cmd) {
m_image->undoAdapter()->addCommand(cmd);
else
delete cmd;
}
}
if (layer->projection()) {
KUndo2Command* cmd = layer->projection()->convertTo(m_dstColorSpace, m_renderingIntent, m_conversionFlags);
if (cmd)
if (cmd) {
m_image->undoAdapter()->addCommand(cmd);
else
delete cmd;
}
}
KisPaintLayer *paintLayer = 0;
......@@ -145,3 +143,12 @@ bool KisColorSpaceConvertVisitor::convertPaintDevice(KisLayer* layer)
return true;
}
bool KisColorSpaceConvertVisitor::visit(KisColorizeMask *mask)
{
KUndo2Command* cmd = mask->setColorSpace(m_dstColorSpace, m_renderingIntent, m_conversionFlags);
if (cmd) {
m_image->undoAdapter()->addCommand(cmd);
}
return true;
}
......@@ -67,6 +67,8 @@ public:
return true;
}
bool visit(KisColorizeMask *mask);
private:
bool convertPaintDevice(KisLayer* layer);
......
......@@ -34,6 +34,7 @@
#include "kis_transform_mask.h"
#include "kis_transparency_mask.h"
#include "kis_selection_mask.h"
#include "lazybrush/kis_colorize_mask.h"
#include "generator/kis_generator_layer.h"
/**
* The count visitor traverses the node stack for nodes that conform
......@@ -107,6 +108,10 @@ public:
return check(mask);
}
bool visit(KisColorizeMask* mask) {
return check(mask);
}
private:
bool inList(KisNode* node);
......
......@@ -28,6 +28,7 @@
#include "kis_transform_mask.h"
#include "kis_transparency_mask.h"
#include "kis_selection_mask.h"
#include "lazybrush/kis_colorize_mask.h"
#include <QDomDocument>
......@@ -60,6 +61,7 @@ public:
virtual bool visit(KisTransformMask* mask) { return process(mask); }
virtual bool visit(KisTransparencyMask* mask) { return process(mask); }
virtual bool visit(KisSelectionMask* mask) { return process(mask); }
virtual bool visit(KisColorizeMask* mask) { return process(mask); }
bool process(KisNode* node) {
if(m_mode == STORE) {
......
......@@ -32,6 +32,8 @@ class KisTransparencyMask;
class KisSelectionMask;
class KisGeneratorLayer;
class KisTransformMask;
class KisColorizeMask;
class KRITAIMAGE_EXPORT KisNodeVisitor
{
......@@ -62,6 +64,8 @@ public:
virtual bool visit(KisSelectionMask *mask) = 0;
virtual bool visit(KisColorizeMask *mask) = 0;
protected:
/**
......
......@@ -194,6 +194,18 @@ private:
};
void KisColorizeMask::setProfile(const KoColorProfile *profile)
{
// WARNING: there is no undo information, used only while loading!
m_d->fakePaintDevice->setProfile(profile);
m_d->coloringProjection->setProfile(profile);
for (auto stroke : m_d->keyStrokes) {
stroke.color.setProfile(profile);
}
}
KUndo2Command* KisColorizeMask::setColorSpace(const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags)
......@@ -831,11 +843,16 @@ KisPaintDeviceSP KisColorizeMask::testingFilteredSource() const
return m_d->filteredSource;
}
QList<KeyStroke> KisColorizeMask::testingKeyStrokes() const
QList<KeyStroke> KisColorizeMask::fetchKeyStrokesDirect() const
{
return m_d->keyStrokes;
}
void KisColorizeMask::setKeyStrokesDirect(const QList<KisLazyFillTools::KeyStroke> &strokes)
{
m_d->keyStrokes = strokes;
}
qint32 KisColorizeMask::x() const
{
return m_d->offset.x();
......
......@@ -51,6 +51,10 @@ public:
void initializeCompositeOp();
const KoColorSpace* colorSpace() const;
// assign color profile without conversion of pixel data
void setProfile(const KoColorProfile *profile);
KUndo2Command* setColorSpace(const KoColorSpace * dstColorSpace,
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags());
......@@ -94,7 +98,9 @@ public:
void testingAddKeyStroke(KisPaintDeviceSP dev, const KoColor &color, bool isTransparent = false);
void testingRegenerateMask();
KisPaintDeviceSP testingFilteredSource() const;
QList<KisLazyFillTools::KeyStroke> testingKeyStrokes() const;
QList<KisLazyFillTools::KeyStroke> fetchKeyStrokesDirect() const;
void setKeyStrokesDirect(const QList<KisLazyFillTools::KeyStroke> &strokes);
qint32 x() const;
qint32 y() const;
......
......@@ -53,6 +53,9 @@ public:
bool visit(KisSelectionMask*) {
return true;
}
bool visit(KisColorizeMask*) {
return true;
}
bool visit(KisExternalLayer*) {
return true;
}
......
......@@ -96,7 +96,7 @@ void KisColorizeMaskTest::test()
QList<KisLazyFillTools::KeyStroke> strokes;
strokes = t.mask->testingKeyStrokes();
strokes = t.mask->fetchKeyStrokesDirect();
// Check initial bounding rects
......@@ -139,7 +139,7 @@ void KisColorizeMaskTest::test()
KUndo2Command *cmd = t.mask->setColorSpace(newCS);
cmd->redo();
strokes = t.mask->testingKeyStrokes();
strokes = t.mask->fetchKeyStrokesDirect();
QCOMPARE(t.mask->colorSpace(), newCS);
QCOMPARE(t.mask->paintDevice()->colorSpace(), newCS);
......@@ -150,7 +150,7 @@ void KisColorizeMaskTest::test()
QCOMPARE(strokes[2].color.colorSpace(), newCS);
cmd->undo();
strokes = t.mask->testingKeyStrokes();
strokes = t.mask->fetchKeyStrokesDirect();
QCOMPARE(t.mask->colorSpace(), oldCS);
QCOMPARE(t.mask->paintDevice()->colorSpace(), oldCS);
......@@ -161,7 +161,7 @@ void KisColorizeMaskTest::test()
QCOMPARE(strokes[2].color.colorSpace(), oldCS);
cmd->redo();
strokes = t.mask->testingKeyStrokes();
strokes = t.mask->fetchKeyStrokesDirect();
QCOMPARE(t.mask->colorSpace(), newCS);
QCOMPARE(t.mask->paintDevice()->colorSpace(), newCS);
......@@ -178,7 +178,7 @@ void KisColorizeMaskTest::testCrop()
{
ColorizeMaskTester t;
QList<KisLazyFillTools::KeyStroke> strokes;
strokes = t.mask->testingKeyStrokes();
strokes = t.mask->fetchKeyStrokesDirect();
// Check initial bounding rects
......
......@@ -73,6 +73,10 @@ public:
return true;
}
bool visit(KisColorizeMask */*mask*/) {
return true;
}
};
void KisNodeVisitorTest::testCreation()
......
......@@ -165,6 +165,15 @@ void KoColor::convertTo(const KoColorSpace * cs)
KoColorConversionTransformation::internalConversionFlags());
}
void KoColor::setProfile(const KoColorProfile *profile)
{
const KoColorSpace *dstColorSpace =
KoColorSpaceRegistry::instance()->colorSpace(colorSpace()->colorModelId().id(), colorSpace()->colorDepthId().id(), profile);
if (!dstColorSpace) return;
d->colorSpace = KoColorSpaceRegistry::instance()->permanentColorspace(dstColorSpace);
}
void KoColor::setColor(const quint8 * data, const KoColorSpace * colorSpace)
{
Q_ASSERT(data);
......
......@@ -83,6 +83,9 @@ public:
void convertTo(const KoColorSpace * cs);
/// assign new profile without converting pixel data
void setProfile(const KoColorProfile *profile);
/// Replace the existing color data, and colorspace with the specified data.
/// The data is copied.
......
......@@ -153,6 +153,7 @@ set(kritaui_LIB_SRCS
kra/kis_kra_save_visitor.cpp
kra/kis_kra_saver.cpp
kra/kis_kra_savexml_visitor.cpp
kra/kis_colorize_dom_utils.cpp
opengl/kis_opengl.cpp
opengl/kis_opengl_canvas2.cpp
opengl/kis_opengl_canvas_debugger.cpp
......
......@@ -85,6 +85,10 @@ bool KisSaveGroupVisitor::visit(KisSelectionMask* ) {
return true;
}
bool KisSaveGroupVisitor::visit(KisColorizeMask* ) {
return true;
}
bool KisSaveGroupVisitor::visit(KisGroupLayer *layer)
{
if (layer == m_image->rootLayer()) {
......
......@@ -84,6 +84,8 @@ public:
bool visit(KisSelectionMask* );
bool visit(KisColorizeMask* );
bool visit(KisGroupLayer *layer);
private:
......
/*
* Copyright (c) 2016 Dmitry Kazakov <dimula73@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_colorize_dom_utils.h"
#include <KoColorSpaceRegistry.h>
#include "kis_dom_utils.h"
#include "lazybrush/kis_lazy_fill_tools.h"
#include "kis_kra_tags.h"
#include "kis_paint_device.h"
namespace KisDomUtils {
void saveValue(QDomElement *parent, const QString &tag, const KisLazyFillTools::KeyStroke &stroke)
{
using namespace KRA;
QDomDocument doc = parent->ownerDocument();
QDomElement e = doc.createElement(tag);
parent->appendChild(e);
e.setAttribute("type", COLORIZE_KEYSTROKE);
QString fileName = tag;
fileName.replace("item", COLORIZE_KEYSTROKE);
e.setAttribute(FILE_NAME, fileName);
e.setAttribute(COLORIZE_KEYSTROKE_IS_TRANSPARENT, stroke.isTransparent);
QByteArray colorData = QByteArray::fromRawData((const char*)stroke.color.data(), stroke.color.colorSpace()->pixelSize());
e.setAttribute(COLORBYTEDATA, QString(colorData.toBase64()));
}
bool loadValue(const QDomElement &e, KisLazyFillTools::KeyStroke *stroke, const KoColorSpace *colorSpace)
{
using namespace KRA;
if (!Private::checkType(e, COLORIZE_KEYSTROKE)) return false;
stroke->isTransparent = toInt(e.attribute(COLORIZE_KEYSTROKE_IS_TRANSPARENT, "0"));
QByteArray colorData = QByteArray::fromBase64(e.attribute(COLORBYTEDATA).toLatin1());
KoColor color((const quint8*)colorData.data(), colorSpace);
stroke->color = color;
stroke->dev = new KisPaintDevice(KoColorSpaceRegistry::instance()->alpha8());
return true;
}
}
/*
* Copyright (c) 2016 Dmitry Kazakov <dimula73@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __KIS_COLORIZE_DOM_UTILS_H
#define __KIS_COLORIZE_DOM_UTILS_H
#include <KoColorSpaceRegistry.h>
#include "kritaui_export.h"
namespace KisLazyFillTools {
struct KeyStroke;
}
namespace KisDomUtils {
void KRITAUI_EXPORT saveValue(QDomElement *parent, const QString &tag, const KisLazyFillTools::KeyStroke &stroke);
bool KRITAUI_EXPORT loadValue(const QDomElement &e, KisLazyFillTools::KeyStroke *stroke, const KoColorSpace *colorSpace);
}
#endif /* __KIS_COLORIZE_DOM_UTILS_H */
......@@ -52,7 +52,10 @@
#include "kis_transform_mask_params_factory_registry.h"
#include <kis_transparency_mask.h>
#include <kis_selection_mask.h>
#include <lazybrush/kis_colorize_mask.h>
#include <lazybrush/kis_lazy_fill_tools.h>
#include "kis_shape_selection.h"
#include "kis_colorize_dom_utils.h"
#include "kis_dom_utils.h"
#include "kis_raster_keyframe_channel.h"
#include "kis_paint_device_frames_interface.h"
......@@ -344,6 +347,38 @@ bool KisKraLoadVisitor::visit(KisSelectionMask *mask)
return loadSelection(getLocation(mask), mask->selection());
}
bool KisKraLoadVisitor::visit(KisColorizeMask *mask)
{
m_store->pushDirectory();
QString location = getLocation(mask, DOT_COLORIZE_MASK);
m_store->enterDirectory(location) ;
QByteArray data;
if (!m_store->extractFile("content.xml", data))
return false;
QDomDocument doc;
if (!doc.setContent(data))
return false;
QVector<KisLazyFillTools::KeyStroke> strokes;
if (!KisDomUtils::loadValue(doc.documentElement(), COLORIZE_KEYSTROKES_SECTION, &strokes, mask->colorSpace()))
return false;
int i = 0;
Q_FOREACH (const KisLazyFillTools::KeyStroke &stroke, strokes) {
const QString fileName = QString("%1_%2").arg(COLORIZE_KEYSTROKE).arg(i++);
loadPaintDevice(stroke.dev, fileName);
}
mask->setKeyStrokesDirect(QList<KisLazyFillTools::KeyStroke>::fromVector(strokes));
loadPaintDevice(mask->coloringProjection(), COLORIZE_COLORING_DEVICE);
m_store->popDirectory();
return true;
}
QStringList KisKraLoadVisitor::errorMessages() const
{
return m_errorMessages;
......
......@@ -57,6 +57,7 @@ public:
bool visit(KisTransformMask *mask);
bool visit(KisTransparencyMask *mask);
bool visit(KisSelectionMask *mask);
bool visit(KisColorizeMask *mask);
QStringList errorMessages() const;
......
......@@ -50,6 +50,7 @@
#include <kis_external_layer_iface.h>
#include <kis_filter_mask.h>
#include <kis_transform_mask.h>
#include "lazybrush/kis_colorize_mask.h"
#include <kis_group_layer.h>
#include <kis_image.h>
#include <kis_layer.h>
......@@ -78,6 +79,7 @@
#include "kis_guides_config.h"
#include "kis_image_config.h"
#include "KisProofingConfiguration.h"
#include "kis_layer_properties_icons.h"
/*
......@@ -185,10 +187,10 @@ KisKraLoader::~KisKraLoader()
}
KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
KisImageSP KisKraLoader::loadXML(const KoXmlElement& element)
{
QString attr;
KisImageWSP image = 0;
KisImageSP image = 0;
QString name;
qint32 width;
qint32 height;
......@@ -202,18 +204,18 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
if ((m_d->imageName = element.attribute(NAME)).isNull()) {
m_d->errorMessages << i18n("Image does not have a name.");
return KisImageWSP(0);
return KisImageSP(0);
}
if ((attr = element.attribute(WIDTH)).isNull()) {
m_d->errorMessages << i18n("Image does not specify a width.");
return KisImageWSP(0);
return KisImageSP(0);
}
width = KisDomUtils::toInt(attr);
if ((attr = element.attribute(HEIGHT)).isNull()) {
m_d->errorMessages << i18n("Image does not specify a height.");
return KisImageWSP(0);
return KisImageSP(0);
}
height = KisDomUtils::toInt(attr);
......@@ -263,7 +265,7 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
cs = KoColorSpaceRegistry::instance()->colorSpace(colorspaceModel, colorspaceDepth, "");
if (cs == 0) {
m_d->errorMessages << i18n("Image specifies an unsupported color model: %1.", colorspacename);
return KisImageWSP(0);
return KisImageSP(0);
}
}
KisImageConfig cfgImage;
......@@ -300,7 +302,7 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
KoXmlElement e = child.toElement();
if(e.tagName() == CANVASPROJECTIONCOLOR) {
if (e.hasAttribute(COLORBYTEDATA)) {
QByteArray colorData = QByteArray::fromBase64(e.attribute("ColorData").toLatin1());
QByteArray colorData = QByteArray::fromBase64(e.attribute(COLORBYTEDATA).toLatin1());
KoColor color((const quint8*)colorData.data(), image->colorSpace());
image->setDefaultProjectionColor(color);
}
......@@ -343,7 +345,7 @@ KisImageWSP KisKraLoader::loadXML(const KoXmlElement& element)
return image;
}
void KisKraLoader::loadBinaryData(KoStore * store, KisImageWSP image, const QString & uri, bool external)
void KisKraLoader::loadBinaryData(KoStore * store, KisImageSP image, const QString & uri, bool external)
{
// icc profile: if present, this overrides the profile product name loaded in loadXML.
QString location = external ? QString() : uri;
......@@ -555,7 +557,7 @@ void KisKraLoader::loadAssistants(KoStore *store, const QString &uri, bool exter
}
}
void KisKraLoader::loadAnimationMetadata(const KoXmlElement &element, KisImageWSP image)
void KisKraLoader::loadAnimationMetadata(const KoXmlElement &element, KisImageSP image)
{
QDomDocument qDom;
KoXml::asQDomElement(qDom, element);
......@@ -580,7 +582,7 @@ void KisKraLoader::loadAnimationMetadata(const KoXmlElement &element, KisImageWS
}
}
KisNodeSP KisKraLoader::loadNodes(const KoXmlElement& element, KisImageWSP image, KisNodeSP parent)
KisNodeSP KisKraLoader::loadNodes(const KoXmlElement& element, KisImageSP image, KisNodeSP parent)
{
KoXmlNode node = element.firstChild();
......@@ -608,7 +610,7 @@ KisNodeSP KisKraLoader::loadNodes(const KoXmlElement& element, KisImageWSP image
return parent;
}
KisNodeSP KisKraLoader::loadNode(const KoXmlElement& element, KisImageWSP image, KisNodeSP parent)
KisNodeSP KisKraLoader::loadNode(const KoXmlElement& element, KisImageSP image, KisNodeSP parent)
{
// Nota bene: If you add new properties to layers, you should
// ALWAYS define a default value in case the property is not
......@@ -695,6 +697,8 @@ KisNodeSP KisKraLoader::loadNode(const KoXmlElement& element, KisImageWSP image,
node = loadTransparencyMask(element, parent);
else if (nodeType == SELECTION_MASK)
node = loadSelectionMask(image, element, parent);
else if (nodeType == COLORIZE_MASK)
node = loadColorizeMask(image, element, parent, colorSpace);
else if (nodeType == FILE_LAYER) {
node = loadFileLayer(element, image, name, opacity);
}
......@@ -721,13 +725,15 @@ KisNodeSP KisKraLoader::loadNode(const KoXmlElement& element, KisImageWSP image,
if (! id.isNull()) // if no uuid in file, new one has been generated already
node->setUuid(id);
if (node->inherits("KisLayer") || node->inherits("KisColorizeMask")) {
QString compositeOpName = element.attribute(COMPOSITE_OP, "normal");
node->setCompositeOpId(compositeOpName);
}
if (node->inherits("KisLayer")) {
KisLayer* layer = qobject_cast<KisLayer*>(node.data());
QBitArray channelFlags = stringToFlags(element.attribute(CHANNEL_FLAGS, ""), colorSpace->channelCount());
QString compositeOpName = element.attribute(COMPOSITE_OP, "normal");
layer->setChannelFlags(channelFlags);
layer->setCompositeOpId(compositeOpName);
if (element.hasAttribute(LAYER_STYLE_UUID)) {
QString uuidString = element.attribute(LAYER_STYLE_UUID);
......@@ -783,7 +789,7 @@ KisNodeSP KisKraLoader::loadNode(const KoXmlElement& element, KisImageWSP image,
}
KisNodeSP KisKraLoader::loadPaintLayer(const KoXmlElement& element, KisImageWSP image,
KisNodeSP KisKraLoader::loadPaintLayer(const KoXmlElement& element, KisImageSP image,
const QString& name, const KoColorSpace* cs, quint32 opacity)
{
Q_UNUSED(element);
......@@ -808,7 +814,7 @@ KisNodeSP KisKraLoader::loadPaintLayer(const KoXmlElement& element, KisImageWSP
}
KisNodeSP KisKraLoader::loadFileLayer(const KoXmlElement& element, KisImageWSP image, const QString& name, quint32 opacity)
KisNodeSP KisKraLoader::loadFileLayer(const KoXmlElement& element, KisImageSP image, const QString& name, quint32 opacity)
{
QString filename = element.attribute("source", QString());
if (filename.isNull()) return 0;
......@@ -869,7 +875,7 @@ KisNodeSP KisKraLoader::loadFileLayer(const KoXmlElement& element, KisImageWSP i
return layer;
}
KisNodeSP KisKraLoader::loadGroupLayer(const KoXmlElement& element, KisImageWSP image,
KisNodeSP KisKraLoader::loadGroupLayer(const KoXmlElement& element, KisImageSP image,
const QString& name, const KoColorSpace* cs, quint32 opacity)
{
Q_UNUSED(element);
......@@ -884,7 +890,7 @@ KisNodeSP KisKraLoader::loadGroupLayer(const KoXmlElement& element, KisImageWSP
}
KisNodeSP KisKraLoader::loadAdjustmentLayer(const KoXmlElement& element, KisImageWSP image,
KisNodeSP KisKraLoader::loadAdjustmentLayer(const KoXmlElement& element, KisImageSP image,
const QString& name, const KoColorSpace* cs, quint32 opacity)
{
// XXX: do something with filterversion?
......@@ -918,7 +924,7 @@ KisNodeSP KisKraLoader::loadAdjustmentLayer(const KoXmlElement& element, KisImag
}
KisNodeSP KisKraLoader::loadShapeLayer(const KoXmlElement& element, KisImageWSP image,
KisNodeSP KisKraLoader::loadShapeLayer(const KoXmlElement& element, KisImageSP image,
const QString& name, const KoColorSpace* cs, quint32 opacity)
{
......@@ -938,7 +944,7 @@ KisNodeSP KisKraLoader::loadShapeLayer(const KoXmlElement& element, KisImageWSP
}
KisNodeSP KisKraLoader::loadGeneratorLayer(const KoXmlElement& element, KisImageWSP image,
KisNodeSP KisKraLoader::loadGeneratorLayer(const KoXmlElement& element, KisImageSP image,
const QString& name, const KoColorSpace* cs, quint32 opacity)
{
Q_UNUSED(