8#ifndef META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
9#define META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
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);
271 static bool determineAlignment(
const Frame& frame,
const unsigned int planeIndex,
unsigned int& rowLength,
unsigned int& byteAlignment);
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
@ FORMAT_UNDEFINED
Undefined pixel format.
Definition Frame.h:187
DynamicObject()
Creates a new dynamic object.
ProgramType
Definition of different shader functionalities.
Definition GLESAttribute.h:43
@ PT_UNKNOWN
Not specified shader program.
Definition GLESAttribute.h:45
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.
GLenum primaryType_
The GL type of the primary texture.
Definition GLESTexture2D.h:97
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.
FrameType::PixelFormat internalPixelFormat_
The pixel format the frame needs to be converted to before it can be uploaded, FORMAT_UNDEFINED if th...
Definition GLESTexture2D.h:88
unsigned int secondaryWidthDivisor_
The divisor between the width of the frame and the width of the secondary texture,...
Definition GLESTexture2D.h:106
GLenum secondaryFormat_
The GL format of the secondary texture, 0 if the pixel format does not need a secondary texture.
Definition GLESTexture2D.h:100
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.
GLenum secondaryType_
The GL type of the secondary texture, 0 if the pixel format does not need a secondary texture.
Definition GLESTexture2D.h:103
GLenum primaryFormat_
The GL format of the primary texture.
Definition GLESTexture2D.h:94
bool needsSecondaryTextureObjects() const
Returns whether a second texture is necessary.
Definition GLESTexture2D.h:344
GLESAttribute::ProgramType programType_
The type of the shader program which can sample the pixel format, PT_UNKNOWN if no shader exists for ...
Definition GLESTexture2D.h:91
unsigned int secondaryHeightDivisor_
The divisor between the height of the frame and the height of the secondary texture,...
Definition GLESTexture2D.h:109
unsigned int bindTexture(GLESShaderProgram &shaderProgram, const unsigned int id) override
Binds this texture.
friend class GLESFactory
Definition GLESTexture2D.h:36
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
@ SL_PLANE_2_1
The second and the third plane of the frame are stacked into the secondary texture,...
Definition GLESTexture2D.h:52
GLuint primaryTextureId() const
Returns the texture id of the primary texture.
Definition GLESTexture2D.h:349
std::string textureName_
The name of the texture in the shader.
Definition GLESTexture2D.h:338
WrapType wrapTypeS_
The texture wrap s type.
Definition GLESTexture2D.h:326
bool definePrimaryTextureObject(const TextureProperties &properties, const FrameType &frameType)
Creates a primary GLESceneGraph texture object.
~GLESTexture2D() override
Destructs a GLESceneGraph texture 2D object.
WrapType wrapTypeT_
The texture wrap t type.
Definition GLESTexture2D.h:329
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.
GLESTexture()
Creates a new GLESceneGraph texture object.
std::string name() const
Returns the name of this object.
Definition Object.h:323
Texture2D()
Creates a new 2D texture object.
ObjectType type() const override
Returns the type of this object.
WrapType
Definition of different texture wrapping types.
Definition rendering/Texture.h:96
@ WRAP_CLAMP
The texture will be clamped at the border.
Definition rendering/Texture.h:100
Namespace of the Rendering GLESceneGraph library.
Definition rendering/glescenegraph/android/Android.h:20
Namespace of the Rendering library.
Definition AbsoluteTransform.h:18
The namespace covering the entire Ocean framework.
Definition Accessor.h:15