branches/koffice/1.6/koffice/krita/core

Cyrille Berger cyb at lepi.org
Thu Mar 15 22:31:19 CET 2007


SVN commit 642937 by berger:

- revert the patch for fixing scaling
- install kis_layer_visitor.h it's needed when including kis_layer.h


BUG: 136712
CCMAIL: kimageshop at kde.org


 M  +1 -1      Makefile.am  
 M  +15 -29    kis_transform_worker.cc  


--- branches/koffice/1.6/koffice/krita/core/Makefile.am #642936:642937
@@ -42,7 +42,7 @@
 		kis_paint_device_iface.h kis_paint_device.h kis_painter.h kis_paintop.h kis_paintop_registry.h \
 		kis_palette.h kis_pattern.h kis_point.h kis_rect.h kis_resource.h kis_selection.h \
 		kis_transaction.h kis_types.h kis_vec.h kis_filter_config_widget.h \
-		kis_filter_configuration.h kis_exif_info.h kis_exif_value.h kis_substrate.h kis_perspective_math.h kis_scale_visitor.h kis_paint_layer.h
+		kis_filter_configuration.h kis_exif_info.h kis_exif_value.h kis_substrate.h kis_perspective_math.h kis_scale_visitor.h kis_paint_layer.h kis_layer_visitor.h
 
 libkritaimage_la_LDFLAGS = -version-info 1:0:0 -no-undefined $(all_libraries)
 libkritaimage_la_LIBADD = ../sdk/libkritasdk.la ../kritacolor/libkritacolor.la tiles/libkritatile.la $(OPENEXR_LIBS) $(LCMS_LIBS) $(LIB_KOFFICECORE) $(LIB_KOPAINTER) $(LIB_KDECORE) $(LIB_QT) $(OPENEXR_LIBS) 
--- branches/koffice/1.6/koffice/krita/core/kis_transform_worker.cc #642936:642937
@@ -266,38 +266,30 @@
     return dev->createVLineIterator(lineNum, start, len, true);
 }
 
-template <class iter> void calcDimensions (KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines, Q_INT32 &srcStartData, Q_INT32 &srcLenData);
+template <class iter> void calcDimensions (KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines);
 
 template <> void calcDimensions <KisHLineIteratorPixel>
-        (KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines, Q_INT32 &srcStartData, Q_INT32 &srcLenData)
+(KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines)
 {
-    dev->exactBounds(srcStartData, firstLine, srcLenData, numLines);
     if(dev->hasSelection())
     {
         QRect r = dev->selection()->selectedExactRect();
         r.rect(&srcStart, &firstLine, &srcLen, &numLines);
     }
     else
-    {
-        srcStart = srcStartData;
-        srcLen = srcLenData;
-    }
+        dev->exactBounds(srcStart, firstLine, srcLen, numLines);
 }
 
 template <> void calcDimensions <KisVLineIteratorPixel>
-        (KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines, Q_INT32 &srcStartData, Q_INT32 &srcLenData)
+(KisPaintDevice *dev, Q_INT32 &srcStart, Q_INT32 &srcLen, Q_INT32 &firstLine, Q_INT32 &numLines)
 {
-    dev->exactBounds(firstLine, srcStartData, numLines, srcLenData);
     if(dev->hasSelection())
     {
         QRect r = dev->selection()->selectedExactRect();
         r.rect(&firstLine, &srcStart, &numLines, &srcLen);
     }
     else
-    {
-        srcStart = srcStartData;
-        srcLen = srcLenData;
-    }
+        dev->exactBounds(firstLine, srcStart, numLines, srcLen);
 }
 
 struct FilterValues
@@ -309,7 +301,7 @@
 
 template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, KisPaintDevice *dst, double floatscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy)
 {
-    Q_INT32 lineNum,srcStart,firstLine,srcLen,numLines,srcStartData,srcLenData;
+    Q_INT32 lineNum,srcStart,firstLine,srcLen,numLines;
     Q_INT32 center, begin, end;    /* filter calculation variables */
     Q_UINT8 *data;
     Q_UINT8 pixelSize = src->pixelSize();
@@ -324,7 +316,7 @@
     else
         dstSelection = new KisSelection(dst); // essentially a dummy to be deleted
 
-    calcDimensions <T>(src, srcStart, srcLen, firstLine, numLines,srcStartData,srcLenData);
+    calcDimensions <T>(src, srcStart, srcLen, firstLine, numLines);
 
     scale = int(floatscale*srcLen);
     scaleDenom = srcLen;
@@ -432,31 +424,25 @@
         dstStart += int(floor(lineNum * shear));
 
         // Build a temporary line
-        T srcIt = createIterator <T>(src, QMAX(srcStart - extraLen, srcStartData), lineNum, srcLen+2*extraLen);
+        T srcIt = createIterator <T>(src, srcStart - extraLen, lineNum, srcLen+2*extraLen);
         Q_INT32 i = 0;
-        Q_INT32 x = srcStart - extraLen;
-        while(i < srcLen + 2*extraLen)
+        while(!srcIt.isDone())
         {
             Q_UINT8 *data;
 
-            data = srcIt.rawData();
-            memcpy(&tmpLine[i*pixelSize], data, pixelSize);
+                data = srcIt.rawData();
+                memcpy(&tmpLine[i*pixelSize], data, pixelSize);
+
+                // XXX: Should set alpha = alpha*(1-selectedness)
+                cs->setAlpha(data, 0, 1);
             if(srcIt.isSelected())
             {
                 tmpSel[i] = 255;
             }
             else
-            {
                 tmpSel[i] = 0;
-            }
-            if(x >= srcStartData && x < srcStartData + srcLenData - 1)
-            {
-                // XXX: Should set alpha = alpha*(1-selectedness)
-                cs->setAlpha(data, 0, 1);
-                ++srcIt;
-            }
+            ++srcIt;
             i++;
-            x++;
         }
 
         T dstIt = createIterator <T>(dst, dstStart, lineNum, dstLen);


More information about the kimageshop mailing list