[opengtl-commits] [693] don't set a width/height hint of -1 for generated kernels

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 693
Author:   cyrille
Date:     2009-03-26 11:35:37 +0100 (Thu, 26 Mar 2009)

Log Message:
-----------
don't set a width/height hint of -1 for generated kernels

Modified Paths:
--------------
    trunk/GTLDesigner/src/gtldesigner.cpp


Modified: trunk/GTLDesigner/src/gtldesigner.cpp
===================================================================
--- trunk/GTLDesigner/src/gtldesigner.cpp	2009-03-26 10:21:24 UTC (rev 692)
+++ trunk/GTLDesigner/src/gtldesigner.cpp	2009-03-26 10:35:37 UTC (rev 693)
@@ -329,8 +329,8 @@
     maxHeight = qMax(region.height(), maxHeight);
     inputDOD.push_back( region );
   }
-  m_kernel->setHint(OpenShiva::Kernel::IMAGE_HEIGHT, GTLCore::Value((float)maxHeight));
-  m_kernel->setHint(OpenShiva::Kernel::IMAGE_WIDTH, GTLCore::Value((float)maxWidth));
+  if( maxHeight != -1 ) m_kernel->setHint(OpenShiva::Kernel::IMAGE_HEIGHT, GTLCore::Value((float)maxHeight));
+  if( maxWidth != -1 ) m_kernel->setHint(OpenShiva::Kernel::IMAGE_WIDTH, GTLCore::Value((float)maxWidth));
   m_kernel->compile();
   if(m_kernel->isCompiled())
   {
@@ -348,6 +348,10 @@
         region += m_kernel->changed( *it, i, inputDOD );
       }
     }
+    if( region.width() == 1 or region.height() == 1 )
+    {
+      region = GTLCore::Region(0,0,800,600); // Use sane size
+    }
     kDebug() << region.width() << " " << region.height();
     QtGTL::QImageImage image( QImage( region.width(), region.height(), QImage::Format_ARGB32) );
     m_kernel->evaluatePixeles( region, inputImages, &image );


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/