core/vgui/vgui_section_render.h
Go to the documentation of this file.
00001 // This is core/vgui/vgui_section_render.h
00002 #ifndef vgui_section_render_h_
00003 #define vgui_section_render_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \author fsm
00010 
00011 #include <vgui/vgui_gl.h>
00012 #include <vbl/vbl_array_1d.h>
00013 //: Get the required image view given the state of the viewport and scale
00014 bool pixel_view(unsigned& i0, unsigned& ni, unsigned& j0, unsigned& nj,
00015                 float& zoomx, float& zoomy);
00016 
00017 //: Render the pixels onto the frame buffer
00018 //
00019 // This renders the portion of the image within (x0,y0)-(x1,y1). The
00020 // whole image is rendered if (x0,y0)==(0,0) and
00021 // (x1,y1)==(w,h). (Actually, for efficiency, only the portion
00022 // overlapping the viewport is ever rendered.)  \a format and \a type
00023 // encode the data encoding in \a pixels. \a pixels is assumed to
00024 // store a row-ordered set of byte-aligned values.
00025 //
00026 bool vgui_section_render(void const *pixels,
00027                          unsigned w, unsigned h, // Size of image.
00028                          float x0, float y0,  // Region of image
00029                          float x1, float y1,  // to render.
00030                          GLenum format,
00031                          GLenum type ,
00032                          bool hardware_map = false,
00033                          vbl_array_1d<float>* fLmap=0,
00034                          vbl_array_1d<float>* fRmap=0,
00035                          vbl_array_1d<float>* fGmap=0,
00036                          vbl_array_1d<float>* fBmap=0,
00037                          vbl_array_1d<float>* fAmap=0);
00038                          
00039 
00040 bool vgui_view_render(void const *pixels,
00041                       unsigned w, unsigned h, // Size of image.
00042                       float zoomx, float zoomy,
00043                       GLenum format,
00044                       GLenum type ,
00045                       bool hardware_map = false,
00046                       vbl_array_1d<float>* fLmap=0,
00047                       vbl_array_1d<float>* fRmap=0,
00048                       vbl_array_1d<float>* fGmap=0,
00049                       vbl_array_1d<float>* fBmap=0,
00050                       vbl_array_1d<float>* fAmap=0);
00051                          
00052 
00053 
00054 #endif // vgui_section_render_h_