Fix capture issue of to capture sub-scene.
[platform/core/uifw/dali-adaptor.git] / dali / public-api / capture / capture.h
index 5596994..5a6a049 100755 (executable)
@@ -2,7 +2,7 @@
 #define DALI_CAPTURE_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
@@ -23,7 +23,9 @@
 #include <dali/public-api/signals/dali-signal.h>
 #include <dali/public-api/actors/camera-actor.h>
 
-// INTERNAL HEADERS
+// INTERNAL INCLUDES
+#include <dali/public-api/dali-adaptor-common.h>
+#include <dali/public-api/adaptor-framework/native-image-source.h>
 
 namespace Dali
 {
@@ -44,7 +46,7 @@ class Capture;
 /**
  * @brief Capture snapshots the current scene and save as a file.
  *
- * @SINCE_1_3_4
+ * @SINCE_1_3.4
  *
  * Applications should follow the example below to create capture :
  *
@@ -74,7 +76,7 @@ class Capture;
  * }
  * @endcode
  */
-class DALI_IMPORT_API Capture : public BaseHandle
+class DALI_ADAPTOR_API Capture : public BaseHandle
 {
 
 public:
@@ -167,13 +169,65 @@ public:
   Capture& operator=( const Capture& rhs );
 
   /**
+   * @brief Move constructor.
+   *
+   * @SINCE_1_9.24
+   * @param[in] rhs A reference to the moved handle
+   */
+  Capture( Capture&& rhs );
+
+  /**
+   * @brief Move assignment operator.
+   *
+   * @SINCE_1_9.24
+   * @param[in] rhs A reference to the moved handle
+   * @return A reference to this handle
+   */
+  Capture& operator=( Capture&& rhs );
+
+  /**
+   * @brief Start capture and save the image as a file.
+   *
+   * @SINCE_1_9.27
+   * @param[in] source source actor to be used for capture.
+   *            This source must be added on the window in advance.
+   * @param[in] position top-left position of area to be captured
+   *            this position is defined in the window.
+   * @param[in] size captured size.
+   * @param[in] path image file path to be saved as a file.
+   *            If path is empty string, the captured result is not be saved as a file.
+   * @param[in] clearColor background color of captured scene
+   * @note suppose that we want to capture actor 'A'. And, the actor 'A' is overlapped by another actor 'B' that is not a child of 'A'.
+   *       in this case, if source is root of scene, the captured image includes a part of actor 'B' on the 'A'.
+   *       however, if source is just actor 'A', the result includes only 'A'.
+   */
+  void Start( Actor source, const Vector2& position, const Vector2& size, const std::string &path, const Vector4& clearColor );
+
+  /**
+   * @brief Start capture and save the image as a file.
+   *
+   * @SINCE_1_9.12
+   *
+   * @param[in] source source actor to be used for capture.
+   *            This source must be added on the window in advance.
+   * @param[in] size captured size.
+   * @param[in] path image file path to be saved as a file.
+   *            If path is empty string, the captured result is not be saved as a file.
+   * @param[in] clearColor background color of captured scene
+   * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
+   */
+  void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor, const uint32_t quality );
+
+  /**
    * @brief Start capture and save the image as a file.
    *
    * @SINCE_1_3_4
    *
    * @param[in] source source actor to be used for capture.
+   *            This source must be added on the window in advance.
    * @param[in] size captured size.
    * @param[in] path image file path to be saved as a file.
+   *            If path is empty string, the captured result is not be saved as a file.
    * @param[in] clearColor background color of captured scene
    */
   void Start( Actor source, const Vector2& size, const std::string &path, const Vector4& clearColor );
@@ -184,13 +238,31 @@ public:
    * @SINCE_1_3_4
    *
    * @param[in] source source actor to be used for capture.
+   *            This source must be added on the window in advance.
    * @param[in] size captured size.
    * @param[in] path image file path to be saved as a file.
+   *            If path is empty string, the captured result is not be saved as a file.
    * @note Clear color is transparent.
    */
   void Start( Actor source, const Vector2& size, const std::string &path );
 
   /**
+   * @brief Set result image quality in case of jpeg
+   *
+   * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]
+   */
+  void SetImageQuality( uint32_t quality );
+
+  /**
+   * @brief Get NativeImageSourcePtr that is saved captured image.
+   *
+   * @SINCE_1_9.10
+   *
+   * @return NativeImageSourcePtr Captured result that can be rendered with DALi
+   */
+  Dali::NativeImageSourcePtr GetNativeImageSource() const;
+
+  /**
    * @brief Get finished signal.
    *
    * @SINCE_1_3_4