#define DALI_INTERNAL_CAPTURE_H
/*
- * Copyright (c) 2018 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.
class Capture : public BaseObject, public ConnectionTracker
{
public:
+
+ static constexpr uint32_t DEFAULT_QUALITY = 100;
+
/**
* @brief Constructor.
*/
/**
* @copydoc Dali::Capture::Start
*/
- void Start( Dali::Actor source, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor );
+ void Start( Dali::Actor source, const Dali::Vector2& position, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor, const uint32_t quality );
+
+ /**
+ * @copydoc Dali::Capture::Start
+ */
+ void Start( Dali::Actor source, const Dali::Vector2& position, const Dali::Vector2& size, const std::string &path, const Dali::Vector4& clearColor );
+
+ /**
+ * @copydoc Dali::Capture::SetImageQuality
+ */
+ void SetImageQuality( uint32_t quality );
+
+ /**
+ * @copydoc Dali::Capture::GetNativeImageSource
+ */
+ Dali::NativeImageSourcePtr GetNativeImageSource() const;
/**
* @copydoc Dali::Capture::FinishedSignal
/**
* @brief Setup render task.
*
- * @param[in] source is captured.
+ * @param[in] position top-left position of area to be captured
+ * this position is defined in the window.
+ * @param[in] size two dimensional size of area to be captured
+ * @param[in] source sub-scene tree to be captured.
* @param[in] clearColor background color
*/
- void SetupRenderTask( Dali::Actor source, const Dali::Vector4& clearColor );
+ void SetupRenderTask( const Dali::Vector2& position, const Dali::Vector2& size, Dali::Actor source, const Dali::Vector4& clearColor );
/**
* @brief Unset render task.
/**
* @brief Setup resources for capture.
*
- * @param[in] size is surface size.
- * @param[in] clearColor is clear color of surface.
- * @param[in] source is captured.
+ * @param[in] position top-left position of area to be captured
+ * this position is defined in the window.
+ * @param[in] size two dimensional size of area to be captured
+ * @param[in] clearColor color to clear background surface.
+ * @param[in] source sub-scene tree to be captured.
*/
- void SetupResources( const Dali::Vector2& size, const Dali::Vector4& clearColor, Dali::Actor source );
+ void SetupResources( const Dali::Vector2& position, const Dali::Vector2& size, const Dali::Vector4& clearColor, Dali::Actor source );
/**
* @brief Unset resources for capture.
*
* @return True is success to save, false is fail.
*/
- bool Save();
+ bool SaveFile();
private:
Capture& operator=( const Capture& rhs );
private:
+ uint32_t mQuality;
Dali::Texture mNativeTexture;
Dali::FrameBuffer mFrameBuffer;
Dali::RenderTask mRenderTask;
- Dali::Actor mParent;
Dali::Actor mSource;
Dali::CameraActor mCameraActor;
Dali::Timer mTimer; ///< For timeout.
Dali::Capture::CaptureFinishedSignalType mFinishedSignal;
std::string mPath;
Dali::NativeImageSourcePtr mNativeImageSourcePtr; ///< pointer to surface image
+ bool mFileSave;
};
} // End of namespace Adaptor