Carna  Version 3.3.2
ManagedTexture3D.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 - 2015 Leonid Kostrykin
3  *
4  * Chair of Medical Engineering (mediTEC)
5  * RWTH Aachen University
6  * Pauwelsstr. 20
7  * 52074 Aachen
8  * Germany
9  *
10  */
11 
12 #ifndef MANAGEDTEXTURE3D_H_6014714286
13 #define MANAGEDTEXTURE3D_H_6014714286
14 
15 #include <Carna/Carna.h>
18 #include <Carna/base/noncopyable.h>
19 #include <Carna/base/math.h>
20 
25 namespace Carna
26 {
27 
28 namespace base
29 {
30 
31 
32 
33 // ----------------------------------------------------------------------------------
34 // ManagedTexture3D
35 // ----------------------------------------------------------------------------------
36 
44 class CARNA_LIB ManagedTexture3D : public GeometryFeature
45 {
46 
48 
49 protected:
50 
51  friend class GeometryFeature;
52  friend class ManagedTexture3DInterface;
53 
83  ManagedTexture3D( const math::Vector3ui& size, int internalFormat, int pixelFormat, int bufferType, const void* bufferPtr );
84 
89 
93  std::unique_ptr< Texture< 3 > > textureObject;
94 
95 public:
96 
97  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
98 
103 
110  static ManagedTexture3D& create
111  ( const math::Vector3ui& size
112  , int internalFormat
113  , int pixelFormat
114  , int bufferType
115  , const void* bufferPtr );
116 
118  const int internalFormat;
119  const int pixelFormat;
120  const int bufferType;
121  const void* const bufferPtr;
122 
136 
141  virtual bool controlsSameVideoResource( const GeometryFeature& ) const override;
142 
143  virtual ManagedTexture3DInterface* acquireVideoResource() override;
144 
145 }; // ManagedTexture3D
146 
147 
148 
149 } // namespace Carna :: base
150 
151 } // namespace Carna
152 
153 #endif // MANAGEDTEXTURE3D_H_6014714286
const math::Vector3ui size
Tells the resolution of this texture.
Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
const int pixelFormat
Holds the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA.
const int bufferType
Specifies the data type of the pixel data to be uploaded to the texture.
const int internalFormat
Holds the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16.
Interfaces the Texture<3> that a ManagedTexture3D represents.
Defines Carna::base::GeometryFeature.
Eigen::Matrix< unsigned int, 3, 1 > Vector3ui
Defines vector.
Definition: math.h:199
Represents 3D OpenGL texture object whose lifetime is managed by instances of this class...
Represents "components" that are aggregated by Geometry objects. Closer description is given here...
const base::math::Matrix4f textureCoordinatesCorrection
Stretches texture coordinates s.t. the centers of the texels, that are located in the texture corners...
Defines Carna::base::ManagedTexture3DInterface.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition: math.h:193
ManagedTexture3DInterface ManagedInterface
Defines the type to be used for interfacing the video resource.
std::unique_ptr< Texture< 3 > > textureObject
Holds the maintained OpenGL texture object.
const void *const bufferPtr
Points to the pixel data that will be uploaded to the texture.
#define NON_COPYABLE
Features class it is placed in as non-copyable.
Definition: noncopyable.h:109