8 #ifndef META_OCEAN_RENDERING_FRAME_TEXTURE_2D_H
9 #define META_OCEAN_RENDERING_FRAME_TEXTURE_2D_H
92 inline const FrameType& internalFrameType()
const;
98 inline const Buffer& buffer()
const;
110 inline unsigned int mipmapLevels()
const;
121 inline bool isValid()
const;
135 unsigned int mipmapLevels_ = 0u;
174 internalFrameType_(internalFrameType),
175 buffer_(std::move(buffer)),
176 compressedFormat_(compressedFormat),
177 mipmapLevels_(mipmapLevels)
184 return internalFrameType_;
194 return compressedFormat_;
199 return mipmapLevels_;
212 return internalFrameType_.isValid() && !buffer_.empty() && compressedFormat_ !=
CF_INVALID && mipmapLevels_ >= 1u;
This class implements Ocean's image class.
Definition: Frame.h:1792
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition: Frame.h:30
This class implements a container for a compressed texture.
Definition: FrameTexture2D.h:71
const FrameType & internalFrameType() const
The texture's internal (uncompressed) frame type.
Definition: FrameTexture2D.h:182
void release()
Explicitly releases the data of this object.
Definition: FrameTexture2D.h:202
unsigned int mipmapLevels() const
Returns the number of mipmap levels the data of the compressed texture contains.
Definition: FrameTexture2D.h:197
CompressedFrame()=default
Default constructor creating an invalid object.
CompressedFormat compressedFormat() const
Returns the format of the compressed texture.
Definition: FrameTexture2D.h:192
bool isValid() const
Returns whether this object contains valid information for a compressed texture.
Definition: FrameTexture2D.h:210
const Buffer & buffer() const
Returns the memory containing the compressed texture.
Definition: FrameTexture2D.h:187
FrameType internalFrameType_
The texture's internal (uncompressed) frame type.
Definition: FrameTexture2D.h:126
Buffer buffer_
The memory containing the compressed texture.
Definition: FrameTexture2D.h:129
This class is the base class for all 2D textures receiving their image content from a frame or a buff...
Definition: FrameTexture2D.h:38
std::vector< uint8_t > Buffer
Definition of a vector holding bytes.
Definition: FrameTexture2D.h:65
~FrameTexture2D() override
Destructs a 2D frame texture object.
CompressedFormat
Definition of individual compressed texture formats.
Definition: FrameTexture2D.h:45
@ CF_RGBA_ASTC_6X6
Compressed texture with format RGBA ASTC 6x6.
Definition: FrameTexture2D.h:51
@ CF_SRGBA_ASTC_6X6
Compressed texture with format sRGBA ASTC 6x6.
Definition: FrameTexture2D.h:57
@ CF_RGBA_ASTC_4X4
Compressed texture with format RGBA ASTC 4x4.
Definition: FrameTexture2D.h:49
@ CF_SRGBA_ASTC_4X4
Compressed texture with format sRGBA ASTC 4x4.
Definition: FrameTexture2D.h:55
@ CF_RGBA_ASTC_8X8
Compressed texture with format RGBA ASTC 8x8.
Definition: FrameTexture2D.h:53
@ CF_INVALID
Invalid format.
Definition: FrameTexture2D.h:47
virtual bool setTexture(Frame &&frame)=0
Sets or updates the texture with a given frame.
FrameTexture2D()
Creates a new 2D frame texture object.
ObjectType type() const override
Returns the type of this object.
virtual bool setTexture(CompressedFrame &&compressedFrame)=0
Sets or updates the texture with a given compressed frame.
ObjectType
Definition of different object type.
Definition: Object.h:63
This class is the base class for all 2D textures.
Definition: Texture2D.h:38
SmartObjectRef< FrameTexture2D > FrameTexture2DRef
Definition of a smart object reference holding a 2D frame texture.
Definition: FrameTexture2D.h:23
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15