support image loader extension 29/187129/31
authorJoogab Yun <joogab.yun@samsung.com>
Mon, 13 Aug 2018 23:25:08 +0000 (08:25 +0900)
committerjoogab yun <joogab.yun@samsung.com>
Mon, 15 Oct 2018 05:20:17 +0000 (05:20 +0000)
Allows the image loader to obtain the plugin's bitmap loader.
we can add an image loader through the dali-extension plugin.

Change-Id: I1c9bd58ad6075bbe4049ed6753b2b833ae0b766e

27 files changed:
automated-tests/src/dali-adaptor-internal/image-loaders.cpp [changed mode: 0644->0755]
automated-tests/src/dali-adaptor-internal/image-loaders.h [changed mode: 0644->0755]
automated-tests/src/dali-adaptor-internal/utc-Dali-CompressedTextures.cpp [changed mode: 0644->0755]
dali/devel-api/adaptor-framework/image-loader-input.h [moved from dali/internal/imaging/common/image-loader-input.h with 65% similarity, mode: 0755]
dali/devel-api/adaptor-framework/image-loader-plugin.h [new file with mode: 0755]
dali/devel-api/file.list
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/imaging/common/image-loader-plugin-proxy.cpp [new file with mode: 0755]
dali/internal/imaging/common/image-loader-plugin-proxy.h [new file with mode: 0755]
dali/internal/imaging/common/image-loader.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-astc.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-astc.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-bmp.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-bmp.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-gif.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-gif.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-ico.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-ico.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-jpeg-turbo.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-jpeg.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-ktx.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-ktx.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-png.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-png.h [changed mode: 0644->0755]
dali/internal/imaging/common/loader-wbmp.cpp [changed mode: 0644->0755]
dali/internal/imaging/common/loader-wbmp.h [changed mode: 0644->0755]
dali/internal/imaging/file.list [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index faebbf3..3b8821c
@@ -98,7 +98,7 @@ void TestImageLoading( const ImageDetails& image, const LoadFunctions& functions
   // Check the header file.
 
   unsigned int width(0), height(0);
-  const Dali::TizenPlatform::ImageLoader::Input input( fp );
+  const Dali::ImageLoader::Input input( fp );
   DALI_TEST_CHECK( functions.header( input, width, height ) );
 
   DALI_TEST_EQUALS( width,  image.reportedWidth,  TEST_LOCATION );
@@ -136,7 +136,7 @@ void CompareLoadedImageData( const ImageDetails& image, const LoadFunctions& fun
 
   // Check the header file.
   unsigned int width = 0, height = 0;
-  const Dali::TizenPlatform::ImageLoader::Input input( filePointer );
+  const Dali::ImageLoader::Input input( filePointer );
   DALI_TEST_CHECK( functions.header( input, width, height ) );
 
   DALI_TEST_EQUALS( width,  image.reportedWidth,  TEST_LOCATION );
@@ -181,7 +181,7 @@ void DumpImageBufferToTempFile( std::string filename, std::string targetFilename
   AutoCloseFile autoClose( fp );
 
   Dali::Devel::PixelBuffer bitmap;
-  const Dali::TizenPlatform::ImageLoader::Input input( fp );
+  const Dali::ImageLoader::Input input( fp );
 
   DALI_TEST_CHECK( functions.loader( input, bitmap ) );
 
old mode 100644 (file)
new mode 100755 (executable)
index 824718f..088b1bd
@@ -21,7 +21,7 @@
 #include <dali/dali.h>
 #include <dali/integration-api/bitmap.h>
 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 // Simple structure to close the file when finished with it.
 struct AutoCloseFile
@@ -83,8 +83,8 @@ private:
  */
 struct LoadFunctions
 {
-  typedef bool (*LoadBitmapFunction)( const Dali::TizenPlatform::ImageLoader::Input& input, Dali::Devel::PixelBuffer& );
-  typedef bool (*LoadBitmapHeaderFunction)( const Dali::TizenPlatform::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+  typedef bool (*LoadBitmapFunction)( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& );
+  typedef bool (*LoadBitmapHeaderFunction)( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
   LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader );
   LoadBitmapHeaderFunction header;
old mode 100644 (file)
new mode 100755 (executable)
index f0e9bf6..1b1eb54
@@ -119,7 +119,7 @@ class KtxTestFixture
 
       // Check the header file.
       unsigned int width( 0 ), height( 0 );
-      const Dali::TizenPlatform::ImageLoader::Input input( fileDescriptor );
+      const Dali::ImageLoader::Input input( fileDescriptor );
 
       // Use the given loader to parse the image header.
       DALI_TEST_CHECK( testEntry.loadFunctions.header( input, width, height ) );
old mode 100644 (file)
new mode 100755 (executable)
similarity index 65%
rename from dali/internal/imaging/common/image-loader-input.h
rename to dali/devel-api/adaptor-framework/image-loader-input.h
index 7aecffe..a7df23a
 // EXTERNAL INCLUDES
 #include <cstdio>
 #include <dali/public-api/images/image-operations.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/bitmap.h>
 
 // INTERNAL INCLUDES
 
 namespace Dali
 {
-namespace TizenPlatform
-{
 namespace ImageLoader
 {
 
-
 /**
  * @brief A simple immutable struct to bundle together parameters for scaling an image.
- * @ToDo Move this to adaptor internal?
- * @ToDo Rename it after the move to ImageScalingParameters.
  */
 class ScalingParameters
 {
@@ -58,8 +55,24 @@ struct Input
   bool reorientationRequested;
 };
 
+
+using LoadBitmapFunction = bool( * )( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& pixelData );
+using LoadBitmapHeaderFunction = bool( * )( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+
+/**
+ * Stores the magic bytes, and the loader and header functions used for each image loader.
+ */
+struct BitmapLoader
+{
+  unsigned char magicByte1;        ///< The first byte in the file should be this
+  unsigned char magicByte2;        ///< The second byte in the file should be this
+  LoadBitmapFunction loader;       ///< The function which decodes the file
+  LoadBitmapHeaderFunction header; ///< The function which decodes the header of the file
+  Dali::Integration::Bitmap::Profile profile;         ///< The kind of bitmap to be created
+                                   ///  (addressable packed pixels or an opaque compressed blob).
+};
+
 } // ImageLoader
-} // TizenPlatform
 } // Dali
 
 #endif // __DALI_TIZEN_PLATFORM_IMAGE_LOADER_INPUT_H__
diff --git a/dali/devel-api/adaptor-framework/image-loader-plugin.h b/dali/devel-api/adaptor-framework/image-loader-plugin.h
new file mode 100755 (executable)
index 0000000..1a3c004
--- /dev/null
@@ -0,0 +1,66 @@
+#ifndef __DALI_IMAGE_LOADING_PLUGIN_H__
+#define __DALI_IMAGE_LOADING_PLUGIN_H__
+
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
+
+namespace Dali
+{
+
+/**
+ * @brief
+ */
+class ImageLoaderPlugin
+{
+public:
+
+  /**
+   * @brief Constructor.
+   */
+  ImageLoaderPlugin(){}
+
+  /**
+   * @brief Destructor.
+   */
+  virtual ~ImageLoaderPlugin(){}
+
+  /**
+   * @brief Get the image decorder
+   * @param[in] filename The path to the resource.
+   * @return BitmapLoader
+   */
+  virtual const ImageLoader::BitmapLoader* BitmapLoaderLookup( const std::string& filename ) const = 0;
+
+  /**
+   * @brief Function pointer called in adaptor to create a image loading plugin instance.
+   * @return Pointer to the newly created plugin object
+   */
+  typedef ImageLoaderPlugin* CreateImageLoaderPlugin( void );
+
+  /**
+   * @brief Function pointer called in adaptor to destory a image loading plugin instance.
+   */
+  typedef void DestroyImageLoaderPlugin( ImageLoaderPlugin* plugin );
+
+};
+
+} // namespace Dali;
+
+#endif
index ea89197..59a216f 100755 (executable)
@@ -50,6 +50,8 @@ devel_api_adaptor_framework_header_files = \
   $(adaptor_devel_api_dir)/adaptor-framework/feedback-plugin.h \
   $(adaptor_devel_api_dir)/adaptor-framework/feedback-player.h \
   $(adaptor_devel_api_dir)/adaptor-framework/file-loader.h \
+  $(adaptor_devel_api_dir)/adaptor-framework/image-loader-input.h \
+  $(adaptor_devel_api_dir)/adaptor-framework/image-loader-plugin.h \
   $(adaptor_devel_api_dir)/adaptor-framework/image-loading.h \
   $(adaptor_devel_api_dir)/adaptor-framework/gif-loading.h \
   $(adaptor_devel_api_dir)/adaptor-framework/input-method-context.h \
index 98c9128..272a019 100755 (executable)
@@ -59,6 +59,7 @@
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 
 #include <dali/internal/system/common/locale-utils.h>
+#include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
 
 using Dali::TextAbstraction::FontClient;
 
@@ -322,6 +323,9 @@ void Adaptor::Start()
 
   ProcessCoreEvents(); // Ensure any startup messages are processed.
 
+  // Initialize the image loader plugin
+  Internal::Adaptor::ImageLoaderPluginProxy::Initialize();
+
   for ( ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter )
   {
     (*iter)->OnStart();
@@ -404,6 +408,9 @@ void Adaptor::Stop()
       }
     }
 
+    // Destroy the image loader plugin
+    Internal::Adaptor::ImageLoaderPluginProxy::Destroy();
+
     delete mEventHandler;
     mEventHandler = NULL;
 
diff --git a/dali/internal/imaging/common/image-loader-plugin-proxy.cpp b/dali/internal/imaging/common/image-loader-plugin-proxy.cpp
new file mode 100755 (executable)
index 0000000..4e26864
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
+
+// EXTERNAL INCLUDES
+#include <dlfcn.h>
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace ImageLoaderPluginProxy
+{
+
+
+static const char * DEFAULT_OBJECT_NAME( "libdali-image-loader-plugin.so" );
+
+static bool mInitializeAttempted = false;
+static void* mLibHandle = NULL;
+static CreateImageLoaderPlugin* mCreatePluginFunctionPtr = NULL;
+static DestroyImageLoaderPlugin* mDestroyImageLoaderPluginPtr = NULL;
+static Dali::ImageLoaderPlugin* mImageLoaderPlugin = NULL;
+
+void Initialize()
+{
+  // Only attempt to load dll once
+  char* error = NULL;
+  if ( !mInitializeAttempted )
+  {
+    mInitializeAttempted = true;
+    mLibHandle = dlopen( DEFAULT_OBJECT_NAME, RTLD_LAZY );
+    error = dlerror();
+    if( !mLibHandle )
+    {
+      DALI_LOG_ERROR( "Cannot load dali image loading plugin library error: %s\n", error );
+      return;
+    }
+
+    // load plugin
+    mCreatePluginFunctionPtr = reinterpret_cast<CreateImageLoaderPlugin*>( dlsym( mLibHandle, "CreateImageLoaderPlugin" ) );
+    error = dlerror();
+    if( !mCreatePluginFunctionPtr )
+    {
+      DALI_LOG_ERROR("Cannot load symbol CreateImageLoaderPlugin(): %s\n", error );
+      return;
+    }
+
+    mDestroyImageLoaderPluginPtr = reinterpret_cast<DestroyImageLoaderPlugin*>( dlsym( mLibHandle, "DestroyImageLoaderPlugin" ) );
+    error = dlerror();
+    if( !mDestroyImageLoaderPluginPtr )
+    {
+      DALI_LOG_ERROR("Cannot load symbol DestroyImageLoaderPlugin(): %s\n", error );
+      return;
+    }
+
+
+    mImageLoaderPlugin = mCreatePluginFunctionPtr();
+    error = dlerror();
+    if( !mImageLoaderPlugin )
+    {
+      DALI_LOG_ERROR("Call to function CreateImageLoaderPlugin() failed : %s\n", error );
+      return;
+    }
+  }
+}
+
+void Destroy()
+{
+  if( mImageLoaderPlugin && mDestroyImageLoaderPluginPtr )
+  {
+    mDestroyImageLoaderPluginPtr( mImageLoaderPlugin );
+    mImageLoaderPlugin = NULL;
+  }
+}
+
+const ImageLoader::BitmapLoader* BitmapLoaderLookup( const std::string& filename )
+{
+  if( mImageLoaderPlugin )
+  {
+    const ImageLoader::BitmapLoader* data = mImageLoaderPlugin->BitmapLoaderLookup( filename );
+    return data;
+  }
+  return NULL;
+}
+
+} // namespace ImageLoaderPluginProxy
+
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
diff --git a/dali/internal/imaging/common/image-loader-plugin-proxy.h b/dali/internal/imaging/common/image-loader-plugin-proxy.h
new file mode 100755 (executable)
index 0000000..53d36d8
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef DALI_INTERNAL_IMAGE_LOADING_PLUGIN_PROXY_H
+#define DALI_INTERNAL_IMAGE_LOADING_PLUGIN_PROXY_H
+
+/*
+ * Copyright (c) 2018 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <string>
+
+// INTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/image-loader-plugin.h>
+
+namespace Dali
+{
+
+namespace Internal
+{
+
+namespace Adaptor
+{
+
+namespace ImageLoaderPluginProxy
+{
+
+ using CreateImageLoaderPlugin = Dali::ImageLoaderPlugin::CreateImageLoaderPlugin;
+ using DestroyImageLoaderPlugin = Dali::ImageLoaderPlugin::DestroyImageLoaderPlugin;
+
+
+ /**
+  * @brief Initialize
+  */
+ void Initialize();
+
+
+ /**
+  * @brief Destroy
+  */
+ void Destroy();
+
+ /**
+  * @brief BitmapLoaderLookup
+  */
+ const ImageLoader::BitmapLoader* BitmapLoaderLookup( const std::string& filename );
+
+
+} // namespace ImageLoaderPluginProxy
+
+} // namespace Adaptor
+
+} // namespace Internal
+
+} // namespace Dali
+
+#endif // DALI_INTERNAL_IMAGE_LOADING_PLUGIN_PROXY_H
old mode 100644 (file)
new mode 100755 (executable)
index 80824ac..09c1d00
@@ -28,7 +28,8 @@
 #include <dali/internal/imaging/common/loader-png.h>
 #include <dali/internal/imaging/common/loader-wbmp.h>
 #include <dali/internal/imaging/common/image-operations.h>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
+#include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
 #include <dali/internal/system/common/file-reader.h>
 
 using namespace Dali::Integration;
@@ -40,25 +41,10 @@ namespace TizenPlatform
 
 namespace
 {
-typedef bool (*LoadBitmapFunction)( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& pixelData );
-typedef bool (*LoadBitmapHeaderFunction)( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
-
 #if defined(DEBUG_ENABLED)
 Integration::Log::Filter* gLogFilter = Debug::Filter::New( Debug::Concise, false, "LOG_IMAGE_LOADING" );
 #endif
 
-/**
- * Stores the magic bytes, and the loader and header functions used for each image loader.
- */
-struct BitmapLoader
-{
-  unsigned char magicByte1;        ///< The first byte in the file should be this
-  unsigned char magicByte2;        ///< The second byte in the file should be this
-  LoadBitmapFunction loader;       ///< The function which decodes the file
-  LoadBitmapHeaderFunction header; ///< The function which decodes the header of the file
-  Bitmap::Profile profile;         ///< The kind of bitmap to be created
-                                   ///  (addressable packed pixels or an opaque compressed blob).
-};
 
 /**
  * Enum for file formats, has to be in sync with BITMAP_LOADER_LOOKUP_TABLE
@@ -87,7 +73,7 @@ enum FileFormats
  * A lookup table containing all the bitmap loaders with the appropriate information.
  * Has to be in sync with enum FileFormats
  */
-const BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] =
+const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] =
 {
   { Png::MAGIC_BYTE_1,  Png::MAGIC_BYTE_2,  LoadBitmapFromPng,  LoadPngHeader,  Bitmap::BITMAP_2D_PACKED_PIXELS },
   { Jpeg::MAGIC_BYTE_1, Jpeg::MAGIC_BYTE_2, LoadBitmapFromJpeg, LoadJpegHeader, Bitmap::BITMAP_2D_PACKED_PIXELS },
@@ -154,9 +140,10 @@ FileFormats GetFormatHint( const std::string& filename )
  */
 bool GetBitmapLoaderFunctions( FILE *fp,
                                FileFormats format,
-                               LoadBitmapFunction& loader,
-                               LoadBitmapHeaderFunction& header,
-                               Bitmap::Profile& profile )
+                               Dali::ImageLoader::LoadBitmapFunction& loader,
+                               Dali::ImageLoader::LoadBitmapHeaderFunction& header,
+                               Bitmap::Profile& profile,
+                               const std::string& filename )
 {
   unsigned char magic[MAGIC_LENGTH];
   size_t read = fread(magic, sizeof(unsigned char), MAGIC_LENGTH, fp);
@@ -173,11 +160,21 @@ bool GetBitmapLoaderFunctions( FILE *fp,
   }
 
   bool loaderFound = false;
-  const BitmapLoader *lookupPtr = BITMAP_LOADER_LOOKUP_TABLE;
-  ImageLoader::Input defaultInput( fp );
+  const Dali::ImageLoader::BitmapLoader *lookupPtr = BITMAP_LOADER_LOOKUP_TABLE;
+  Dali::ImageLoader::Input defaultInput( fp );
+
+  // try plugin image loader
+  const Dali::ImageLoader::BitmapLoader* data = Internal::Adaptor::ImageLoaderPluginProxy::BitmapLoaderLookup( filename );
+  if( data != NULL )
+  {
+    lookupPtr = data;
+    unsigned int width = 0;
+    unsigned int height = 0;
+    loaderFound = lookupPtr->header( fp, width, height );
+  }
 
-  // try hinted format first
-  if ( format != FORMAT_UNKNOWN )
+  // try hinted format
+  if ( false == loaderFound && format != FORMAT_UNKNOWN )
   {
     lookupPtr = BITMAP_LOADER_LOOKUP_TABLE + format;
     if ( format >= FORMAT_MAGIC_BYTE_COUNT ||
@@ -259,8 +256,8 @@ bool ConvertStreamToBitmap( const BitmapResourceType& resource, std::string path
 
   if (fp != NULL)
   {
-    LoadBitmapFunction function;
-    LoadBitmapHeaderFunction header;
+    Dali::ImageLoader::LoadBitmapFunction function;
+    Dali::ImageLoader::LoadBitmapHeaderFunction header;
 
     Bitmap::Profile profile;
 
@@ -268,10 +265,11 @@ bool ConvertStreamToBitmap( const BitmapResourceType& resource, std::string path
                                    GetFormatHint( path ),
                                    function,
                                    header,
-                                   profile ) )
+                                   profile,
+                                   path ) )
     {
-      const ScalingParameters scalingParameters( resource.size, resource.scalingMode, resource.samplingMode );
-      const ImageLoader::Input input( fp, scalingParameters, resource.orientationCorrection );
+      const Dali::ImageLoader::ScalingParameters scalingParameters( resource.size, resource.scalingMode, resource.samplingMode );
+      const Dali::ImageLoader::Input input( fp, scalingParameters, resource.orientationCorrection );
 
       // Run the image type decoder:
       result = function( input, pixelBuffer );
@@ -343,17 +341,18 @@ ImageDimensions  GetClosestImageSize( const std::string& filename,
   FILE *fp = fileReader.GetFile();
   if (fp != NULL)
   {
-    LoadBitmapFunction loaderFunction;
-    LoadBitmapHeaderFunction headerFunction;
+    Dali::ImageLoader::LoadBitmapFunction loaderFunction;
+    Dali::ImageLoader::LoadBitmapHeaderFunction headerFunction;
     Bitmap::Profile profile;
 
     if ( GetBitmapLoaderFunctions( fp,
                                    GetFormatHint(filename),
                                    loaderFunction,
                                    headerFunction,
-                                   profile ) )
+                                   profile,
+                                   filename ) )
     {
-      const ImageLoader::Input input( fp, ScalingParameters( size, fittingMode, samplingMode ), orientationCorrection );
+      const Dali::ImageLoader::Input input( fp, Dali::ImageLoader::ScalingParameters( size, fittingMode, samplingMode ), orientationCorrection );
 
       const bool read_res = headerFunction( input, width, height );
       if(!read_res)
@@ -391,17 +390,18 @@ ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer
       FILE *fp = fileReader.GetFile();
       if ( fp != NULL )
       {
-        LoadBitmapFunction loaderFunction;
-        LoadBitmapHeaderFunction headerFunction;
+        Dali::ImageLoader::LoadBitmapFunction loaderFunction;
+        Dali::ImageLoader::LoadBitmapHeaderFunction headerFunction;
         Bitmap::Profile profile;
 
         if ( GetBitmapLoaderFunctions( fp,
                                        FORMAT_UNKNOWN,
                                        loaderFunction,
                                        headerFunction,
-                                       profile ) )
+                                       profile,
+                                       "" ) )
         {
-          const ImageLoader::Input input( fp, ScalingParameters( size, fittingMode, samplingMode ), orientationCorrection );
+          const Dali::ImageLoader::Input input( fp, Dali::ImageLoader::ScalingParameters( size, fittingMode, samplingMode ), orientationCorrection );
           const bool read_res = headerFunction( input, width, height );
           if( !read_res )
           {
old mode 100644 (file)
new mode 100755 (executable)
index ed13b8e..4765bf9
@@ -161,14 +161,14 @@ bool LoadAstcHeader( FILE * const filePointer, unsigned int& width, unsigned int
 
 
 // File loading API entry-point:
-bool LoadAstcHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadAstcHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   AstcFileHeader fileHeader;
   return LoadAstcHeader( input.file, width, height, fileHeader );
 }
 
 // File loading API entry-point:
-bool LoadBitmapFromAstc( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromAstc( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   FILE* const filePointer = input.file;
   if( !filePointer )
old mode 100644 (file)
new mode 100755 (executable)
index f0ba78d..2ee94d1
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -49,7 +49,7 @@ const unsigned char MAGIC_BYTE_2 = 0xAB;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return True if file loaded successfully, false otherwise
  */
-bool LoadBitmapFromAstc( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromAstc( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a ASTC file and fills in the width and height appropriately.
@@ -58,7 +58,7 @@ bool LoadBitmapFromAstc( const ImageLoader::Input& input, Dali::Devel::PixelBuff
  * @param[out] height Is set with the height of the image
  * @return            True if the header was read successfully, false otherwise
  */
-bool LoadAstcHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadAstcHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 
 } // namespace TizenPlatform
old mode 100644 (file)
new mode 100755 (executable)
index 1e6bddf..65120f2
@@ -1043,7 +1043,7 @@ bool DecodeRLE8(FILE *fp,
 
 } // unnamed namespace
 
-bool LoadBmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadBmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   BmpFileHeader fileHeader;
   BmpInfoHeader infoHeader;
@@ -1053,7 +1053,7 @@ bool LoadBmpHeader( const ImageLoader::Input& input, unsigned int& width, unsign
   return ret;
 }
 
-bool LoadBitmapFromBmp( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromBmp( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   //DALI_ASSERT_DEBUG( bitmap.GetPackedPixelsProfile() != 0 && "Need a packed pixel bitmap to load into." );
   FILE* const fp = input.file;
old mode 100644 (file)
new mode 100755 (executable)
index 639e3fe..c77c09f
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -47,7 +47,7 @@ const unsigned char MAGIC_BYTE_2 = 0x4D;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromBmp( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromBmp( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a BMP file and fills in the width and height appropriately.
@@ -57,7 +57,7 @@ bool LoadBitmapFromBmp( const ImageLoader::Input& input, Dali::Devel::PixelBuffe
  * @param[out]  height  Is set with the height of the image
  * @return true if the file's header was read successully, false otherwise
  */
-bool LoadBmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadBmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 } // namespace TizenPlatform
 
old mode 100644 (file)
new mode 100755 (executable)
index a7b1bee..cf9b010
@@ -271,7 +271,7 @@ bool HandleExtensionRecordType( GifFileType* gifInfo )
 
 } // unnamed namespace
 
-bool LoadGifHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadGifHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   GifFileType* gifInfo = NULL;
   AutoCleanupGif autoCleanupGif(gifInfo);
@@ -280,7 +280,7 @@ bool LoadGifHeader( const ImageLoader::Input& input, unsigned int& width, unsign
   return LoadGifHeader(fp, width, height, &gifInfo);
 }
 
-bool LoadBitmapFromGif( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromGif( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   FILE* const fp = input.file;
   // Load the GIF Header file.
old mode 100644 (file)
new mode 100755 (executable)
index 981a885..28ed05c
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -48,7 +48,7 @@ const unsigned char MAGIC_BYTE_2 = 0x49;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromGif( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromGif( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a GIF file and fills in the width and height appropriately.
@@ -58,7 +58,7 @@ bool LoadBitmapFromGif( const ImageLoader::Input& input, Dali::Devel::PixelBuffe
  * @param[in/out]  height  Is set with the height of the image
  * @return true if the file's header was read successully, false otherwise
  */
-bool LoadGifHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadGifHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 } // namespace TizenPlatform
 
old mode 100644 (file)
new mode 100755 (executable)
index e8daa07..dc99750
@@ -337,7 +337,7 @@ bool LoadIcoHeaderHelper( FILE* fp,
 
 }//unnamed namespace
 
-bool LoadIcoHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadIcoHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   IcoData chosen;
   Dali::Vector<unsigned char> map;
@@ -355,7 +355,7 @@ bool LoadIcoHeader( const ImageLoader::Input& input, unsigned int& width, unsign
   return true;
 }
 
-bool LoadBitmapFromIco( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromIco( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   IcoData chosen;
   Dali::Vector<unsigned char> map;
old mode 100644 (file)
new mode 100755 (executable)
index 32df88c..a8f9e80
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -44,7 +44,7 @@ const unsigned char MAGIC_BYTE_2 = 0x00;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromIco( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromIco( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * @param[in]  input  Information about the input image (including file pointer)
@@ -52,7 +52,7 @@ bool LoadBitmapFromIco( const ImageLoader::Input& input, Dali::Devel::PixelBuffe
  * @param[out] height of image
  * @return  true if header loaded successfully, false otherwise
  */
-bool LoadIcoHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadIcoHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 7d78d71..1fab9a2
@@ -528,7 +528,7 @@ bool LoadJpegHeader( FILE *fp, unsigned int &width, unsigned int &height )
   return true;
 }
 
-bool LoadBitmapFromJpeg( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromJpeg( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   const int flags= 0;
   FILE* const fp = input.file;
@@ -1114,7 +1114,7 @@ ExifHandle LoadExifData( FILE* fp )
   return exifData;
 }
 
-bool LoadJpegHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadJpegHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   unsigned int requiredWidth  = input.scalingParameters.dimensions.GetWidth();
   unsigned int requiredHeight = input.scalingParameters.dimensions.GetHeight();
old mode 100644 (file)
new mode 100755 (executable)
index feb4f8f..987b338
@@ -22,7 +22,7 @@
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/pixel.h>
 #include <dali/internal/legacy/tizen/image-encoder.h>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -50,7 +50,7 @@ const unsigned char MAGIC_BYTE_2 = 0xD8;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromJpeg( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromJpeg( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a JPEG file and fills in the width and height appropriately.
@@ -63,7 +63,7 @@ bool LoadBitmapFromJpeg( const ImageLoader::Input& input, Dali::Devel::PixelBuff
  * @param[in/out]  height  Is set with the height of the image
  * @return true if the file's header was read successully, false otherwise
  */
-bool LoadJpegHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadJpegHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 /**
  * Encode raw pixel data to JPEG format.
old mode 100644 (file)
new mode 100755 (executable)
index abaad26..e431239
@@ -523,7 +523,7 @@ bool LoadKtxHeader( FILE * const fp, unsigned int& width, unsigned int& height,
 } // unnamed namespace
 
 // File loading API entry-point:
-bool LoadKtxHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadKtxHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   KtxFileHeader fileHeader;
   FILE* const fp = input.file;
@@ -533,7 +533,7 @@ bool LoadKtxHeader( const ImageLoader::Input& input, unsigned int& width, unsign
 }
 
 // File loading API entry-point:
-bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   DALI_COMPILE_TIME_ASSERT( sizeof(Byte) == 1);
   DALI_COMPILE_TIME_ASSERT( sizeof(uint32_t) == 4);
old mode 100644 (file)
new mode 100755 (executable)
index ee31cb1..966d14d
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -47,7 +47,7 @@ const unsigned char MAGIC_BYTE_2 = 0x4B;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file loaded successfully, false otherwise
  */
-bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromKtx( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a KTX file and fills in the width and height appropriately.
@@ -57,7 +57,7 @@ bool LoadBitmapFromKtx( const ImageLoader::Input& input, Dali::Devel::PixelBuffe
  * @param[out]  height  Is set with the height of the image
  * @return true if the file's header was read successully, false otherwise
  */
-bool LoadKtxHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadKtxHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 } // namespace TizenPlatform
 
old mode 100644 (file)
new mode 100755 (executable)
index 0cc7153..4b51af3
@@ -110,7 +110,7 @@ bool LoadPngHeader(FILE *fp, unsigned int &width, unsigned int &height, png_stru
 
 } // namespace - anonymous
 
-bool LoadPngHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadPngHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   png_structp png = NULL;
   png_infop info = NULL;
@@ -121,7 +121,7 @@ bool LoadPngHeader( const ImageLoader::Input& input, unsigned int& width, unsign
   return success;
 }
 
-bool LoadBitmapFromPng( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromPng( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   png_structp png = NULL;
   png_infop info = NULL;
old mode 100644 (file)
new mode 100755 (executable)
index eb9c780..49b8922
@@ -22,7 +22,7 @@
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/pixel.h>
 #include <dali/internal/legacy/tizen/image-encoder.h>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -49,7 +49,7 @@ const unsigned char MAGIC_BYTE_2 = 0x50;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromPng( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromPng( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a PNG file and fills in the width and height appropriately.
@@ -59,7 +59,7 @@ bool LoadBitmapFromPng( const ImageLoader::Input& input, Dali::Devel::PixelBuffe
  * @param[out]  height  Is set with the height of the image
  * @return true if the file's header was read successully, false otherwise
  */
-bool LoadPngHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadPngHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 /**
  * Encode raw pixel data to PNG format.
old mode 100644 (file)
new mode 100755 (executable)
index 58c3c34..6942442
@@ -90,7 +90,7 @@ int extractMultiByteInteger(unsigned int *data, void *map, size_t length, size_t
 
 }// end unnamed namespace
 
-bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
+bool LoadBitmapFromWbmp( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
 {
   FILE* const fp = input.file;
   if(fp == NULL)
@@ -211,7 +211,7 @@ bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Dali::Devel::PixelBuff
 }
 
 
-bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height )
+bool LoadWbmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
 {
   FILE* const fp = input.file;
   if(fp == NULL)
old mode 100644 (file)
new mode 100755 (executable)
index 2e2a1a1..6995b4c
@@ -19,7 +19,7 @@
  */
 
 #include <cstdio>
-#include <dali/internal/imaging/common/image-loader-input.h>
+#include <dali/devel-api/adaptor-framework/image-loader-input.h>
 
 namespace Dali
 {
@@ -39,7 +39,7 @@ class ResourceLoadingClient;
  * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
+bool LoadBitmapFromWbmp( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * @param[in]  input  Information about the input image (including file pointer)
@@ -47,7 +47,7 @@ bool LoadBitmapFromWbmp( const ImageLoader::Input& input, Dali::Devel::PixelBuff
  * @param[out] height of image
  * @return  true if header loaded successfully, false otherwise
  */
-bool LoadWbmpHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
+bool LoadWbmpHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 }
 
old mode 100644 (file)
new mode 100755 (executable)
index 88ad0cb..6aa7fb2
@@ -9,6 +9,7 @@ adaptor_imaging_common_src_files=\
     ${adaptor_imaging_dir}/common/gaussian-blur.cpp \
     ${adaptor_imaging_dir}/common/http-utils.cpp \
     ${adaptor_imaging_dir}/common/image-loader.cpp \
+    ${adaptor_imaging_dir}/common/image-loader-plugin-proxy.cpp \
     ${adaptor_imaging_dir}/common/image-operations.cpp \
     ${adaptor_imaging_dir}/common/loader-astc.cpp \
     ${adaptor_imaging_dir}/common/loader-bmp.cpp \