/[libvob]/libvob/include/vob/vobs/Pixel.hxx
ViewVC logotype

Diff of /libvob/include/vob/vobs/Pixel.hxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by tjl, Tue Mar 11 12:10:31 2003 UTC revision 1.3 by tjl, Sun Jun 29 08:13:15 2003 UTC
# Line 70  struct DrawPixels { Line 70  struct DrawPixels {
70  };  };
71  VOB_DEFINED(DrawPixels);  VOB_DEFINED(DrawPixels);
72    
73    struct ReadPixels {
74        enum { NTrans = 1 };
75    
76        int w, h;
77        Token format;
78        Token type;
79        GLubyte *bytes;
80    
81        template<class F> void params(F &f) {
82            f(w, h, format, type, bytes);
83        }
84    
85        template<class T> void render(const T &t) const {
86            glPushAttrib(GL_PIXEL_MODE_BIT);
87            glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
88            glPixelStorei(GL_PACK_ROW_LENGTH, 0);
89            glPixelStorei(GL_PACK_ALIGNMENT, 1);
90            ZPt p = t.transform(ZPt(0,0,0));
91            glRasterPos3f(p.x, p.y, p.z);
92            float ras[4];
93            glGetFloatv(GL_CURRENT_RASTER_POSITION, ras);
94    
95            glReadPixels((int)ras[0], (int)ras[1]-h, w, h, format, type, bytes);
96            GLERR
97            glPopClientAttrib();
98            glPopAttrib();
99        }
100    };
101    VOB_DEFINED(ReadPixels);
102    
103    
104  }  }
105  }  }
106    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26