gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog backend/render_handler_agg.cpp


From: Udo Giacomozzi
Subject: [Gnash-commit] gnash ChangeLog backend/render_handler_agg.cpp
Date: Tue, 05 Jun 2007 08:27:55 +0000

CVSROOT:        /cvsroot/gnash
Module name:    gnash
Changes by:     Udo Giacomozzi <udog>   07/06/05 08:27:55

Modified files:
        .              : ChangeLog 
        backend        : render_handler_agg.cpp 

Log message:
        fix rotated video with AGG backend

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.3455&r2=1.3456
http://cvs.savannah.gnu.org/viewcvs/gnash/backend/render_handler_agg.cpp?cvsroot=gnash&r1=1.84&r2=1.85

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/gnash/gnash/ChangeLog,v
retrieving revision 1.3455
retrieving revision 1.3456
diff -u -b -r1.3455 -r1.3456
--- ChangeLog   5 Jun 2007 06:07:28 -0000       1.3455
+++ ChangeLog   5 Jun 2007 08:27:54 -0000       1.3456
@@ -1,3 +1,9 @@
+2007-06-04 Udo Giacomozzi <address@hidden>
+
+       * backend/render_handler_agg.cpp: correct matrix transformation
+         for rotated video; switch to /cloning/ image accessor to
+         make edges smooth for rotated video   
+       
 2007-06-05 Zou Lunkai <address@hidden>
 
        * server/as_object.h: change operator "==" to "=", should fix a typo.

Index: backend/render_handler_agg.cpp
===================================================================
RCS file: /cvsroot/gnash/gnash/backend/render_handler_agg.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -b -r1.84 -r1.85
--- backend/render_handler_agg.cpp      4 Jun 2007 16:59:03 -0000       1.84
+++ backend/render_handler_agg.cpp      5 Jun 2007 08:27:55 -0000       1.85
@@ -17,7 +17,7 @@
 
  
 
-/* $Id: render_handler_agg.cpp,v 1.84 2007/06/04 16:59:03 strk Exp $ */
+/* $Id: render_handler_agg.cpp,v 1.85 2007/06/05 08:27:55 udog Exp $ */
 
 // Original version by Udo Giacomozzi and Hannes Mayr, 
 // INDUNET GmbH (www.indunet.it)
@@ -334,6 +334,8 @@
   double xscale, yscale;
 
 
+
+
 public:
   //int              m_view_width;      // TODO: remove these??
   //int              m_view_height;
@@ -434,9 +436,6 @@
     // whatever), but we'd need some way to tell the renderer the desired
     // quality.
     
-    // TODO: Test this with a rotated video. Maybe the image accessor
-    // will insert some ugly pixels (even if I don't think so) - Udo
-
     // TODO: keep heavy instances alive accross frames for performance!
     
     // TODO: Maybe implement specialization for 1:1 scaled videos
@@ -453,8 +452,8 @@
     // convert Gnash matrix to AGG matrix and scale down to pixel coordinates
     // while we're at it 
     agg::trans_affine img_mtx(
-      mat->m_[0][0]*20.0*vscaleX, mat->m_[1][0], 
-      mat->m_[0][1],              mat->m_[1][1]*20.0*vscaleY, 
+      mat->m_[0][0], mat->m_[1][0], 
+      mat->m_[0][1], mat->m_[1][1], 
       mat->m_[0][2],              mat->m_[1][2]
     );
     
@@ -464,14 +463,18 @@
     // invert matrix since this is used for the image source
     img_mtx.invert();
     
+    // convert TWIPS to pixels and apply video scale
+    img_mtx *= agg::trans_affine_scaling(1.0/(20.0*vscaleX), 
1.0/(20.0*vscaleY));
+    
     // span allocator is used to apply the matrix
     agg::span_allocator<agg::rgba8> sa;
         
     typedef agg::span_interpolator_linear<> interpolator_type;
     interpolator_type interpolator(img_mtx);
     
-    // clipping image accessor is used to avoid repeating of the image
-    typedef agg::image_accessor_clip<baseformat> img_source_type;
+    // cloning image accessor is used to avoid disturbing pixels at the edges
+    // for rotated video. 
+    typedef agg::image_accessor_clone<baseformat> img_source_type;
     
     // rendering buffer is used to access the frame pixels here        
     agg::rendering_buffer img_buf(frame->m_data, frame->m_width, 
frame->m_height,
@@ -479,10 +482,7 @@
          
     baseformat img_pixf(img_buf);
     
-    // The second parameter passed to the constructor is the color (R,G,B,A) 
-    // used for pixels outside the source image (ie. when the movie aspect 
-    // ratio does not match the video instance). 
-    img_source_type img_src(img_pixf, agg::rgba_pre(255,0,0,0));
+    img_source_type img_src(img_pixf);
     
     // renderer base for the stage buffer (not the frame image!)
     renderer_base rbase(*m_pixf);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]