[Tizen] Add API for setting resource destruction callback
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / native-image-source-devel.h
old mode 100755 (executable)
new mode 100644 (file)
index 0c470c8..3ddc317
 \r
 // EXTERNAL INCLUDES\r
 #include <dali/public-api/adaptor-framework/native-image-source.h>\r
+#include <dali/devel-api/adaptor-framework/event-thread-callback.h>\r
+\r
 \r
 namespace Dali\r
 {\r
-\r
 namespace DevelNativeImageSource\r
 {\r
+/**\r
+ * @brief Converts the current pixel contents to either a JPEG or PNG format\r
+ * and write that to the filesystem.\r
+ *\r
+ * @param[in] image The instance of NativeImageSource.\r
+ * @param[in] filename Identify the filesystem location at which to write the encoded image.\r
+ *                     The extension determines the encoding used.\r
+ *                     The two valid encoding are (".jpeg"|".jpg") and ".png".\r
+ * @param[in] quality The value to control image quality for jpeg file format in the range [1, 100]\r
+ * @return    @c true if the pixels were written, and @c false otherwise\r
+ */\r
+DALI_ADAPTOR_API bool EncodeToFile(NativeImageSource& image, const std::string& filename, const uint32_t quality);\r
 \r
 /**\r
  * @brief Acquire buffer and information of an internal native image.\r
@@ -37,7 +50,7 @@ namespace DevelNativeImageSource
  * @param[out] stride The stride of image\r
  * @return     The buffer of an internal native image\r
  */\r
-DALI_ADAPTOR_API uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride );\r
+DALI_ADAPTOR_API uint8_t* AcquireBuffer(NativeImageSource& image, uint16_t& width, uint16_t& height, uint16_t& stride);\r
 \r
 /**\r
  * @brief Release information of an internal native image.\r
@@ -47,7 +60,16 @@ DALI_ADAPTOR_API uint8_t* AcquireBuffer( NativeImageSource& image, uint16_t& wid
  * @param[in] image The instance of NativeImageSource.\r
  * @return     @c true If the buffer is released successfully, and @c false otherwise\r
  */\r
-DALI_ADAPTOR_API bool ReleaseBuffer( NativeImageSource& image );\r
+DALI_ADAPTOR_API bool ReleaseBuffer(NativeImageSource& image);\r
+\r
+/**\r
+ * @brief Set the Resource Destruction Callback object\r
+ *\r
+ * @param image The instance of NativeImageSource.\r
+ * @param callback The Resource Destruction callback\r
+ * @note Ownership of the callback is passed onto this class.\r
+ */\r
+DALI_ADAPTOR_API void SetResourceDestructionCallback(NativeImageSource& image, EventThreadCallback* callback);\r
 \r
 } // namespace DevelNativeImageSource\r
 \r