[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-kimageshop
Subject: Re: iterator offset problem
From: Bart Coppens <kde () bartcoppens ! be>
Date: 2005-03-20 20:28:25
Message-ID: 200503202128.26813.kde () bartcoppens ! be
[Download RAW message or body]
On Friday 18 March 2005 16:19, Casper Boemann wrote:
> yes, lets do that.
>
> Bart, I assume you do it.
Does attached look good to you?
Bart Coppens
["displaced2.diff" (text/x-diff)]
Index: core/kis_iterators_pixel.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_iterators_pixel.cc,v
retrieving revision 1.9
diff -u -p -r1.9 kis_iterators_pixel.cc
--- core/kis_iterators_pixel.cc 12 Mar 2005 11:54:14 -0000 1.9
+++ core/kis_iterators_pixel.cc 20 Mar 2005 17:53:21 -0000
@@ -22,29 +22,32 @@
#include "kis_global.h"
#include "kis_paint_device.h"
-KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, \
KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, bool \
writable) :
- KisHLineIterator(dm, x, y, w, writable),
- KisIteratorPixelTrait <KisHLineIterator> ( ndevice, this )
+KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, \
KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 \
offsetx, Q_INT32 offsety, bool writable) : + KisHLineIterator(dm, x - offsetx, y - \
offsety, w, writable), + KisIteratorPixelTrait <KisHLineIterator> ( ndevice, this ),
+ m_offsetx(offsetx), m_offsety(offsety)
{
if(sel_dm)
KisIteratorPixelTrait <KisHLineIterator>::setSelectionIterator(
- new KisHLineIterator(sel_dm, x, y, w, writable));
+ new KisHLineIterator(sel_dm, x - offsetx, y - offsety, w, writable));
}
-KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, \
KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, bool \
writable) :
- KisVLineIterator(dm, x, y, h, writable),
- KisIteratorPixelTrait <KisVLineIterator> ( ndevice, this )
+KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, \
KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, Q_INT32 \
offsetx, Q_INT32 offsety, bool writable) : + KisVLineIterator(dm, x - offsetx, y - \
offsety, h, writable), + KisIteratorPixelTrait <KisVLineIterator> ( ndevice, this ),
+ m_offsetx(offsetx), m_offsety(offsety)
{
if(sel_dm)
KisIteratorPixelTrait <KisVLineIterator>::setSelectionIterator(
- new KisVLineIterator(sel_dm, x, y, h, writable));
+ new KisVLineIterator(sel_dm, x - offsetx, y - offsety, h, writable));
}
-KisRectIteratorPixel::KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager \
*dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool \
writable) :
- KisRectIterator(dm, x, y, w, h, writable),
- KisIteratorPixelTrait <KisRectIterator> ( ndevice, this )
+KisRectIteratorPixel::KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager \
*dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_INT32 \
offsetx, Q_INT32 offsety, bool writable) : + KisRectIterator(dm, x - offsetx, y - \
offsety, w, h, writable), + KisIteratorPixelTrait <KisRectIterator> ( ndevice, this \
), + m_offsetx(offsetx), m_offsety(offsety)
{
if(sel_dm)
KisIteratorPixelTrait <KisRectIterator>::setSelectionIterator(
- new KisRectIterator(sel_dm, x, y, w, h, writable));
+ new KisRectIterator(sel_dm, x - offsetx, y - offsety, w, h, writable));
}
Index: core/kis_iterators_pixel.h
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_iterators_pixel.h,v
retrieving revision 1.16
diff -u -p -r1.16 kis_iterators_pixel.h
--- core/kis_iterators_pixel.h 12 Mar 2005 11:54:14 -0000 1.16
+++ core/kis_iterators_pixel.h 20 Mar 2005 17:53:21 -0000
@@ -35,22 +35,34 @@
class KisHLineIteratorPixel : public KisHLineIterator, public KisIteratorPixelTrait \
<KisHLineIterator> {
public:
- KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 x , Q_INT32 y , Q_INT32 w, bool writable); + \
KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 x , Q_INT32 y , Q_INT32 w, Q_INT32 offsetx, Q_INT32 offsety, bool \
writable); inline KisHLineIteratorPixel & operator ++(int n) { \
KisHLineIterator::operator++(n); advance(n); return *this;} + Q_INT32 x() { return \
KisHLineIterator::x() + m_offsetx; } + Q_INT32 y() { return KisHLineIterator::y() \
+ m_offsety; } +protected:
+ Q_INT32 m_offsetx, m_offsety;
};
class KisVLineIteratorPixel : public KisVLineIterator, public KisIteratorPixelTrait \
<KisVLineIterator> {
public:
- KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 xpos , Q_INT32 ypos , Q_INT32 height, bool writable); + \
KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 xpos , Q_INT32 ypos , Q_INT32 height, Q_INT32 offsetx, Q_INT32 \
offsety, bool writable); inline KisVLineIteratorPixel & operator ++(int n) { \
KisVLineIterator::operator++(n); advance(n); return *this;} + Q_INT32 x() { return \
KisVLineIterator::x() + m_offsetx; } + Q_INT32 y() { return KisVLineIterator::y() \
+ m_offsety; } +protected:
+ Q_INT32 m_offsetx, m_offsety;
};
class KisRectIteratorPixel : public KisRectIterator, public KisIteratorPixelTrait \
<KisRectIterator> {
public:
- KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, bool writable); + \
KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager \
*sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_INT32 offsetx, Q_INT32 \
offsety, bool writable); inline KisRectIteratorPixel & operator ++(int n) { \
KisRectIterator::operator++(n); advance(n); return *this;} + Q_INT32 x() { return \
KisRectIterator::x() + m_offsetx; } + Q_INT32 y() { return KisRectIterator::y() + \
m_offsety; } +protected:
+ Q_INT32 m_offsetx, m_offsety;
};
#endif
Index: core/kis_paint_device.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_paint_device.cc,v
retrieving revision 1.141
diff -u -p -r1.141 kis_paint_device.cc
--- core/kis_paint_device.cc 16 Mar 2005 14:25:35 -0000 1.141
+++ core/kis_paint_device.cc 20 Mar 2005 17:53:21 -0000
@@ -165,6 +165,8 @@ void KisPaintDevice::setName(const QStri
void KisPaintDevice::extent(Q_INT32 &x, Q_INT32 &y, Q_INT32 &w, Q_INT32 &h) const
{
m_datamanager -> extent(x, y, w, h);
+ x += m_x;
+ y += m_y;
}
QRect KisPaintDevice::extent() const
@@ -503,25 +505,25 @@ QImage KisPaintDevice::convertToQImage(K
KisRectIteratorPixel KisPaintDevice::createRectIterator(Q_INT32 left, Q_INT32 top, \
Q_INT32 w, Q_INT32 h, bool writable) {
if(hasSelection())
- return KisRectIteratorPixel(this, m_datamanager, m_selection->m_datamanager, left, \
top, w, h, writable); + return KisRectIteratorPixel(this, m_datamanager, \
m_selection->m_datamanager, left, top, w, h, m_x, m_y, writable); else
- return KisRectIteratorPixel(this, m_datamanager, NULL, left, top, w, h, writable);
+ return KisRectIteratorPixel(this, m_datamanager, NULL, left, top, w, h, m_x, m_y, \
writable); }
KisHLineIteratorPixel KisPaintDevice::createHLineIterator(Q_INT32 x, Q_INT32 y, \
Q_INT32 w, bool writable) {
if(hasSelection())
- return KisHLineIteratorPixel(this, m_datamanager, m_selection->m_datamanager, x, \
y, w, writable); + return KisHLineIteratorPixel(this, m_datamanager, \
m_selection->m_datamanager, x, y, w, m_x, m_y, writable); else
- return KisHLineIteratorPixel(this, m_datamanager, NULL, x, y, w, writable);
+ return KisHLineIteratorPixel(this, m_datamanager, NULL, x, y, w, m_x, m_y, \
writable); }
KisVLineIteratorPixel KisPaintDevice::createVLineIterator(Q_INT32 x, Q_INT32 y, \
Q_INT32 h, bool writable) {
if(hasSelection())
- return KisVLineIteratorPixel(this, m_datamanager, m_selection->m_datamanager, x, \
y, h, writable); + return KisVLineIteratorPixel(this, m_datamanager, \
m_selection->m_datamanager, x, y, h, m_x, m_y, writable); else
- return KisVLineIteratorPixel(this, m_datamanager, NULL, x, y, h, writable);
+ return KisVLineIteratorPixel(this, m_datamanager, NULL, x, y, h, m_x, m_y, \
writable);
}
Index: core/visitors/kis_flatten.h
===================================================================
RCS file: /home/kde/koffice/krita/core/visitors/kis_flatten.h,v
retrieving revision 1.12
diff -u -p -r1.12 kis_flatten.h
--- core/visitors/kis_flatten.h 12 Mar 2005 15:44:33 -0000 1.12
+++ core/visitors/kis_flatten.h 20 Mar 2005 17:53:21 -0000
@@ -122,8 +122,8 @@ private:
if (!m_test(dev))
return;
- sx = m_rc.x() - dev-> getX();
- sy = m_rc.y() - dev-> getY();
+ sx = m_rc.x();
+ sy = m_rc.y();
// kdDebug() << "Visiting on: " << dev
// << " dx: " << dx
// << " dy: " << dy
Index: core/visitors/kis_merge.h
===================================================================
RCS file: /home/kde/koffice/krita/core/visitors/kis_merge.h,v
retrieving revision 1.17
diff -u -p -r1.17 kis_merge.h
--- core/visitors/kis_merge.h 22 Feb 2005 20:38:16 -0000 1.17
+++ core/visitors/kis_merge.h 20 Mar 2005 17:53:21 -0000
@@ -90,8 +90,8 @@ public:
Q_INT32 sx, sy, dx, dy, w, h;
layer -> extent(sx,sy,w,h);
- dx = layer->getX() - gc.device()->getX() + sx;
- dy = layer->getY() - gc.device()->getY() + sy;
+ dx = sx;
+ dy = sy;
gc.bitBlt(dx, dy, layer -> compositeOp() , layer.data(), layer -> opacity(), sx, \
sy, w, h);
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic