jonathan: thuban/libraries/thuban gdalwarp.cpp,1.7,1.8

cvs@intevation.de cvs at intevation.de
Fri Feb 18 15:54:19 CET 2005


Author: jonathan

Update of /thubanrepository/thuban/libraries/thuban
In directory doto:/tmp/cvs-serv11859/libraries/thuban

Modified Files:
	gdalwarp.cpp 
Log Message:
Refactored baserenderer.py and renderer.py to remove baserenderer.py's
dependencies on wxPython. Added a new method projected_raster_layer()
that returns a raster layer image in projected space. This must be
implemented in classes derived from BaseRenderer. This also eliminates
the dependency on gdal in baserenderer.py.


Index: gdalwarp.cpp
===================================================================
RCS file: /thubanrepository/thuban/libraries/thuban/gdalwarp.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- gdalwarp.cpp	16 Feb 2005 21:14:47 -0000	1.7
+++ gdalwarp.cpp	18 Feb 2005 14:54:17 -0000	1.8
@@ -29,6 +29,13 @@
  ******************************************************************************
  *
  * $Log$
+ * Revision 1.8  2005/02/18 14:54:17  jonathan
+ * Refactored baserenderer.py and renderer.py to remove baserenderer.py's
+ * dependencies on wxPython. Added a new method projected_raster_layer()
+ * that returns a raster layer image in projected space. This must be
+ * implemented in classes derived from BaseRenderer. This also eliminates
+ * the dependency on gdal in baserenderer.py.
+ *
  * Revision 1.7  2005/02/16 21:14:47  jonathan
  * Further wxPython 2.5 changes using patches from Daniel Calvelo Aros
  * so that that wxproj doesn't crash. Added GUI support for selecting
@@ -128,7 +135,6 @@
  */
 
 #include <Python.h>
-#include <wx/wx.h>
 
 #include "gdal.h"
 #include "gdal_alg.h"
@@ -145,6 +151,7 @@
 
 #define OPTS_MASK  1
 #define OPTS_ALPHA 2
+#define OPTS_INVERT_MASK_BITS 4
 
 CPL_CVSID("$Id$");
 
@@ -160,7 +167,7 @@
 static double	       dfXRes=0.0, dfYRes=0.0;
 static int             nForcePixels=0, nForceLines=0;
 static int             bEnableDstAlpha = FALSE, bEnableSrcAlpha = FALSE;
-static int             bMakeMask, bMakeAlpha;
+static int             bMakeMask, bMakeAlpha, bInvertMask;
 const char             *pszSrcFilename = NULL, *pszDstFilename = "MEM:::";
 
 static PyMethodDef gdalwarp_methods[] = {
@@ -491,11 +498,14 @@
                         {
                             for (j=0; j < nRasterXSize;)
                             {
-#if wxCHECK_VERSION(2,5,3)
-                                if (*tptr++ >= 128) c |= b;
-#else
-                                if (*tptr++ < 128) c |= b;
-#endif
+                                if (bInvertMask)
+                                {
+                                    if (*tptr++ < 128) c |= b;
+                                }
+                                else
+                                {
+                                    if (*tptr++ >= 128) c |= b;
+                                }
 
                                 b <<= 1;
                                 if (!(++j & 7))
@@ -639,10 +649,8 @@
 
     options  = ( int )PyInt_AsLong( opts );
     bMakeMask  = (options & OPTS_MASK) == OPTS_MASK;
-
-#if wxCHECK_VERSION(2,5,3)
     bMakeAlpha = (options & OPTS_ALPHA) == OPTS_ALPHA;
-#endif
+    bInvertMask = (options & OPTS_INVERT_MASK_BITS) == OPTS_INVERT_MASK_BITS;
 
     // FIXME: error if bMakeMask == bMaskAlpha
 





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)