GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
HdlPBO.hpp
Go to the documentation of this file.
1 /* ************************************************************************************************************* */
2 /* */
3 /* GLIP-LIB */
4 /* OpenGL Image Processing LIBrary */
5 /* */
6 /* Author : R. Kerviche */
7 /* LICENSE : MIT License */
8 /* Website : glip-lib.net */
9 /* */
10 /* File : HdlPBO.hpp */
11 /* Original Date : August 7th 2010 */
12 /* */
13 /* Description : OpenGL Pixel Buffer Object Handle */
14 /* */
15 /* ************************************************************************************************************* */
16 
24 /* ************************************************************************************************************* */
25 /* */
26 /* Tips : UNPACK <-> UPLOAD Data to GPU */
27 /* PACK <-> DOWNLOAD Data from GPU */
28 /* */
29 /* ************************************************************************************************************* */
30 
31 #ifndef __HDLPBO_INCLUDE__
32 #define __HDLPBO_INCLUDE__
33 
34  // GL include
35  #include "Core/LibTools.hpp"
36  #include "Core/OglInclude.hpp"
37  #include "Core/HdlGeBO.hpp"
38  #include "Core/HdlTexture.hpp"
39 
40  namespace Glip
41  {
42  namespace CoreGL
43  {
44 
45  // prototypes :
46  class HdlFBO;
47 
48  // Pixel Buffer Object Handle
71  class GLIP_API HdlPBO : public HdlGeBO
72  {
73  private :
74  // Data
75  int w, h, c, cs;
76 
77  // No copy :
78  HdlPBO(const HdlPBO&);
79  const HdlPBO& operator=(const HdlPBO&);
80 
81  public :
82  // Tools
83  HdlPBO(int _w, int _h, int _c, int _cs, GLenum aim, GLenum freq, int size=-1);
84  HdlPBO(const HdlAbstractTextureFormat& fmt, GLenum aim, GLenum freq);
85  ~HdlPBO(void);
86 
87  int getWidth(void);
88  int getHeight(void);
89  int getChannelCount(void);
90  int getChannelSize(void);
91  void copyToTexture(HdlTexture& texture, int oX=0, int oY=0, int w=-1, int h=-1, GLenum mode=GL_NONE, GLenum depth=GL_NONE);
92  void bindAsPack(void);
93  void bindAsUnpack(void);
94 
95  //Static tools
96  static void unbind(GLenum target=0);
97  static void unmap(GLenum target=0);
98  };
99  }
100  }
101 
102 #endif
103 
Object handle for OpenGL Pixel Buffer Objects.
Definition: HdlPBO.hpp:71
Specific defines for the API structure.
OpenGL Texture Handle.
Object handle for OpenGL textures.
Definition: HdlTexture.hpp:138
Definition: Component.hpp:32
Object handle for OpenGL Buffer Object (VBO, PBO, VAO, ...).
Definition: HdlGeBO.hpp:40
OpenGL Generic handle for Buffer Objects (VBO, PBO, VAO, ...)
OpenGL includes and tools.
Object handle for OpenGL texture formats (Read Only).
Definition: HdlTexture.hpp:42