1 #ifndef DALI_KEY_FRAMES_DEVEL_H
2 #define DALI_KEY_FRAMES_DEVEL_H
5 * Copyright (c) 2024 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/animation/key-frames.h>
23 #include <dali/public-api/common/constants.h>
27 namespace DevelKeyFrames
29 using ValueConvertor = Property::Value (*)(const Property::Value& input);
32 * @brief Get the number of key frames.
33 * @param[in] keyFrames The KeyFrames object to perform this operation on
34 * @return Total number of key frames
36 DALI_CORE_API std::size_t GetKeyFrameCount(KeyFrames keyFrames);
40 * @param[in] keyFrames The KeyFrames object to perform this operation on
41 * @param[in] index The index of the key frame to fetch
42 * @param[out] time The progress of the given key frame
43 * @param[out] value The value of the given key frame
45 DALI_CORE_API void GetKeyFrame(KeyFrames keyFrames, std::size_t index, float& time, Property::Value& value);
49 * @param[in] keyFrames The KeyFrames object to perform this operation on
50 * @param[in] index The index of the key frame to set
51 * @param[in] value The value of the given key frame
53 DALI_CORE_API void SetKeyFrameValue(KeyFrames keyFrames, std::size_t index, const Property::Value& value);
56 * Optimize keyframes. Remove some frames what we can remove that might show same result.
57 * If two keyframe has same progress, we will remain only latest one.
58 * @warning It will be works well only if we use keyFrames animate as Dali::Animation::LINEAR interpolation
59 * @param[in] keyFrames The KeyFrames object to perform this operation on.
60 * @return True if keyframe optimized. False otherwise.
62 DALI_CORE_API bool OptimizeKeyFramesLinear(KeyFrames keyFrames);
64 } // namespace DevelKeyFrames
68 #endif // DALI_KEY_FRAMES_DEVEL_H