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

List:       kde-commits
Subject:    kpdf_annotations: kdegraphics/kpdf/ui
From:       Enrico Ros <rosenric () dei ! unipd ! it>
Date:       2005-04-13 14:49:57
Message-ID: 20050413144957.7B2ED492 () office ! kde ! org
[Download RAW message or body]

CVS commit by eros: 

Highlight annotations: ok

PagePainter:
  Updated drawShape with RasterOperation (Normal, Multiply) for getting
  Highlight annotation types to work. All Highlight annotations are now
  drew using the Multiply raster operation.

Painter_AGG2:
  Replaced the agg_pixfmt_rgba.h pixformat definition template with an
  internal version that implements different raster operations too. The
  new version has been shrinked to the minimum, containing the only code
  needed by kpdf AGG2 rendering engine to work.

Thanks for Rob Buis for telling me the way to go and providing sample code
with his AGG2 algorithms.


  A            painter_agg2/kpdf_pixfmt_rgba.h   1.1.2.1 [UNKNOWN]
  M +9 -9      pagepainter.cpp   1.7.2.13
  M +2 -2      pagepainter.h   1.2.2.8
  M +3 -0      painter_agg2/README.kpdf   1.1.2.2
  R            painter_agg2/agg_pixfmt_rgba.h   1.1.2.1


--- kdegraphics/kpdf/ui/pagepainter.cpp  #1.7.2.12:1.7.2.13
@@ -275,5 +275,5 @@ void PagePainter::paintPageOnPainter( QP
                     path.append( point );
                     // draw the normalized path into image
-                    drawShapeOnImage( backImage, path, false, QPen( a->style.color \
), QBrush(), Blend ); +                    drawShapeOnImage( backImage, path, false, \
                QPen( a->style.color ), QBrush() );
                     */
                 }
@@ -327,5 +327,5 @@ void PagePainter::paintPageOnPainter( QP
                                 path.pop_back();
                                 path.pop_back();
-                                drawShapeOnImage( backImage, path, false, QPen( \
a->style.color, 2 ), QBrush(), Blend ); +                                \
drawShapeOnImage( backImage, path, false, QPen( a->style.color, 2 ), QBrush() );  \
break;  // make a line at 1/2 of the height
@@ -337,5 +337,5 @@ void PagePainter::paintPageOnPainter( QP
                                 path.pop_back();
                                 path.pop_back();
-                                drawShapeOnImage( backImage, path, false, QPen( \
a->style.color, 2 ), QBrush(), Blend ); +                                \
drawShapeOnImage( backImage, path, false, QPen( a->style.color, 2 ), QBrush() );  \
break;  }
@@ -366,5 +366,5 @@ void PagePainter::paintPageOnPainter( QP
                         }
                         // draw the normalized path into image
-                        drawShapeOnImage( backImage, path, false, QPen( \
a->style.color, 2 ), QBrush(), Blend ); +                        drawShapeOnImage( \
backImage, path, false, QPen( a->style.color, 2 ), QBrush() );  }
                 }
@@ -630,6 +630,6 @@ void PagePainter::colorizeImage( QImage 
 // primitives, but until that AGG2 does its job very fast and good-looking.
 
+#include "kpdf_pixfmt_rgba.h"
 #include "agg_rendering_buffer.h"
-#include "agg_pixfmt_rgba.h"
 #include "agg_renderer_base.h"
 #include "agg_scanline_u.h"
@@ -645,5 +645,5 @@ void PagePainter::drawShapeOnImage(
     const QPen & pen,
     const QBrush & brush,
-    DrawingOperation op
+    RasterOperation op
     //float antiAliasRadius
     )
@@ -672,6 +672,6 @@ void PagePainter::drawShapeOnImage(
     typedef agg::pixfmt_bgra32 bgra32;
     typedef agg::renderer_base< bgra32 > rb_bgra32;
-    bgra32 * pixels = new bgra32( buffer );
-    rb_bgra32 rb( *pixels );
+    bgra32 pixels( buffer, op == Multiply ? 1 : 0 );
+    rb_bgra32 rb( pixels );
     agg::renderer_scanline_aa_solid< rb_bgra32 > render( rb );
     // create rasterizer and scaline
@@ -688,5 +688,5 @@ void PagePainter::drawShapeOnImage(
     }
     for( int y = 0; y < imageHeight; y++ )
-        pixels->blend_color_hspan( 0, y, imageWidth, span, 0, (255*y)/imageHeight );
+        pixels.blend_color_hspan( 0, y, imageWidth, span, 0, (255*y)/imageHeight );
 #endif
 

--- kdegraphics/kpdf/ui/pagepainter.h  #1.2.2.7:1.2.2.8
@@ -54,5 +54,5 @@ class PagePainter
         // my pretty dear raster function
         typedef QValueList< NormalizedPoint > NormalizedPath;
-        enum DrawingOperation { Blend, Multiply };
+        enum RasterOperation { Normal, Multiply };
         static void drawShapeOnImage(
             QImage & image,
@@ -61,5 +61,5 @@ class PagePainter
             const QPen & pen = QPen(),
             const QBrush & brush = QBrush(),
-            DrawingOperation op = Blend
+            RasterOperation op = Normal
             //float antiAliasRadius = 1.0
         );

--- kdegraphics/kpdf/ui/painter_agg2/README.kpdf  #1.1.2.1:1.1.2.2
@@ -41,4 +41,7 @@
  agg_trans_affine.cpp, agg_vcgen_stroke.cpp
 
+< Raster Ops on RGBA color buffer >
+kpdf_pixfmt_rgba.h (removed: agg_pixfmt_rgba.h)
+
 < ..for every new algo added.. >
 ..append added files here..


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

Configure | About | News | Add a list | Sponsored by KoreLogic