#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.
#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
{
/**
* @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 :
*
* }
* @endcode
*/
-class DALI_IMPORT_API Capture : public BaseHandle
+class DALI_ADAPTOR_API Capture : public BaseHandle
{
public:
Capture();
/**
- * @PRIVLEVEL_PLATFORM
* @brief Create an initialized Capture.
*
* @SINCE_1_3_4
- * @PRIVILEGE_CAPTURE
*
* @return A handle to a newly allocated Dali resource.
* @note Projection mode of default cameraActor is Dali::Camera::PERSPECTIVE_PROJECTION
- * @note If permission denied by privilege occurs, a uninitialized handle is returned
*/
static Capture New();
/**
- * @PRIVLEVEL_PLATFORM
* @brief Create an initialized Capture.
*
* @SINCE_1_3_4
- * @PRIVILEGE_CAPTURE
*
* @param[in] cameraActor An initialized CameraActor.
* @return A handle to a newly allocated Dali resource.
- * @note If permission denied by privilege occurs, a uninitialized handle is returned
*/
static Capture New( Dali::CameraActor cameraActor );
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.12
+ *
+ * @param[in] source source actor to be used for capture.
+ * @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.
* @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 );
* @param[in] source source actor to be used for capture.
* @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 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
CaptureFinishedSignalType& FinishedSignal();
public: // Not intended for application developers
+ /// @cond internal
/**
* @brief This constructor is used by New() methods.
*
* @param[in] internal A pointer to a newly allocated Dali resource.
*/
explicit DALI_INTERNAL Capture( Internal::Adaptor::Capture* internal );
+ /// @endcond
};
/**