Ocean
BlendAttribute.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_BLEND_ATTRIBUTE_H
9 #define META_OCEAN_RENDERING_BLEND_ATTRIBUTE_H
10 
13 
14 namespace Ocean
15 {
16 
17 namespace Rendering
18 {
19 
20 // Forward declaration
21 class BlendAttribute;
22 
23 /**
24  * Definition of a smart object reference holding a blend attribute.
25  * @see SmartObjectRef, BlendAttribute.
26  * @ingroup rendering
27  */
29 
30 /**
31  * This class is the base class for all blend attributes.
32  * Use this attribute to enable framebuffer blending functionalities for the associated objects.<br>
33  * These attribute defines how an associated object is blended with already existing color values in the framebuffer.<br>
34  * @see Attribute
35  * @ingroup rendering
36  */
37 class OCEAN_RENDERING_EXPORT BlendAttribute : virtual public Attribute
38 {
39  public:
40 
41  /**
42  * Defines several blending functions.
43  */
45  {
57  FUNCTION_SOURCE_ALPHA_SATURATE
58  };
59 
60  public:
61 
62  /**
63  * Returns the blending function for the source object.
64  * @return Blending function
65  * @exception NotSupportedException Is thrown if this function is not supported
66  */
68 
69  /**
70  * Returns the blending function for the destination object.
71  * @return Blending function
72  * @exception NotSupportedException Is thrown if this function is not supported
73  */
75 
76  /**
77  * Sets the blending function for the source object.
78  * @param function Blending function to set
79  * @exception NotSupportedException Is thrown if this function is not supported
80  */
81  virtual void setSourceFunction(const BlendingFunction function);
82 
83  /**
84  * Sets the blending function for the destination object.
85  * @param function Blending function to set
86  * @exception NotSupportedException Is thrown if this function is not supported
87  */
88  virtual void setDestinationFunction(const BlendingFunction function);
89 
90  /**
91  * Returns the type of this object.
92  * @see Object::type().
93  */
94  ObjectType type() const override;
95 
96  protected:
97 
98  /**
99  * Creates a new blend attribute.
100  */
102 };
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_BLEND_ATTRIBUTE_H
This class is the base class for all rendering attribute objects.
Definition: Attribute.h:39
This class is the base class for all blend attributes.
Definition: BlendAttribute.h:38
virtual void setSourceFunction(const BlendingFunction function)
Sets the blending function for the source object.
virtual BlendingFunction destinationFunction() const
Returns the blending function for the destination object.
ObjectType type() const override
Returns the type of this object.
virtual void setDestinationFunction(const BlendingFunction function)
Sets the blending function for the destination object.
virtual BlendingFunction sourceFunction() const
Returns the blending function for the source object.
BlendAttribute()
Creates a new blend attribute.
BlendingFunction
Defines several blending functions.
Definition: BlendAttribute.h:45
@ FUNCTION_ONE_MINUS_DESTINATION_COLOR
Definition: BlendAttribute.h:51
@ FUNCTION_DESTINATION_COLOR
Definition: BlendAttribute.h:49
@ FUNCTION_ONE_MINUS_SOURCE_COLOR
Definition: BlendAttribute.h:52
@ FUNCTION_ONE_MINUS_DESTINATION_ALPHA
Definition: BlendAttribute.h:56
@ FUNCTION_DESTINATION_ALPHA
Definition: BlendAttribute.h:55
@ FUNCTION_ZERO
Definition: BlendAttribute.h:47
@ FUNCTION_ONE_MINUS_SOURCE_ALPHA
Definition: BlendAttribute.h:54
@ FUNCTION_SOURCE_ALPHA
Definition: BlendAttribute.h:53
@ FUNCTION_INVALID
Definition: BlendAttribute.h:46
@ FUNCTION_SOURCE_COLOR
Definition: BlendAttribute.h:50
@ FUNCTION_ONE
Definition: BlendAttribute.h:48
ObjectType
Definition of different object type.
Definition: Object.h:63
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
SmartObjectRef< BlendAttribute > BlendAttributeRef
Definition of a smart object reference holding a blend attribute.
Definition: BlendAttribute.h:21
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15