|
Carna
Version 3.0.1
|
Represents 3D OpenGL texture object whose lifetime is managed by instances of this class. More...
#include <ManagedTexture3D.h>
Inheritance diagram for Carna::base::ManagedTexture3D:
Collaboration diagram for Carna::base::ManagedTexture3D:Public Types | |
| typedef ManagedTexture3DInterface | ManagedInterface |
| Defines the type to be used for interfacing the video resource. | |
Public Member Functions | |
| virtual bool | controlsSameVideoResource (const GeometryFeature &) const override |
| Tells whether this instance maintains the same video resources like other. More... | |
| virtual ManagedTexture3DInterface * | acquireVideoResource () override |
Acquires the video resources from this GeometryFeature by returning new instance of a class derived from ManagedInterface, that realizes the RAII idiom. Refer to its documentation for details. May return nullptr if this GeometryFeature does not provide any video resources. | |
Public Member Functions inherited from Carna::base::GeometryFeature | |
| unsigned int | videoResourceAcquisitionsCount () const |
| Tells current number of video resource acquisitions. | |
| void | release () |
| Denotes that this object is no longer required and may be deleted as soon as it is valid to delete it. More... | |
| void | addTo (Geometry &sceneGraphNode, unsigned int role) |
| Puts this geometry feature on the sceneGraphNode. More... | |
| void | removeFrom (Geometry &sceneGraphNode) |
| Removes this geometry feature from the sceneGraphNode. More... | |
Static Public Member Functions | |
| 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. More... | |
Public Attributes | |
| const math::Vector3ui | size |
| Tells the resolution of this texture. More... | |
| const int | internalFormat |
Holds the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16. More... | |
| const int | pixelFormat |
Holds the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA. More... | |
| const int | bufferType |
| Specifies the data type of the pixel data to be uploaded to the texture. | |
| const void *const | bufferPtr |
| Points to the pixel data that will 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, become located in those corners. More... | |
Protected Member Functions | |
| ManagedTexture3D (const math::Vector3ui &size, int internalFormat, int pixelFormat, int bufferType, const void *bufferPtr) | |
| Instantiates. More... | |
| ~ManagedTexture3D () | |
| Deletes. | |
Protected Member Functions inherited from Carna::base::GeometryFeature | |
| GeometryFeature () | |
| Instantiates. | |
| virtual | ~GeometryFeature () |
| Deletes and logs an error if video resources are leaked. | |
Protected Attributes | |
| std::unique_ptr< Texture< 3 > > | textureObject |
| Holds the maintained OpenGL texture object. | |
Friends | |
| class | GeometryFeature |
| class | ManagedTexture3DInterface |
Represents 3D OpenGL texture object whose lifetime is managed by instances of this class.
Definition at line 44 of file ManagedTexture3D.h.
|
protected |
Instantiates.
| size | is the resolution of this texture. |
| internalFormat | specifies the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16. |
| pixelFormat | specifies the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA. |
| bufferType | specifies the data type of the pixel data pointed to by bufferPtr. |
| bufferPtr | points to the pixel data that will be uploaded to the texture. |
|
overridevirtual |
Tells whether this instance maintains the same video resources like other.
This implementation always returns false.
Implements Carna::base::GeometryFeature.
Reimplemented in Carna::base::BufferedVectorFieldTexture< BufferedVectorFieldType >.
|
static |
Instantiates. Invoke release when it isn't needed any longer.
| size | is the resolution of this texture. |
| internalFormat | specifies the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16. |
| pixelFormat | specifies the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA. |
| bufferType | specifies the data type of the pixel data pointed to by bufferPtr. |
| bufferPtr | points to the pixel data that will be uploaded to the texture. |
| const int Carna::base::ManagedTexture3D::internalFormat |
Holds the number of color components in the texture, e.g. GL_RGBA8UI or GL_INTENSITY16.
Definition at line 118 of file ManagedTexture3D.h.
| const int Carna::base::ManagedTexture3D::pixelFormat |
Holds the format of the pixel data, e.g. GL_RED, GL_RGB or GL_RGBA.
Definition at line 119 of file ManagedTexture3D.h.
| const math::Vector3ui Carna::base::ManagedTexture3D::size |
Tells the resolution of this texture.
isValid() == true Definition at line 117 of file ManagedTexture3D.h.
| const base::math::Matrix4f Carna::base::ManagedTexture3D::textureCoordinatesCorrection |
Stretches texture coordinates s.t. the centers of the texels, that are located in the texture corners, become located in those corners.
Consider a \(4 \times 4\) texture. Each texel occupies \(\frac{1}{4}\) along each axis, hence the texels' centers are located at \(\frac{1}{8}\), \(\frac{3}{8}\), \(\frac{5}{8}\) and \(\frac{7}{8}\) along those axis.
This matrix transforms texture coordinates s.t. \( 0 \mapsto \frac{1}{8}\) and \( 1 \mapsto \frac{7}{8}\) following the considerations from above.
Definition at line 135 of file ManagedTexture3D.h.
Documentation generated by Doxygen