Commit 76459122 authored by Adrian Page's avatar Adrian Page

Fix deprecated and warnings.

svn path=/trunk/koffice/; revision=531689
parent 1118daa8
......@@ -191,8 +191,7 @@ QImage KisLmsF32ColorSpace::convertToQImage(const quint8 *dataU8, qint32 width,
{
const float *data = reinterpret_cast<const float *>(dataU8);
QImage img = QImage(width, height, 32, 0, QImage::LittleEndian);
img.setAlphaBuffer(true);
QImage img = QImage(width, height, QImage::Format_ARGB32);
qint32 i = 0;
uchar *j = img.bits();
......
......@@ -269,8 +269,7 @@ QImage KisRgbF16HalfColorSpace::convertToQImage(const quint8 *dataU8, qint32 wid
{
const half *data = reinterpret_cast<const half *>(dataU8);
QImage img = QImage(width, height, 32, 0, QImage::LittleEndian);
img.setAlphaBuffer(true);
QImage img = QImage(width, height, QImage::Format_ARGB32);
qint32 i = 0;
uchar *j = img.bits();
......
......@@ -268,8 +268,7 @@ QImage KisRgbF32ColorSpace::convertToQImage(const quint8 *dataU8, qint32 width,
{
const float *data = reinterpret_cast<const float *>(dataU8);
QImage img = QImage(width, height, 32, 0, QImage::LittleEndian);
img.setAlphaBuffer(true);
QImage img = QImage(width, height, QImage::Format_ARGB32);
qint32 i = 0;
uchar *j = img.bits();
......
......@@ -220,8 +220,7 @@ QImage KisRgbColorSpace::convertToQImage(const quint8 *data, qint32 width, qint3
{
Q_ASSERT(data);
QImage img = QImage(const_cast<quint8 *>(data), width, height, 32, 0, 0, QImage::LittleEndian);
img.setAlphaBuffer(true);
QImage img = QImage(const_cast<quint8 *>(data), width, height, QImage::Format_ARGB32);
// XXX: The previous version of this code used the quantum data directly
// as an optimisation. We're introducing a copy overhead here which could
// be factored out again if needed.
......
......@@ -35,7 +35,7 @@ KisAdjustmentLayer::KisAdjustmentLayer(KisImageSP img, const QString &name, KisF
{
m_filterConfig = kfc;
setSelection( selection );
m_cachedPaintDev = new KisPaintDevice( img->colorSpace(), name.latin1());
m_cachedPaintDev = new KisPaintDevice( img->colorSpace(), name.toLatin1());
Q_ASSERT(m_cachedPaintDev);
}
......@@ -65,7 +65,7 @@ KisLayerSP KisAdjustmentLayer::clone() const
void KisAdjustmentLayer::resetCache()
{
m_cachedPaintDev = new KisPaintDevice(image()->colorSpace(), name().latin1());
m_cachedPaintDev = new KisPaintDevice(image()->colorSpace(), name().toLatin1());
}
KisFilterConfiguration * KisAdjustmentLayer::filter()
......
......@@ -21,7 +21,7 @@
void KisAutobrushShape::createBrush( QImage* img)
{
img->create(m_w, m_h, 32);
*img = QImage(m_w, m_h, QImage::Format_ARGB32);
for(int j = 0; j < m_h; j++)
{
for(int i = 0; i < m_w; i++)
......
......@@ -36,7 +36,7 @@ const Q3ValueVector<double> KisAutogradientResource::getHandlePositions() const
Q3ValueVector<double> handlePositions;
handlePositions.push_back(m_segments[0]->startOffset());
for (uint i = 0; i < m_segments.count(); i++)
for (int i = 0; i < m_segments.count(); i++)
{
handlePositions.push_back(m_segments[i]->endOffset());
}
......@@ -47,7 +47,7 @@ const Q3ValueVector<double> KisAutogradientResource::getMiddleHandlePositions()
{
Q3ValueVector<double> middleHandlePositions;
for (uint i = 0; i < m_segments.count(); i++)
for (int i = 0; i < m_segments.count(); i++)
{
middleHandlePositions.push_back(m_segments[i]->middleOffset());
}
......
......@@ -22,8 +22,7 @@
KisBackground::KisBackground()
: KShared()
{
m_patternTile = QImage(PATTERN_WIDTH, PATTERN_HEIGHT, 32);
m_patternTile.setAlphaBuffer(false);
m_patternTile = QImage(PATTERN_WIDTH, PATTERN_HEIGHT, QImage::Format_RGB32);
for (int y = 0; y < PATTERN_HEIGHT; y++)
{
......
......@@ -89,7 +89,7 @@ KisBrush::KisBrush(const QString& filename) : super(filename)
KisBrush::KisBrush(const QString& filename,
const QByteArray& data,
quint32 & dataPos) : super(filename)
qint32 & dataPos) : super(filename)
{
m_brushType = INVALID;
m_ownData = false;
......@@ -205,9 +205,23 @@ bool KisBrush::init()
bh.header_size - sizeof(GimpBrushHeader));
}
setName(i18n(name.ascii())); // Ascii? And what with real UTF-8 chars?
setName(i18n(name.toAscii())); // Ascii? And what with real UTF-8 chars?
if (bh.width == 0 || bh.height == 0 || !m_img.create(bh.width, bh.height, 32)) {
if (bh.width == 0 || bh.height == 0) {
return false;
}
QImage::Format imageFormat;
if (bh.bytes == 1) {
imageFormat = QImage::Format_RGB32;
} else {
imageFormat = QImage::Format_ARGB32;
}
m_img = QImage(bh.width, bh.height, imageFormat);
if (m_img.isNull()) {
return false;
}
......@@ -216,7 +230,7 @@ bool KisBrush::init()
if (bh.bytes == 1) {
// Grayscale
if (static_cast<quint32>(k + bh.width * bh.height) > m_data.size()) {
if (static_cast<qint32>(k + bh.width * bh.height) > m_data.size()) {
return false;
}
......@@ -232,12 +246,11 @@ bool KisBrush::init()
} else if (bh.bytes == 4) {
// RGBA
if (static_cast<quint32>(k + (bh.width * bh.height * 4)) > m_data.size()) {
if (static_cast<qint32>(k + (bh.width * bh.height * 4)) > m_data.size()) {
return false;
}
m_brushType = IMAGE;
m_img.setAlphaBuffer(true);
m_hasColor = true;
for (quint32 y = 0; y < bh.height; y++) {
......@@ -272,7 +285,7 @@ bool KisBrush::initFromPaintDev(KisPaintDevice* image, int x, int y, int w, int
// Forcefully convert to RGBA8
// XXX profile and exposure?
setImage(image->convertToQImage(0, x, y, w, h));
setName(image->name());
setName(image->objectName());
m_brushType = IMAGE;
m_hasColor = true;
......@@ -292,7 +305,7 @@ bool KisBrush::save()
bool KisBrush::saveToDevice(QIODevice* dev) const
{
GimpBrushHeader bh;
QByteArray utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8
QByteArray utf8Name = name().toUtf8(); // Names in v2 brushes are in UTF-8
char const* name = utf8Name.data();
int nameLength = qstrlen(name);
int wrote;
......@@ -694,8 +707,7 @@ QImage KisBrush::scaleImage(const ScaledBrush *srcBrush, double scale, double su
int dstWidth = static_cast<int>(ceil(scale * width())) + 1;
int dstHeight = static_cast<int>(ceil(scale * height())) + 1;
QImage dstImage(dstWidth, dstHeight, 32);
dstImage.setAlphaBuffer(true);
QImage dstImage(dstWidth, dstHeight, QImage::Format_ARGB32);
const QImage srcImage = srcBrush->image();
......@@ -810,13 +822,12 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height)
if (xScale > 2 + DBL_EPSILON || yScale > 2 + DBL_EPSILON || xScale < 1 - DBL_EPSILON || yScale < 1 - DBL_EPSILON) {
// smoothScale gives better results when scaling an image up
// or scaling it to less than half size.
scaledImage = srcImage.smoothScale(width, height);
scaledImage = srcImage.scaled(width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
//filename = QString("smoothScale_%1x%2.png").arg(width).arg(height);
}
else {
scaledImage.create(width, height, 32);
scaledImage.setAlphaBuffer(srcImage.hasAlphaBuffer());
scaledImage = QImage(width, height, srcImage.format());
for (int dstY = 0; dstY < height; dstY++) {
for (int dstX = 0; dstX < width; dstX++) {
......@@ -856,7 +867,7 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height)
int Qt::blue;
int alpha;
if (srcImage.hasAlphaBuffer()) {
if (srcImage.hasAlphaChannel()) {
red = static_cast<int>(a * b * qRed(topLeft) * qAlpha(topLeft)
+ a * (1 - b) * qRed(bottomLeft) * qAlpha(bottomLeft)
+ (1 - a) * b * qRed(topRight) * qAlpha(topRight)
......@@ -942,7 +953,7 @@ QImage KisBrush::scaleImage(const QImage& srcImage, int width, int height)
void KisBrush::findScaledBrushes(double scale, const ScaledBrush **aboveBrush, const ScaledBrush **belowBrush) const
{
uint current = 0;
int current = 0;
while (true) {
*aboveBrush = &(m_scaledBrushes[current]);
......@@ -1019,8 +1030,7 @@ QImage KisBrush::scaleSinglePixelImage(double scale, QRgb pixel, double subPixel
int dstWidth = 2;
int dstHeight = 2;
QImage outputImage(dstWidth, dstHeight, 32);
outputImage.setAlphaBuffer(true);
QImage outputImage(dstWidth, dstHeight, QImage::Format_ARGB32);
double a = subPixelX;
double b = subPixelY;
......@@ -1108,8 +1118,7 @@ QImage KisBrush::interpolate(const QImage& image1, const QImage& image2, double
int width = image1.width();
int height = image1.height();
QImage outputImage(width, height, 32);
outputImage.setAlphaBuffer(true);
QImage outputImage(width, height, QImage::Format_ARGB32);
for (int x = 0; x < width; x++) {
for (int y = 0; y < height; y++) {
......@@ -1286,8 +1295,7 @@ void KisBrush::makeMaskImage() {
if (!hasColor())
return;
QImage img;
img.create(width(), height(), 32);
QImage img(width(), height(), QImage::Format_RGB32);
if (m_img.width() == img.width() && m_img.height() == img.height()) {
for (int x = 0; x < width(); x++) {
......
......@@ -63,7 +63,7 @@ public:
/// Load brush from the specified data, at position dataPos, and set the filename
KisBrush(const QString& filename,
const QByteArray & data,
quint32 & dataPos);
qint32 & dataPos);
/// Load brush from the specified paint device, in the specified region
KisBrush(KisPaintDevice* image, int x, int y, int w, int h);
/// Load brush as a copy from the specified QImage (handy when you need to copy a brush!)
......
......@@ -23,7 +23,7 @@
#include "kis_filter_configuration.h"
KisFilter::KisFilter(const KisID& id, const QString & category, const QString & entry)
: KisProgressSubject(0, id.id().latin1())
: KisProgressSubject(0, id.id().toLatin1())
, m_id(id)
, m_progressDisplay(0)
, m_category(category)
......
......@@ -85,11 +85,11 @@ QString KisFilterConfiguration::toString()
QMap<QString, QVariant>::Iterator it;
for ( it = m_properties.begin(); it != m_properties.end(); ++it ) {
QDomElement e = doc.createElement( "property" );
e.setAttribute( "name", it.key().latin1() );
QVariant v = it.data();
e.setAttribute( "name", QString(it.key().toLatin1()) );
QVariant v = it.value();
e.setAttribute( "type", v.typeName() );
QString s = v.asString();
QDomText text = doc.createCDATASection(v.asString() ); // XXX: Unittest this!
QString s = v.toString();
QDomText text = doc.createCDATASection(v.toString() ); // XXX: Unittest this!
e.appendChild(text);
root.appendChild(e);
}
......@@ -143,7 +143,7 @@ int KisFilterConfiguration::getInt(const QString & name, int def)
{
QVariant v = getProperty(name);
if (v.isValid())
return v.asInt();
return v.toInt();
else
return def;
......@@ -153,7 +153,7 @@ double KisFilterConfiguration::getDouble(const QString & name, double def)
{
QVariant v = getProperty(name);
if (v.isValid())
return v.asDouble();
return v.toDouble();
else
return def;
}
......@@ -162,7 +162,7 @@ bool KisFilterConfiguration::getBool(const QString & name, bool def)
{
QVariant v = getProperty(name);
if (v.isValid())
return v.asBool();
return v.toBool();
else
return def;
}
......@@ -171,7 +171,7 @@ QString KisFilterConfiguration::getString(const QString & name, QString def)
{
QVariant v = getProperty(name);
if (v.isValid())
return v.asString();
return v.toString();
else
return def;
}
......
......@@ -56,7 +56,7 @@ KisGradient::KisGradient(const QString& file) : super(file)
KisGradient::~KisGradient()
{
for (uint i = 0; i < m_segments.count(); i++) {
for (int i = 0; i < m_segments.count(); i++) {
delete m_segments[i];
m_segments[i] = 0;
}
......@@ -154,7 +154,7 @@ KisGradientSegment *KisGradient::segmentAt(double t) const
KisGradientSegment *segment = 0;
for (uint i = 0; i < m_segments.count(); i++) {
for (int i = 0; i < m_segments.count(); i++) {
if (t > m_segments[i]->startOffset() - DBL_EPSILON && t < m_segments[i]->endOffset() + DBL_EPSILON) {
segment = m_segments[i];
break;
......@@ -178,7 +178,7 @@ void KisGradient::colorAt(double t, QColor *color, quint8 *opacity) const
QImage KisGradient::generatePreview(int width, int height) const
{
QImage img(width, height, 32);
QImage img(width, height, QImage::Format_RGB32);
for (int y = 0; y < img.height(); y++) {
for (int x = 0; x < img.width(); x++) {
......
......@@ -549,8 +549,7 @@ bool KisGradientPainter::paintGradient(const KisPoint& gradientVectorStart,
qint32 endx = startx + width - 1;
qint32 endy = starty + height - 1;
QImage layer (width, height, 32);
layer.setAlphaBuffer(true);
QImage layer(width, height, QImage::Format_ARGB32);
int pixelsProcessed = 0;
int lastProgressPercent = 0;
......
......@@ -36,7 +36,7 @@ KisGroupLayer::KisGroupLayer(KisImage *img, const QString &name, quint8 opacity)
m_x(0),
m_y(0)
{
m_projection = new KisPaintDevice(this, img->colorSpace(), name.latin1());
m_projection = new KisPaintDevice(this, img->colorSpace(), name.toLatin1());
}
KisGroupLayer::KisGroupLayer(const KisGroupLayer &rhs) :
......@@ -77,7 +77,7 @@ void KisGroupLayer::setDirty(const QRect & rc, bool propagate)
void KisGroupLayer::resetProjection()
{
m_projection = new KisPaintDevice(this, image()->colorSpace(), name().latin1());
m_projection = new KisPaintDevice(this, image()->colorSpace(), name().toLatin1());
}
KisPaintDeviceSP KisGroupLayer::projection(const QRect & rect)
......
......@@ -55,11 +55,11 @@
KisPipeBrushParasite::KisPipeBrushParasite(const QString& source)
{
needsMovement = false;
QRegExp basicSplitter(" ", true);
QRegExp parasiteSplitter(":", true);
QStringList parasites = QStringList::split(basicSplitter, source);
for (uint i = 0; i < parasites.count(); i++) {
QStringList splitted = QStringList::split(parasiteSplitter, parasites.at(i));
QRegExp basicSplitter(" ");
QRegExp parasiteSplitter(":");
QStringList parasites = source.split(basicSplitter, QString::SkipEmptyParts);
for (int i = 0; i < parasites.count(); i++) {
QStringList splitted = parasites.at(i).split(parasiteSplitter, QString::SkipEmptyParts);
if (splitted.count() != 2) {
kWarning(41001) << "Wrong count for this parasite key/value:" << parasites.at(i) << endl;
continue;
......@@ -175,7 +175,7 @@ KisImagePipeBrush::KisImagePipeBrush(const QString& name, int w, int h,
m_parasite.setBrushesCount();
for (uint i = 0; i < devices.at(0).count(); i++) {
for (int i = 0; i < devices.at(0).count(); i++) {
m_brushes.append(new KisBrush(devices.at(0).at(i), 0, 0, w, h));
}
......@@ -207,13 +207,13 @@ bool KisImagePipeBrush::init()
// The first line contains the name -- this means we look until we arrive at the first newline
QByteArray line1;
quint32 i = 0;
qint32 i = 0;
while (m_data[i] != '\n' && i < m_data.size()) {
line1.append(m_data[i]);
i++;
}
setName(i18n(QString::fromUtf8(line1, line1.size()).ascii()));
setName(i18n(QString::fromUtf8(line1, line1.size()).toAscii()));
i++; // Skip past the first newline
......@@ -227,13 +227,13 @@ bool KisImagePipeBrush::init()
}
QString paramline = QString::fromUtf8(line2, line2.size());
quint32 m_numOfBrushes = paramline.left(paramline.find(' ')).toUInt();
m_parasite = paramline.mid(paramline.find(' ') + 1);
qint32 m_numOfBrushes = paramline.left(paramline.indexOf(' ')).toUInt();
m_parasite = paramline.mid(paramline.indexOf(' ') + 1);
i++; // Skip past the second newline
quint32 numOfBrushes = 0;
qint32 numOfBrushes = 0;
while (numOfBrushes < m_numOfBrushes && i < m_data.size()){
KisBrush * brush = new KisBrush(name() + "_" + numOfBrushes,
KisBrush * brush = new KisBrush(name() + "_" + QString().setNum(numOfBrushes),
m_data,
i);
Q_CHECK_PTR(brush);
......@@ -271,7 +271,7 @@ bool KisImagePipeBrush::save()
bool KisImagePipeBrush::saveToDevice(QIODevice* dev) const
{
QByteArray utf8Name = name().utf8(); // Names in v2 brushes are in UTF-8
QByteArray utf8Name = name().toUtf8(); // Names in v2 brushes are in UTF-8
char const* name = utf8Name.data();
int len = qstrlen(name);
......@@ -289,14 +289,14 @@ bool KisImagePipeBrush::saveToDevice(QIODevice* dev) const
if (dev->write(name, len) == -1)
return false;
if (dev->putch('\n') == -1)
if (dev->putChar('\n') == -1)
return false;
// Write the parasite (also writes number of brushes)
if (!m_parasite.saveToDevice(dev))
return false;
if (dev->putch('\n') == -1)
if (dev->putChar('\n') == -1)
return false;
// <gbr brushes>
......
......@@ -154,7 +154,7 @@ private:
QString m_name;
QString m_parasiteString; // Contains instructions on how to use the brush
mutable KisPipeBrushParasite m_parasite;
quint32 m_numOfBrushes;
qint32 m_numOfBrushes;
mutable quint32 m_currentBrush;
QByteArray m_data;
......
......@@ -881,7 +881,7 @@ void KisPainter::paintPolygon(const vKisPoint& points)
if (points.count() > 1) {
double distance = -1;
for (uint i = 0; i < points.count() - 1; i++) {
for (int i = 0; i < points.count() - 1; i++) {
distance = paintLine(points[i], PRESSURE_DEFAULT, 0, 0, points[i + 1], PRESSURE_DEFAULT, 0, 0, distance);
}
paintLine(points[points.count() - 1], PRESSURE_DEFAULT, 0, 0, points[0], PRESSURE_DEFAULT, 0, 0, distance);
......
......@@ -153,7 +153,7 @@ bool KisPalette::save()
// In any case, we don't use Columns...
stream << "GIMP Palette\nName: " << name() << "\nColumns: " << m_columns << "\n#\n";
for (uint i = 0; i < m_colors.size(); i++) {
for (int i = 0; i < m_colors.size(); i++) {
const KisPaletteEntry& entry = m_colors.at(i);
QColor c = entry.color;
stream << c.red() << " " << c.green() << " " << c.blue() << "\t";
......@@ -198,7 +198,7 @@ bool KisPalette::init()
// XXX: No checks for wrong input yet!
quint32 index = 0;
QStringList lines = QStringList::split("\n", s);
QStringList lines = s.split("\n", QString::SkipEmptyParts);
if (lines.size() < 3) {
return false;
......@@ -219,7 +219,7 @@ bool KisPalette::init()
return false;
}
setName(i18n(lines[1].mid(strlen("Name: ")).trimmed().ascii()));
setName(i18n(lines[1].mid(strlen("Name: ")).trimmed().toAscii()));
index = 2;
......@@ -231,16 +231,16 @@ bool KisPalette::init()
}
// Loop over the rest of the lines
for (quint32 i = index; i < lines.size(); i++) {
for (qint32 i = index; i < lines.size(); i++) {
if (lines[i].startsWith("#")) {
m_comment += lines[i].mid(1).trimmed() + " ";
}
else {
if (lines[i].contains("\t") > 0) {
QStringList a = QStringList::split("\t", lines[i]);
QStringList a = lines[i].split("\t", QString::SkipEmptyParts);
e.name = a[1];
QStringList c = QStringList::split(" ", a[0]);
QStringList c = a[0].split(" ", QString::SkipEmptyParts);
channel = c[0].trimmed();
r = channel.toInt();
channel = c[1].trimmed();
......
......@@ -65,7 +65,7 @@ KisPattern::KisPattern(KisPaintDevice* image, int x, int y, int w, int h)
// Forcefully convert to RGBA8
// XXX profile and exposure?
setImage(image->convertToQImage(0, x, y, w, h));
setName(image->name());
setName(image->objectName());
}
KisPattern::~KisPattern()
......@@ -99,7 +99,7 @@ bool KisPattern::save()
// Version is 1 for now...
GimpPatternHeader ph;
QByteArray utf8Name = name().utf8();
QByteArray utf8Name = name().toUtf8();
char const* name = utf8Name.data();
int nameLength = qstrlen(name);
......@@ -155,7 +155,7 @@ bool KisPattern::init()
qint32 k;
QByteArray name;
if (sizeof(GimpPatternHeader) > m_data.size()) {
if ((int)sizeof(GimpPatternHeader) > m_data.size()) {
return false;
}
......@@ -167,7 +167,7 @@ bool KisPattern::init()
bh.bytes = ntohl(bh.bytes);
bh.magic_number = ntohl(bh.magic_number);
if (bh.header_size > m_data.size() || bh.header_size == 0) {
if ((int)bh.header_size > m_data.size() || bh.header_size == 0) {
return false;
}
......@@ -180,7 +180,21 @@ bool KisPattern::init()
setName(i18n(name));
if (bh.width == 0 || bh.height == 0 || !m_img.create(bh.width, bh.height, 32)) {
if (bh.width == 0 || bh.height == 0) {
return false;
}
QImage::Format imageFormat;
if (bh.bytes == 1 || bh.bytes == 3) {
imageFormat = QImage::Format_RGB32;
} else {
imageFormat = QImage::Format_ARGB32;
}
m_img = QImage(bh.width, bh.height, imageFormat);
if (m_img.isNull()) {
return false;
}
......@@ -192,14 +206,13 @@ bool KisPattern::init()
for (quint32 y = 0; y < bh.height; y++) {
for (quint32 x = 0; x < bh.width; x++, k++) {
if (static_cast<quint32>(k) > m_data.size()) {
if (k > m_data.size()) {
kDebug(DBG_AREA_FILE) << "failed in gray\n";
return false;
}
val = m_data[k];
m_img.setPixel(x, y, qRgb(val, val, val));
m_img.setAlphaBuffer(false);
}
}
} else if (bh.bytes == 2) {
......@@ -208,7 +221,7 @@ bool KisPattern::init()
qint32 alpha;
for (quint32 y = 0; y < bh.height; y++) {
for (quint32 x = 0; x < bh.width; x++, k++) {
if (static_cast<quint32>(k + 2) > m_data.size()) {
if (k + 2 > m_data.size()) {
kDebug(DBG_AREA_FILE) << "failed in grayA\n";
return false;
}
......@@ -216,14 +229,13 @@ bool KisPattern::init()
val = m_data[k];
alpha = m_data[k++];
m_img.setPixel(x, y, qRgba(val, val, val, alpha));
m_img.setAlphaBuffer(true);
}
}
} else if (bh.bytes == 3) {
// RGB without alpha
for (quint32 y = 0; y < bh.height; y++) {
for (quint32 x = 0; x < bh.width; x++) {
if (static_cast<quint32>(k + 3) > m_data.size()) {
if (k + 3 > m_data.size()) {
kDebug(DBG_AREA_FILE) << "failed in RGB\n";
return false;
}
......@@ -232,14 +244,13 @@ bool KisPattern::init()
m_data[k + 1],