Exposing Exif Image metadata
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / image-loaders / image-loader.h
index ea7b3a5..d619a30 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
  * limitations under the License.
  */
 
-#include <dali/integration-api/resource-cache.h>
+// EXTERNAL INCLUDES
+#include <dali/public-api/images/image-operations.h>
 #include <dali/integration-api/resource-types.h>
 #include <dali/integration-api/bitmap.h>
-#include "resource-loading-client.h"
+#include <dali/public-api/images/pixel-data.h>
+#include <adaptors/devel-api/adaptor-framework/pixel-buffer.h>
+#include <string>
 
 namespace Dali
 {
+namespace Integration
+{
+typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
+} // Integration
+
 namespace TizenPlatform
 {
 namespace ImageLoader
 {
 /**
  * Convert a file stream into a bitmap.
- * @param[in] resourceType The type of resource to convert.
+ * @param[in] resource The resource to convert.
  * @param[in] path The path to the resource.
  * @param[in] fp File Pointer. Closed on exit.
- * @param[in] client The component that is initiating the conversion.
  * @param[out] bitmap Pointer to write bitmap to
  * @return true on success, false on failure
  */
-bool ConvertStreamToBitmap( const Integration::ResourceType& resourceType, std::string path, FILE * const fp, const ResourceLoadingClient& client, Integration::BitmapPtr& ptr);
+bool ConvertStreamToBitmap( const Integration::BitmapResourceType& resource, std::string path, FILE * const fp, Dali::Devel::PixelBuffer& pixelBuffer );
 
 /**
  * Convert a bitmap and write to a file stream.
  * @param[in] path The path to the resource.
  * @param[in] fp File Pointer. Closed on exit.
- * @param[out] bitmap Pointer from which to read bitmap
+ * @param[out] pixelData Reference to PixelData object.
  * @return true on success, false on failure
  */
-bool ConvertBitmapToStream( std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
-
+bool ConvertBitmapToStream( std::string path, FILE * const fp, Dali::Devel::PixelBuffer& pixelBuffer );
 
-Integration::ResourcePointer LoadResourceSynchronously( const Integration::ResourceType& resourceType, const std::string& resourcePath );
+/**
+ * Loads an image synchronously
+ * @param resource details of the image
+ * @param path to the image
+ * @return bitmap
+ */
+Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resource, const std::string& path );
 
-void GetClosestImageSize( const std::string& filename,
-                          const ImageAttributes& attributes,
-                          Vector2 &closestSize );
+/**
+ * @returns the closest image size
+ */
+ImageDimensions  GetClosestImageSize( const std::string& filename,
+                          ImageDimensions size,
+                          FittingMode::Type fittingMode,
+                          SamplingMode::Type samplingMode,
+                          bool orientationCorrection );
 
-void GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
-                          const ImageAttributes& attributes,
-                          Vector2 &closestSize );
+/**
+ * @returns the closest image size
+ */
+ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
+                          ImageDimensions size,
+                          FittingMode::Type fittingMode,
+                          SamplingMode::Type samplingMode,
+                          bool orientationCorrection );
 
 } // ImageLoader
 } // TizenPlatform