[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-kimageshop
Subject:    Progress Info:-)
From:       Michael Thaler <michael.thaler () ph ! tum ! de>
Date:       2004-09-23 7:26:08
Message-ID: 200409230926.08381.michael.thaler () physik ! tu-muenchen ! de
[Download RAW message or body]

Hi,

Progress info for the scaling code is now working!!! I attached the patch, 
Boudewijn can you please check it in? (I will read the cvs instructions 
tonight so that I can check in changes myself next time, right now I don't 
have time because I have to go to work).

Michael:-))))

["mydiff" (text/x-diff)]

? mydiff
? core/kis_scale_visitor.cc.alt
? core/kis_scale_visitor.h.alt
? plugins/performancetest/wdg_perftest.cc
? plugins/performancetest/wdg_perftest.h
Index: core/kis_image.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_image.cc,v
retrieving revision 1.156
diff -u -3 -u -p -r1.156 kis_image.cc
--- core/kis_image.cc	22 Sep 2004 20:37:17 -0000	1.156
+++ core/kis_image.cc	23 Sep 2004 07:19:04 -0000
@@ -383,7 +383,7 @@ void KisImage::resize(const QRect& rc)
 	resize(rc.width(), rc.height());
 }
 
-void KisImage::scale(double sx, double sy, enumFilterType ftype) 
+void KisImage::scale(double sx, double sy, KisProgressDisplayInterface *m_progress, \
enumFilterType ftype)   {
 	kdDebug() << "KisImage::scale. SX: " 
 		  << sx
@@ -407,7 +407,7 @@ void KisImage::scale(double sx, double s
 	vKisLayerSP_it it;
 	for ( it = m_layers.begin(); it != m_layers.end(); ++it ) {
 		KisLayerSP layer = (*it);
-		layer -> scale(sx, sy, ftype);
+		layer -> scale(sx, sy, m_progress, ftype);
 	}
 
 
Index: core/kis_image.h
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_image.h,v
retrieving revision 1.89
diff -u -3 -u -p -r1.89 kis_image.h
--- core/kis_image.h	22 Sep 2004 21:06:43 -0000	1.89
+++ core/kis_image.h	23 Sep 2004 07:19:04 -0000
@@ -71,7 +71,7 @@ public:
 	void resize(Q_INT32 w, Q_INT32 h);
 	void resize(const QRect& rc);
 
-	void scale(double sx, double sy, enumFilterType ftype = MITCHELL_FILTER);
+	void scale(double sx, double sy, KisProgressDisplayInterface *m_progress, \
enumFilterType ftype = MITCHELL_FILTER);  void rotate(double angle);
         
 	void convertTo(KisStrategyColorSpaceSP colorStrategy);
Index: core/kis_paint_device.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_paint_device.cc,v
retrieving revision 1.101
diff -u -3 -u -p -r1.101 kis_paint_device.cc
--- core/kis_paint_device.cc	22 Sep 2004 20:37:17 -0000	1.101
+++ core/kis_paint_device.cc	23 Sep 2004 07:19:04 -0000
@@ -313,11 +313,11 @@ void KisPaintDevice::accept(KisScaleVisi
         visitor.visitKisPaintDevice(this);
 }
 
-void KisPaintDevice::scale(double xscale, double yscale, enumFilterType ftype)
+void KisPaintDevice::scale(double xscale, double yscale, KisProgressDisplayInterface \
*m_progress, enumFilterType ftype)  {
         KisScaleVisitor visitor;
         accept(visitor);
-        visitor.scale(xscale, yscale, ftype);
+        visitor.scale(xscale, yscale, m_progress, ftype);
 }
 
 void KisPaintDevice::rotate(double angle) 
Index: core/kis_paint_device.h
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_paint_device.h,v
retrieving revision 1.80
diff -u -3 -u -p -r1.80 kis_paint_device.h
--- core/kis_paint_device.h	22 Sep 2004 20:37:17 -0000	1.80
+++ core/kis_paint_device.h	23 Sep 2004 07:19:05 -0000
@@ -186,7 +186,7 @@ public:
         void resize(Q_INT32 w, Q_INT32 h);
         void resize(const QSize& size);
         void resize();
-	void scale(double sx, double sy, enumFilterType ftype=MITCHELL_FILTER);
+	void scale(double sx, double sy, KisProgressDisplayInterface *m_progress, \
enumFilterType ftype=MITCHELL_FILTER);  void rotate(double angle);
 
 	/**
Index: core/kis_scale_visitor.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_scale_visitor.cc,v
retrieving revision 1.3
diff -u -3 -u -p -r1.3 kis_scale_visitor.cc
--- core/kis_scale_visitor.cc	22 Sep 2004 20:37:17 -0000	1.3
+++ core/kis_scale_visitor.cc	23 Sep 2004 07:19:05 -0000
@@ -22,8 +22,9 @@
 
 #include "kis_paint_device.h"
 #include "kis_scale_visitor.h"
+#include "kis_progress_display_interface.h"
 
-void KisScaleVisitor::scale(double xscale, double yscale, enumFilterType filterType) \
 +void KisScaleVisitor::scale(double xscale, double yscale, \
KisProgressDisplayInterface *m_progress, enumFilterType filterType)   {
         
         //define filter supports
@@ -85,6 +86,9 @@ void KisScaleVisitor::scale(double xscal
         // create intermediate column to hold horizontal dst column zoom
         QUANTUM * tmp = new QUANTUM[m_dev -> height() * m_dev -> depth() * \
sizeof(QUANTUM)];  
+        //progress info
+        m_progress -> setSubject(this, true, true);
+        
         /* Build y weights */
         /* pre-calculate filter contributions for a column */
         contribY = (CLIST *)calloc(targetH, sizeof(CLIST));
Index: core/kis_scale_visitor.h
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_scale_visitor.h,v
retrieving revision 1.3
diff -u -3 -u -p -r1.3 kis_scale_visitor.h
--- core/kis_scale_visitor.h	22 Sep 2004 20:37:17 -0000	1.3
+++ core/kis_scale_visitor.h	23 Sep 2004 07:19:05 -0000
@@ -22,6 +22,7 @@
 #include "kis_progress_subject.h"
 
 class KisPaintDevice;
+class KisProgressDisplayInterface;
 
 enum enumFilterType {
 	BOX_FILTER,
@@ -51,7 +52,7 @@ public:
         KisScaleVisitor();
         ~KisScaleVisitor();
         void visitKisPaintDevice(KisPaintDevice* dev);
-        void scale(double sx, double sy, enumFilterType filterType = \
MITCHELL_FILTER); +        void scale(double sx, double sy, \
KisProgressDisplayInterface *m_progress, enumFilterType filterType = \
MITCHELL_FILTER);  private:
         KisPaintDevice* m_dev;
         
Index: core/kis_view.cc
===================================================================
RCS file: /home/kde/koffice/krita/core/kis_view.cc,v
retrieving revision 1.335
diff -u -3 -u -p -r1.335 kis_view.cc
--- core/kis_view.cc	22 Sep 2004 20:37:17 -0000	1.335
+++ core/kis_view.cc	23 Sep 2004 07:19:08 -0000
@@ -1510,7 +1510,7 @@ void KisView::scaleLayer(double sx, doub
 	KisLayerSP layer = currentImg() -> activeLayer();
 	if (!layer) return;
 
-	layer -> scale(sx, sy, ftype);
+	layer -> scale(sx, sy, m_progress, ftype);
 
 	m_doc -> setModified(true);
 	layersUpdated();
@@ -2612,7 +2612,7 @@ void KisView::scaleCurrentImage(double s
 {
 	if (!currentImg()) return;
 	kdDebug() << "Going to scale image to (sx, sy): " << sx << ", " << sy << "\n";
-	currentImg() -> scale(sx, sy, ftype);
+	currentImg() -> scale(sx, sy, m_progress, ftype);
 	m_doc -> setModified(true);
 
 	resizeEvent(0);



_______________________________________________
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