1 #ifndef DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H
2 #define DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_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/actors/actor.h>
23 #include <dali/public-api/math/vector2.h>
24 #include <dali/public-api/object/property-map.h>
28 #include <dali-toolkit/public-api/dali-toolkit-common.h>
29 #include <dali-toolkit/public-api/visuals/visual-properties.h>
36 * @brief Set the dissolve central line.
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
47 DALI_TOOLKIT_API void DissolveEffectSetCentralLine(Actor& actor, const Vector2& position, const Vector2& displacement, float initialProgress);
50 * @brief Create a new Dissolve effect
52 * DissolveEffect is a custom shader effect to achieve Dissolve effects in image views.
54 * Animatable/Constrainable uniforms:
55 * "uPercentage" - This value is proportional to the distortion applied; a value of zero means no distortion.
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
61 DALI_TOOLKIT_API Property::Map CreateDissolveEffect(bool useHighPrecision = true);
63 } // namespace Toolkit
67 #endif // DALI_TOOLKIT_SHADER_EFFECT_DISSOLVE_H