Convert shaders in devel-api header files to use shader compilation tool
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / shader-effects / dissolve-effect.h
1 #ifndef DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
2 #define DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_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 <string.h>
23 #include <dali/public-api/actors/actor.h>
24 #include <dali/public-api/math/vector2.h>
25 #include <dali/public-api/object/property-map.h>
26
27 // INTERNAL INCLUDES
28 #include <dali-toolkit/public-api/dali-toolkit-common.h>
29 #include <dali-toolkit/public-api/visuals/visual-properties.h>
30
31 namespace Dali
32 {
33 namespace Toolkit
34 {
35 /**
36  * @brief Set the dissolve central line.
37  *
38  * Use one point (position) and one direction ( displacement ) vector to define this line
39  * As we use the texture coordinate as pixel position to calculate random offset,
40  * the line should passing through rectangle {(0,0),(0,1),(1,0),(1,1)},
41  * so make the position parameter with two component values between 0.0 to 1.0
42  * @param[in] actor The actor that registers the uniform properties
43  * @param[in] position The point ( locates within rectangle {(0,0),(0,1),(1,0),(1,1)} ) passed through by the central line
44  * @param[in] displacement The direction of the central line
45  * @param[in] initialProgress The normalised initial progress of the shader
46  */
47 DALI_TOOLKIT_API void DissolveEffectSetCentralLine( Actor& actor, const Vector2& position, const Vector2& displacement, float initialProgress );
48
49 /**
50  * @brief Create a new Dissolve effect
51  *
52  *  DissolveEffect is a custom shader effect to achieve Dissolve effects in image views.
53  *
54  *  Animatable/Constrainable uniforms:
55  *    "uPercentage" - This value is proportional to the distortion applied; a value of zero means no distortion.
56  *
57  *  @param[in] useHighPrecision True if using high precision in fragment shader for fully random noise, false otherwise
58  *  @return The newly created Property::Map with the dissolve effect
59  */
60
61 DALI_TOOLKIT_API Property::Map CreateDissolveEffect( bool useHighPrecision = true);
62
63 } // namespace Toolkit
64
65 } // namespace Dali
66
67 #endif // DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H