libcvd-members
[Top][All Lists]
Advanced

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

[libcvd-members] libcvd/cvd gl_helpers.h vision.h


From: Gerhard Reitmayr
Subject: [libcvd-members] libcvd/cvd gl_helpers.h vision.h
Date: Tue, 28 Nov 2006 11:08:29 +0000

CVSROOT:        /cvsroot/libcvd
Module name:    libcvd
Changes by:     Gerhard Reitmayr <gerhard>      06/11/28 11:08:29

Modified files:
        cvd            : gl_helpers.h vision.h 

Log message:
        function to print GL errors and a version of sample that returns the 
sampled value

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/gl_helpers.h?cvsroot=libcvd&r1=1.26&r2=1.27
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/vision.h?cvsroot=libcvd&r1=1.19&r2=1.20

Patches:
Index: gl_helpers.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/gl_helpers.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -b -r1.26 -r1.27
--- gl_helpers.h        11 Jul 2006 16:16:02 -0000      1.26
+++ gl_helpers.h        28 Nov 2006 11:08:29 -0000      1.27
@@ -21,6 +21,7 @@
 #ifndef CVD_GL_HELPERS_H
 #define CVD_GL_HELPERS_H
 
+#include <iostream>
 #include <vector>
 
 #include <cvd/image_ref.h>
@@ -32,6 +33,7 @@
 #include <cvd/rgba.h>
 #include <cvd/config.h>
 #include <GL/gl.h>
+#include <GL/glu.h>
 #include <cvd/internal/gl_types.h>
 
 #ifdef CVD_HAVE_TOON
@@ -452,6 +454,15 @@
                return i;
        }
 
+    /// Prints the current errors on the gl error stack
+    ///@ingroup gGL
+    inline void glPrintErrors(void){
+        GLenum code;
+        while((code = glGetError()) != GL_NO_ERROR){
+            std::cout << "GL:" << code << ":" << gluGetString(code) << 
std::endl;
+        }
+    }
+
 };
 
 #endif

Index: vision.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/vision.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -b -r1.19 -r1.20
--- vision.h    1 Aug 2006 14:04:33 -0000       1.19
+++ vision.h    28 Nov 2006 11:08:29 -0000      1.20
@@ -339,6 +339,12 @@
   }
   }
 
+template <class T, class S> inline T sample(const BasicImage<S>& im, double x, 
double y){
+    T result;
+    sample( im, x, y, result);
+    return result;
+}
+
 inline void sample(const BasicImage<float>& im, double x, double y, float& 
result)
   {
     int lx = (int)x;




reply via email to

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