Ocean
Loading...
Searching...
No Matches
MediaTexture2D.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) Meta Platforms, Inc. and affiliates.
3
*
4
* This source code is licensed under the MIT license found in the
5
* LICENSE file in the root directory of this source tree.
6
*/
7
8
#ifndef META_OCEAN_RENDERING_MEDIA_TEXTURE_2D_H
9
#define META_OCEAN_RENDERING_MEDIA_TEXTURE_2D_H
10
11
#include "
ocean/rendering/Rendering.h
"
12
#include "
ocean/rendering/Texture2D.h
"
13
14
#include "
ocean/media/FrameMedium.h
"
15
16
namespace
Ocean
17
{
18
19
namespace
Rendering
20
{
21
22
// Forward declaration
23
class
MediaTexture2D;
24
25
/**
26
* Definition of a smart object reference holding a 2D texture.
27
* @see SmartObjectRef, Texture2D.
28
* @ingroup rendering
29
*/
30
using
MediaTexture2DRef
=
SmartObjectRef<MediaTexture2D>
;
31
32
/**
33
* This class is the base class for all 2D textures receiving their image content from Media objects.
34
* @see FrameTexture2D.
35
* @ingroup rendering
36
*/
37
class
OCEAN_RENDERING_EXPORT
MediaTexture2D
:
virtual
public
Texture2D
38
{
39
public
:
40
41
/**
42
* Returns the frame medium of this texture.
43
* @exception NotSupportedException Is thrown if this function is not supported
44
* @return Frame medium providing the image data
45
* @see setMedium(), Media::FrameMedium.
46
*/
47
virtual
Media::FrameMediumRef
medium
()
const
;
48
49
/**
50
* Sets the frame medium of this texture.
51
* @exception NotSupportedException Is thrown if this function is not supported
52
* @param medium Frame medium to set
53
* @see medium(), Media::FrameMedium.
54
*/
55
virtual
void
setMedium
(
const
Media::FrameMediumRef
& medium);
56
57
/**
58
* Returns the frame type of this texture.
59
* @return Texture frame type
60
*/
61
FrameType
frameType
()
const override
;
62
63
/**
64
* Returns whether this texture contains at least one transparent pixel.
65
* @return True, if so
66
*/
67
bool
hasTransparentPixel
()
const override
;
68
69
/**
70
* Returns the type of this object.
71
* @see Object::type().
72
*/
73
ObjectType
type
()
const override
;
74
75
protected
:
76
77
/**
78
* Creates a new 2D media texture object.
79
*/
80
MediaTexture2D
();
81
82
/**
83
* Destructs a 2D media texture object.
84
*/
85
~MediaTexture2D
()
override
;
86
87
protected
:
88
89
/// Frame medium providing the image data.
90
Media::FrameMediumRef
frameMedium_
;
91
};
92
93
}
94
95
}
96
97
#endif
// META_OCEAN_RENDERING_MEDIA_TEXTURE_2D_H
FrameMedium.h
Texture2D.h
Ocean::FrameType
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition
Frame.h:30
Ocean::Rendering::MediaTexture2D
This class is the base class for all 2D textures receiving their image content from Media objects.
Definition
MediaTexture2D.h:38
Ocean::Rendering::MediaTexture2D::hasTransparentPixel
bool hasTransparentPixel() const override
Returns whether this texture contains at least one transparent pixel.
Ocean::Rendering::MediaTexture2D::~MediaTexture2D
~MediaTexture2D() override
Destructs a 2D media texture object.
Ocean::Rendering::MediaTexture2D::frameType
FrameType frameType() const override
Returns the frame type of this texture.
Ocean::Rendering::MediaTexture2D::medium
virtual Media::FrameMediumRef medium() const
Returns the frame medium of this texture.
Ocean::Rendering::MediaTexture2D::type
ObjectType type() const override
Returns the type of this object.
Ocean::Rendering::MediaTexture2D::MediaTexture2D
MediaTexture2D()
Creates a new 2D media texture object.
Ocean::Rendering::MediaTexture2D::frameMedium_
Media::FrameMediumRef frameMedium_
Frame medium providing the image data.
Definition
MediaTexture2D.h:90
Ocean::Rendering::MediaTexture2D::setMedium
virtual void setMedium(const Media::FrameMediumRef &medium)
Sets the frame medium of this texture.
Ocean::Rendering::Object::ObjectType
ObjectType
Definition of different object type.
Definition
Object.h:63
Ocean::Rendering::SmartObjectRef< MediaTexture2D >
Ocean::Rendering::Texture2D
This class is the base class for all 2D textures.
Definition
Texture2D.h:39
Ocean::Media::FrameMediumRef
SmartMediumRef< FrameMedium > FrameMediumRef
Definition of a smart medium reference holding a frame medium object.
Definition
FrameMedium.h:39
Ocean
The namespace covering the entire Ocean framework.
Definition
Accessor.h:15
Rendering.h
impl
ocean
rendering
MediaTexture2D.h
Generated on Tue Nov 18 2025 06:53:25 for Ocean by
1.9.8