Ocean
GIMediaTexture2D.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_GI_MEDIA_TEXTURE_2D_H
9 #define META_OCEAN_RENDERING_GI_MEDIA_TEXTURE_2D_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GlobalIllumination
23 {
24 
25 /**
26  * This class wraps a Global Illumination media texture object.
27  * @ingroup renderinggi
28  */
29 class OCEAN_RENDERING_GI_EXPORT GIMediaTexture2D final :
30  virtual public GITexture2D,
31  virtual public MediaTexture2D
32 {
33  friend class GIFactory;
34 
35  public:
36 
37  /**
38  * Returns the frame of this texture.
39  * @return Texture frame
40  */
41  inline const Frame& frame() const;
42 
43  /**
44  * Returns the texture color for a given texture coordinate.
45  * @see GITexture2D::textureColor().
46  */
47  bool textureColor(const TextureCoordinate& textureCoordinate, RGBAColor& color) const override;
48 
49  /**
50  * Returns whether the texture internally holds valid data.
51  * @see Texture::isValid().
52  */
53  bool isValid() const override;
54 
55  protected:
56 
57  /**
58  * Creates a new Global Illumination texture 2D object.
59  */
61 
62  /**
63  * Destructs a Global Illumination texture 2D object.
64  */
65  ~GIMediaTexture2D() override;
66 
67  /**
68  * Update function called by the framebuffer.
69  * @see DynamicObject::onDynamicUpdate().
70  */
71  void onDynamicUpdate(const ViewRef& view, const Timestamp timestamp) override;
72 
73  protected:
74 
75  /// Texture frame.
77 };
78 
79 inline const Frame& GIMediaTexture2D::frame() const
80 {
81  return textureFrame_;
82 }
83 
84 }
85 
86 }
87 
88 }
89 
90 #endif // META_OCEAN_RENDERING_GI_MEDIA_TEXTURE_2D_H
This class implements Ocean's image class.
Definition: Frame.h:1792
This class implements a color defined by red, green, blue and alpha parameters.
Definition: RGBAColor.h:41
This class implements a class factory for all Global Illumination objects.
Definition: GIFactory.h:30
This class wraps a Global Illumination media texture object.
Definition: GIMediaTexture2D.h:32
~GIMediaTexture2D() override
Destructs a Global Illumination texture 2D object.
GIMediaTexture2D()
Creates a new Global Illumination texture 2D object.
Frame textureFrame_
Texture frame.
Definition: GIMediaTexture2D.h:76
bool isValid() const override
Returns whether the texture internally holds valid data.
const Frame & frame() const
Returns the frame of this texture.
Definition: GIMediaTexture2D.h:79
void onDynamicUpdate(const ViewRef &view, const Timestamp timestamp) override
Update function called by the framebuffer.
bool textureColor(const TextureCoordinate &textureCoordinate, RGBAColor &color) const override
Returns the texture color for a given texture coordinate.
This class wraps a Global Illumination texture object.
Definition: GITexture2D.h:34
This class is the base class for all 2D textures receiving their image content from Media objects.
Definition: MediaTexture2D.h:41
This class implements a timestamp.
Definition: Timestamp.h:36
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15