updated licenses info.
[platform/core/uifw/lottie-player.git] / inc / lottieanimation.h
index 3a9c1f2..1d3efce 100644 (file)
@@ -1,3 +1,21 @@
+/* 
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
+ * 
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ * 
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
 #ifndef _LOTTIE_ANIMATION_H_
 #define _LOTTIE_ANIMATION_H_
 
@@ -91,22 +109,22 @@ public:
      */
     Surface() = default;
 private:
-    uint32_t    *mBuffer;
-    size_t       mWidth;
-    size_t       mHeight;
-    size_t       mBytesPerLine;
+    uint32_t    *mBuffer{nullptr};
+    size_t       mWidth{0};
+    size_t       mHeight{0};
+    size_t       mBytesPerLine{0};
 };
 
 class LOT_EXPORT Animation {
 public:
 
     /**
-     *  @brief Constructs an animation object from filepath.
+     *  @brief Constructs an animation object from file path.
      *
      *  @param[in] path Lottie resource file path
      *
      *  @return Animation object that can render the contents of the
-     *          lottie resource represented by file path.
+     *          Lottie resource represented by file path.
      *
      *  @internal
      */
@@ -114,13 +132,13 @@ public:
     loadFromFile(const std::string &path);
 
     /**
-     *  @brief Constructs an animation object from json string data.
+     *  @brief Constructs an animation object from JSON string data.
      *
      *  @param[in] jsonData The JSON string data.
      *  @param[in] key the string that will be used to cache the JSON string data.
      *
      *  @return Animation object that can render the contents of the
-     *          lottie resource represented by JSON string data.
+     *          Lottie resource represented by JSON string data.
      *
      *  @internal
      */
@@ -128,9 +146,9 @@ public:
     loadFromData(std::string jsonData, const std::string &key);
 
     /**
-     *  @brief Returns default framerate of the lottie resource.
+     *  @brief Returns default framerate of the Lottie resource.
      *
-     *  @return framerate of the lottie resource
+     *  @return framerate of the Lottie resource
      *
      *  @internal
      *
@@ -138,9 +156,9 @@ public:
     double frameRate() const;
 
     /**
-     *  @brief Returns total number of frames present in the  lottie resource.
+     *  @brief Returns total number of frames present in the Lottie resource.
      *
-     *  @return frame count of the lottie resource.
+     *  @return frame count of the Lottie resource.
      *
      *  @note frame number starts with 0.
      *
@@ -149,7 +167,7 @@ public:
     size_t totalFrame() const;
 
     /**
-     *  @brief Returns default viewport size of the lottie resource.
+     *  @brief Returns default viewport size of the Lottie resource.
      *
      *  @param[out] width  default width of the viewport.
      *  @param[out] height default height of the viewport.
@@ -160,12 +178,12 @@ public:
     void   size(size_t &width, size_t &height) const;
 
     /**
-     *  @brief Returns total animation duration of lottie resource in second.
-     *         it uses totalFrame() and frameRate() to calcualte the duration.
+     *  @brief Returns total animation duration of Lottie resource in second.
+     *         it uses totalFrame() and frameRate() to calculate the duration.
      *         duration = totalFrame() / frameRate().
      *
      *  @return total animation duration in second.
-     *  @retval 0 if the lottie resource has no animation.
+     *  @retval 0 if the Lottie resource has no animation.
      *
      *  @see totalFrame()
      *  @see frameRate()
@@ -177,7 +195,7 @@ public:
     /**
      *  @brief Returns frame number for a given position.
      *         this function helps to map the position value retuned
-     *         by the animator to a frame number in side the lottie resource.
+     *         by the animator to a frame number in side the Lottie resource.
      *         frame_number = lerp(start_frame, endframe, pos);
      *
      *  @param[in] pos normalized position value [0 ... 1]
@@ -198,7 +216,7 @@ public:
      *         to draw into the screen.
      *
      *
-     *  @param[in] frameNo Content corresponds to the frameno needs to be drawn
+     *  @param[in] frameNo Content corresponds to the @p frameNo needs to be drawn
      *  @param[in] surface Surface in which content will be drawn
      *
      *  @return future that will hold the result when rendering finished.
@@ -212,9 +230,9 @@ public:
 
     /**
      *  @brief Renders the content to surface synchronously.
-     *         for performance use the asyn rendering @see render
+     *         for performance use the async rendering @see render
      *
-     *  @param[in] frameNo Content corresponds to the frameno needs to be drawn
+     *  @param[in] frameNo Content corresponds to the @p frameNo needs to be drawn
      *  @param[in] surface Surface in which content will be drawn
      *
      *  @internal
@@ -222,24 +240,10 @@ public:
     void              renderSync(size_t frameNo, Surface surface);
 
     /**
-     *  @brief Returns list of rendering nodes that that represents the
-     *         content of the lottie resource at frame number {frameNo}.
-     *
-     *  @param[in] frameNo Content corresponds to the frameno needs to be extracted.
-     *  @param[in] width   content viewbox width
-     *  @param[in] height  content viewbox height
-     *
-     *  @return render node list.
-     *
-     *  @internal
-     */
-    const std::vector<LOTNode *> &renderList(size_t frameNo, size_t width, size_t height) const;
-
-    /**
      *  @brief Returns root layer of the composition updated with
-     *         content of the lottie resource at frame number {frameNo}.
+     *         content of the Lottie resource at frame number @p frameNo.
      *
-     *  @param[in] frameNo Content corresponds to the frameno needs to be extracted.
+     *  @param[in] frameNo Content corresponds to the @p frameNo needs to be extracted.
      *  @param[in] width   content viewbox width
      *  @param[in] height  content viewbox height
      *