Merge "Fix issue that LoadContents of WebView cound not be called with null arguments...
[platform/core/uifw/dali-extension.git] / dali-extension / image-loader / README
1 ## Implement
2
3 You can implement a new type of image loader plugin.
4 implement LoadBitmapFromImage and LoadImageHeader in the loader-dummy.cpp file.
5
6  bool LoadImageHeader( const Dali::ImageLoader::Input& input, unsigned int& width, unsigned int& height )
7  {
8   bool success = false;
9   /* Loads the header of a image file and fills in the width and height appropriately. */
10
11   return success;
12  }
13
14  bool LoadBitmapFromImage( const Dali::ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap )
15  {
16    bool success = false;
17    /* Loads the bitmap from an image file.  This function checks the header first */
18
19    return success;
20  }
21
22 And register your new image loader in tizen-image-loader.cpp
23  1) add type of new file formats
24    enum FileFormats
25   {
26     // Unknown file format
27     FORMAT_UNKNOWN = -1,
28
29     // formats that use magic bytes
30     FORMAT_DUMMY = 0,
31     FORMAT_TOTAL_COUNT
32   };
33
34  2) add function of new image loader
35   const Dali::ImageLoader::BitmapLoader BITMAP_LOADER_LOOKUP_TABLE[FORMAT_TOTAL_COUNT] =
36   {
37     { 0x0,                0x0,                LoadBitmapFromImage,  LoadImageHeader,  Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS },
38   };
39
40  3) add file extensions and formats
41    const FormatExtension FORMAT_EXTENSIONS[] =
42   {
43     { ".dummy",  FORMAT_DUMMY  }
44   };
45
46 ## Build
47 To use the new Image Loader plugin, You must change the use_image_loader value to 1.
48  packaging/dali-extension.spec
49  # Use Image Loader Plugin
50  %define use_image_loader 1
51
52  When you build the dali-extension, dali-extension-image-loader-plugin.armv7l.rpm file is created.
53