X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Fanimation%2Fkey-frames-impl.h;h=919fedf727240705aa02be2313d07e39841a9968;hb=73d3c11b85c8dbd1a05361cb86cec939997b2b98;hp=1f21625c9e57ed351b578bb97029afbd38b54b82;hpb=b192f4f14bad2da813b76387b6abc35411246be4;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/animation/key-frames-impl.h b/dali/internal/event/animation/key-frames-impl.h index 1f21625..919fedf 100644 --- a/dali/internal/event/animation/key-frames-impl.h +++ b/dali/internal/event/animation/key-frames-impl.h @@ -2,7 +2,7 @@ #define DALI_INTERNAL_KEY_FRAMES_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,11 +22,11 @@ #include // INTERNAL INCLUDES -#include +#include +#include #include +#include #include -#include -#include namespace Dali { @@ -45,7 +45,6 @@ public: static KeyFrames* New(); private: - /** * Create a specialization from the given type, and store it to the mSpec * member variable @@ -83,6 +82,16 @@ public: */ Dali::Property::Value GetLastKeyFrameValue() const; + /** + * @copydoc Dali::DevelKeyFrames::GetKeyFrameCount() + */ + std::size_t GetKeyFrameCount() const; + + /** + * @copydoc Dali::DevelKeyFrames::GetKeyFrame() + */ + void GetKeyFrame(std::size_t index, float& time, Property::Value& value) const; + private: Dali::Property::Type mType{Property::NONE}; // Type of the specialization std::unique_ptr mKeyFrames; // Pointer to the specialized key frame object @@ -102,9 +111,10 @@ public: /** * Get the key frame value as a Property::Value. * @param[in] index The index of the key frame to fetch + * @param[out] time The progress of the given key frame * @param[out] value The value of the given key frame */ - virtual void GetKeyFrameAsValue( std::size_t index, Property::Value& value ) = 0; + virtual void GetKeyFrameAsValue(std::size_t index, float& time, Property::Value& value) const = 0; }; /** @@ -154,9 +164,11 @@ public: /** * @copydoc KeyFrameSpec::GetKeyFrameAsValue() */ - void GetKeyFrameAsValue( std::size_t index, Property::Value& value ) override + void GetKeyFrameAsValue(std::size_t index, float& time, Property::Value& value) const override { - value = mChannel.mValues[index].mValue; + const auto& element = mChannel.mValues[index]; + time = element.mProgress; + value = element.mValue; } /** @@ -195,25 +207,23 @@ auto GetSpecialization(const Internal::KeyFrames& keyFrames) return static_cast(keyFrames.GetKeyFramesBase()); } -} // Internal - +} // namespace Internal // Get impl of handle inline Internal::KeyFrames& GetImplementation(Dali::KeyFrames& keyFrames) { - DALI_ASSERT_ALWAYS( keyFrames && "KeyFrames handle is empty" ); + DALI_ASSERT_ALWAYS(keyFrames && "KeyFrames handle is empty"); Dali::RefObject& object = keyFrames.GetBaseObject(); return static_cast(object); } inline const Internal::KeyFrames& GetImplementation(const Dali::KeyFrames& keyFrames) { - DALI_ASSERT_ALWAYS( keyFrames && "KeyFrames handle is empty" ); + DALI_ASSERT_ALWAYS(keyFrames && "KeyFrames handle is empty"); const Dali::RefObject& object = keyFrames.GetBaseObject(); return static_cast(object); } - -} // Dali +} // namespace Dali #endif // DALI_INTERNAL_KEY_FRAMES_H