1 #ifndef DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H
2 #define DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H
5 * Copyright (c) 2021 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/math/vector3.h>
23 #include <dali/public-api/object/property-map.h>
26 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
27 #include <dali-toolkit/public-api/visuals/visual-properties.h>
35 inline void SetColorAdjusterProperties(Actor& actor, const Vector3& hsvDelta, bool ignoreAlpha = false)
37 actor.RegisterProperty("uHSVDelta", hsvDelta);
38 actor.RegisterProperty("uIgnoreAlpha", ignoreAlpha ? 1.f : 0.f);
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.
48 inline Property::Map CreateColorAdjuster()
50 Property::Map customShader;
51 customShader[Toolkit::Visual::Shader::Property::FRAGMENT_SHADER] = SHADER_BUBBLE_EFFECT_COLOR_ADJUSTER_FRAG.data();
54 map[Toolkit::Visual::Property::SHADER] = customShader;
59 } // namespace Internal
61 } // namespace Toolkit
65 #endif // DALI_TOOLKIT_INTERNAL_COLOR_ADJUSTER_H