1 #ifndef DALI_BLENDING_OPTIONS_H
2 #define DALI_BLENDING_OPTIONS_H
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <dali/public-api/rendering/renderer.h>
23 #include <dali/public-api/math/vector4.h>
24 #include <dali/internal/common/owner-pointer.h>
32 // This is an optimization to avoid storing 6 separate blending values
33 struct BlendingOptions
36 * Create some default blending options.
41 * Non-virtual destructor.
46 * Set the blending options.
47 * @param[in] A bitmask of blending options.
49 void SetBitmask( unsigned int bitmask );
52 * Retrieve the blending options as a bitmask.
53 * @return A bitmask of blending options.
55 unsigned int GetBitmask() const;
58 * @copydoc Dali::RenderableActor::SetBlendFunc()
60 void SetBlendFunc( BlendFactor::Type srcFactorRgb, BlendFactor::Type destFactorRgb,
61 BlendFactor::Type srcFactorAlpha, BlendFactor::Type destFactorAlpha );
64 * @copydoc Dali::RenderableActor::GetBlendFunc()
66 BlendFactor::Type GetBlendSrcFactorRgb() const;
69 * @copydoc Dali::RenderableActor::GetBlendFunc()
71 BlendFactor::Type GetBlendDestFactorRgb() const;
74 * @copydoc Dali::RenderableActor::GetBlendFunc()
76 BlendFactor::Type GetBlendSrcFactorAlpha() const;
79 * @copydoc Dali::RenderableActor::GetBlendFunc()
81 BlendFactor::Type GetBlendDestFactorAlpha() const;
84 * @copydoc Dali::RenderableActor::SetBlendEquation()
86 void SetBlendEquation( BlendEquation::Type equationRgb, BlendEquation::Type equationAlpha );
89 * @copydoc Dali::RenderableActor::GetBlendEquation()
91 BlendEquation::Type GetBlendEquationRgb() const;
94 * @copydoc Dali::RenderableActor::GetBlendEquation()
96 BlendEquation::Type GetBlendEquationAlpha() const;
99 * Set the blend color.
100 * @param[in] color The blend color.
101 * @return True if the blend color changed, otherwise it was already the same color.
103 void SetBlendColor( const Vector4& color );
106 * Query the blend color.
107 * The blend color, or NULL if no blend color was set.
109 const Vector4* GetBlendColor() const;
113 // Undefined copy constructor.
114 BlendingOptions(const BlendingOptions& typePath);
116 // Undefined copy constructor.
117 BlendingOptions& operator=(const BlendingOptions& rhs);
121 unsigned int mBitmask; ///< A bitmask of blending options
123 OwnerPointer< Vector4> mBlendColor; ///< A heap-allocated color (owned)
127 } // namespace Internal
131 #endif // DALI_BLENDING_OPTIONS_H