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
13
15
16namespace Ocean
17{
18
19namespace Rendering
20{
21
22// Forward declaration
23class MediaTexture2D;
24
25/**
26 * Definition of a smart object reference holding a 2D texture.
27 * @see SmartObjectRef, Texture2D.
28 * @ingroup rendering
29 */
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 */
37class 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 */
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 */
81
82 /**
83 * Destructs a 2D media texture object.
84 */
85 ~MediaTexture2D() override;
86
87 protected:
88
89 /// Frame medium providing the image data.
91};
92
93}
94
95}
96
97#endif // META_OCEAN_RENDERING_MEDIA_TEXTURE_2D_H
Definition of a frame type composed by the frame dimension, pixel format and pixel origin.
Definition Frame.h:30
This class is the base class for all 2D textures receiving their image content from Media objects.
Definition MediaTexture2D.h:38
bool hasTransparentPixel() const override
Returns whether this texture contains at least one transparent pixel.
~MediaTexture2D() override
Destructs a 2D media texture object.
FrameType frameType() const override
Returns the frame type of this texture.
virtual Media::FrameMediumRef medium() const
Returns the frame medium of this texture.
ObjectType type() const override
Returns the type of this object.
MediaTexture2D()
Creates a new 2D media texture object.
Media::FrameMediumRef frameMedium_
Frame medium providing the image data.
Definition MediaTexture2D.h:90
virtual void setMedium(const Media::FrameMediumRef &medium)
Sets the frame medium of this texture.
ObjectType
Definition of different object type.
Definition Object.h:63
This class is the base class for all 2D textures.
Definition Texture2D.h:39
SmartMediumRef< FrameMedium > FrameMediumRef
Definition of a smart medium reference holding a frame medium object.
Definition FrameMedium.h:39
The namespace covering the entire Ocean framework.
Definition Accessor.h:15