8#ifndef META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
9#define META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
24namespace GLESceneGraph
82 TextureProperties(
const GLESAttribute::ProgramType programType,
const GLenum primaryFormat,
const GLenum primaryType,
const GLenum secondaryFormat,
const GLenum secondaryType,
const unsigned int secondaryWidthDivisor,
const unsigned int secondaryHeightDivisor,
const SecondaryLayout secondaryLayout);
94 GLenum primaryFormat_ = 0;
97 GLenum primaryType_ = 0;
100 GLenum secondaryFormat_ = 0;
103 GLenum secondaryType_ = 0;
106 unsigned int secondaryWidthDivisor_ = 0u;
109 unsigned int secondaryHeightDivisor_ = 0u;
120 inline bool needsSecondaryTextureObjects()
const;
201 inline GLuint primaryTextureId()
const;
207 inline GLuint secondaryTextureId()
const;
271 static bool determineAlignment(
const Frame& frame,
const unsigned int planeIndex,
unsigned int& rowLength,
unsigned int& byteAlignment);
332 GLuint primaryTextureId_ = 0u;
335 GLuint secondaryTextureId_ = 0u;
338 std::string textureName_ = std::string(
"primaryTexture,secondaryTexture");
This class implements Ocean's image class.
Definition Frame.h:1969
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition Frame.h:30
PixelFormat
Definition of all pixel formats available in the Ocean framework.
Definition Frame.h:183
This class is the base class for all dynamic scene graph objects.
Definition DynamicObject.h:40
ProgramType
Definition of different shader functionalities.
Definition GLESAttribute.h:43
This class implements a class factory for all GLESceneGraph objects.
Definition GLESFactory.h:30
This class implements a container for an OpenGL ES shader program.
Definition GLESShaderProgram.h:53
This class holds the texture properties of one pixel format.
Definition GLESTexture2D.h:60
TextureProperties(const GLESAttribute::ProgramType programType, const GLenum primaryFormat, const GLenum primaryType, const GLenum secondaryFormat, const GLenum secondaryType, const unsigned int secondaryWidthDivisor, const unsigned int secondaryHeightDivisor, const SecondaryLayout secondaryLayout)
Creates properties for a pixel format which needs a secondary texture as well.
bool secondaryTextureProperties(const FrameType &frameType, unsigned int &width, unsigned int &height, GLenum &format, GLenum &type) const
Determines the properties of the secondary texture for a given frame type.
void primaryTextureProperties(const FrameType &frameType, unsigned int &width, unsigned int &height, GLenum &format, GLenum &type) const
Determines the properties of the primary texture for a given frame type.
TextureProperties(const GLESAttribute::ProgramType programType, const GLenum primaryFormat, const GLenum primaryType)
Creates properties for a pixel format which needs one texture only.
SecondaryLayout secondaryLayout_
The layout of the secondary texture.
Definition GLESTexture2D.h:112
FrameType internalFrameType(const FrameType &frameType) const
Returns the frame type of the internal frame for which a GL texture format exists.
bool needsSecondaryTextureObjects() const
Returns whether a second texture is necessary.
Definition GLESTexture2D.h:344
This class wraps a GLESceneGraph texture object.
Definition GLESTexture2D.h:35
unsigned int bindTexture(GLESShaderProgram &shaderProgram, const unsigned int id) override
Binds this texture.
std::string textureName() const override
Returns the name of the texture e.g., in a shader.
GLESTexture2D()
Creates a new GLESceneGraph texture 2D object.
static bool determineAlignment(const Frame &frame, const unsigned int planeIndex, unsigned int &rowLength, unsigned int &byteAlignment)
Determines the unpack parameters for a plane of a frame.
void createMipmap() override
Updates the mipmap for this texture.
static void addConvertedTextureProperties(TexturePropertiesMap &map, const FrameType::PixelFormat pixelFormat, const FrameType::PixelFormat internalPixelFormat)
Adds the texture properties of one pixel format which needs to be converted before it can be uploaded...
bool defineSecondaryTextureObject(const TextureProperties &properties, const FrameType &frameType)
Creates a secondary GLESceneGraph texture object.
static TexturePropertiesMap createTexturePropertiesMap()
Creates the map mapping all supported pixel formats to their texture properties.
GLuint primaryTextureId_
The OpenGL ES primary texture id.
Definition GLESTexture2D.h:332
bool setWrapTypeT(const WrapType type) override
Sets the texture wrap type in t direction.
std::unordered_map< FrameType::PixelFormat, TextureProperties > TexturePropertiesMap
Definition of a map mapping pixel formats to texture properties.
Definition GLESTexture2D.h:156
static void addTextureProperties(TexturePropertiesMap &map, const FrameType::PixelFormat pixelFormat, const TextureProperties &properties)
Adds the texture properties of one pixel format to a map.
static bool primaryTextureName(const std::string &names, std::string &name)
Returns the name of the primary texture.
Frame conversionFrame_
Optional temp conversion frame.
Definition GLESTexture2D.h:341
bool setTextureName(const std::string &name) override
Sets the name of the texture e.g., in a shader.
WrapType wrapTypeS() const override
Returns the texture wrap type in s direction.
GLuint secondaryTextureId_
The OpenGL ES secondary texture id.
Definition GLESTexture2D.h:335
static const TextureProperties * textureProperties(const FrameType::PixelFormat pixelFormat)
Returns the texture properties of a given pixel format.
bool updateTexture(const Frame &frame)
Updates the texture based on a given frame.
WrapType wrapTypeT() const override
Returns the texture wrap type in t direction.
GLuint secondaryTextureId() const
Returns the texture id of the secondary texture.
Definition GLESTexture2D.h:354
bool setWrapTypeS(const WrapType type) override
Sets the texture wrap type in s direction.
SecondaryLayout
Definition of individual layouts of the secondary texture.
Definition GLESTexture2D.h:44
@ SL_NONE
The frame type does not need a secondary texture.
Definition GLESTexture2D.h:46
@ SL_PLANE_1_2
The second and the third plane of the frame are stacked into the secondary texture,...
Definition GLESTexture2D.h:50
@ SL_PLANE_1
The second plane of the frame is copied into the secondary texture.
Definition GLESTexture2D.h:48
GLuint primaryTextureId() const
Returns the texture id of the primary texture.
Definition GLESTexture2D.h:349
bool definePrimaryTextureObject(const TextureProperties &properties, const FrameType &frameType)
Creates a primary GLESceneGraph texture object.
~GLESTexture2D() override
Destructs a GLESceneGraph texture 2D object.
bool defineTextureObject(const TextureProperties &properties, const FrameType &frameType)
Creates a new GLESceneGraph texture object.
static bool secondaryTextureName(const std::string &names, std::string &name)
Returns the name of the secondary texture.
This class is the base class for all GLESceneGraph texture objects.
Definition GLESTexture.h:37
This class is the base class for all 2D textures.
Definition Texture2D.h:39
WrapType
Definition of different texture wrapping types.
Definition rendering/Texture.h:96
The namespace covering the entire Ocean framework.
Definition Accessor.h:15