Updated all header files to new format
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / bubble-effect / color-adjuster.h
1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/math/vector3.h>
23 #include <dali/public-api/object/property-map.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
27 #include <dali-toolkit/public-api/visuals/visual-properties.h>
28
29 namespace Dali
30 {
31 namespace Toolkit
32 {
33 namespace Internal
34 {
35 inline void SetColorAdjusterProperties(Actor& actor, const Vector3& hsvDelta, bool ignoreAlpha = false)
36 {
37   actor.RegisterProperty("uHSVDelta", hsvDelta);
38   actor.RegisterProperty("uIgnoreAlpha", ignoreAlpha ? 1.f : 0.f);
39 }
40
41 /**
42 * Creates a new ColorAdjuster effect.
43 * ColorAdjuster is a custom shader effect to adjust the image color in HSV space.
44 * @param[in] hsvDelta The color difference to apply to the HSV channel.
45 * @param[in] ignoreAlpha If true, the result color will be opaque even though source has alpha value
46 * @return A handle to a newly allocated Dali resource.
47 */
48 inline Property::Map CreateColorAdjuster()
49 {
50   Property::Map customShader;
51   customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = SHADER_BUBBLE_EFFECT_COLOR_ADJUSTER_FRAG.data();
52
53   Property::Map map;
54   map[Toolkit::Visual::Property::SHADER] = customShader;
55
56   return map;
57 }
58
59 } // namespace Internal
60
61 } // namespace Toolkit
62
63 } // namespace Dali
64
65 #endif // DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H