LibCarna Version 3.4.0
Loading...
Searching...
No Matches
ManagedTexture3D.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2010 - 2016 Leonid Kostrykin
3 *
4 * Chair of Medical Engineering (mediTEC)
5 * RWTH Aachen University
6 * Pauwelsstr. 20
7 * 52074 Aachen
8 * Germany
9 *
10 *
11 * Copyright (C) 2021 - 2025 Leonid Kostrykin
12 *
13 */
14
15#ifndef MANAGEDTEXTURE3D_H_6014714286
16#define MANAGEDTEXTURE3D_H_6014714286
17
18#include <LibCarna/LibCarna.hpp>
23
29namespace LibCarna
30{
31
32namespace base
33{
34
35
36
37// ----------------------------------------------------------------------------------
38// ManagedTexture3D
39// ----------------------------------------------------------------------------------
40
47class LIBCARNA ManagedTexture3D : public GeometryFeature
48{
49
51
52protected:
53
54 friend class GeometryFeature;
55 friend class ManagedTexture3DInterface;
56
86 ManagedTexture3D( const math::Vector3ui& size, int internalFormat, int pixelFormat, int bufferType, const void* bufferPtr );
87
92
96 std::unique_ptr< Texture< 3 > > textureObject;
97
98public:
99
101
106
114 ( const math::Vector3ui& size
115 , int internalFormat
116 , int pixelFormat
117 , int bufferType
118 , const void* bufferPtr );
119
121 const int internalFormat;
122 const int pixelFormat;
123 const int bufferType;
124 const void* const bufferPtr;
125
139
144 virtual bool controlsSameVideoResource( const GeometryFeature& ) const override;
145
147
148}; // ManagedTexture3D
149
150
151
152} // namespace LibCarna :: base
153
154} // namespace LibCarna
155
156#endif // MANAGEDTEXTURE3D_H_6014714286
Defines LibCarna::base::GeometryFeature.
Contains forward-declarations.
Defines LibCarna::base::ManagedTexture3DInterface.
Represents an association.
Represents "components" that are aggregated by Geometry objects. Closer description is given here.
Interfaces the Texture<3> that a ManagedTexture3D represents.
Represents 3D OpenGL texture object whose lifetime is managed by instances of this class.
ManagedTexture3D(const math::Vector3ui &size, int internalFormat, int pixelFormat, int bufferType, const void *bufferPtr)
Instantiates.
virtual bool controlsSameVideoResource(const GeometryFeature &) const override
Tells whether this instance maintains the same video resources like other.
const int pixelFormat
Holds the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA.
static ManagedTexture3D & create(const math::Vector3ui &size, int internalFormat, int pixelFormat, int bufferType, const void *bufferPtr)
Instantiates. Invoke release when it isn't needed any longer.
const math::Vector3ui size
Tells the resolution of this texture.
std::unique_ptr< Texture< 3 > > textureObject
Holds the maintained OpenGL texture object.
const int bufferType
Specifies the data type of the pixel data to be uploaded to the texture.
const base::math::Matrix4f textureCoordinatesCorrection
Stretches texture coordinates s.t. the centers of the texels, that are located in the texture corners...
const int internalFormat
Holds the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16.
const void *const bufferPtr
Points to the pixel data that will be uploaded to the texture.
ManagedTexture3DInterface ManagedInterface
Defines the type to be used for interfacing the video resource.
virtual ManagedTexture3DInterface * acquireVideoResource() override
Acquires the video resources from this GeometryFeature by returning new instance of a class derived f...
Defines LibCarna::base::math namespace and LIBCARNA_FOR_VECTOR3UI.
Eigen::Matrix< float, 4, 4, Eigen::ColMajor > Matrix4f
Defines matrix.
Definition math.hpp:197
Eigen::Matrix< unsigned int, 3, 1 > Vector3ui
Defines vector.
Definition math.hpp:203
Defines LibCarna::base::noncopyable and NON_COPYABLE.
#define NON_COPYABLE
Marks the class that it is placed in as non-copyable.