[4.0] Exposing Exif Image metadata
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / image-loaders / loader-png.h
index f1dedb3..0c9c493 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_LOADER_PNG_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.
  */
 
 #include <cstdio>
-#include <dali/public-api/common/vector-wrapper.h>
+#include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/images/pixel.h>
 #include "image-encoder.h"
+#include "image-loader-input.h"
 
 namespace Dali
 {
-
-namespace Integration
+namespace Devel
 {
-  class Bitmap;
+class PixelBuffer;
 }
-struct ImageAttributes;
 
 namespace TizenPlatform
 {
@@ -46,12 +45,11 @@ const unsigned char MAGIC_BYTE_2 = 0x50;
 /**
  * Loads the bitmap from an PNG file.  This function checks the header first
  * and if it is not a PNG file, then it returns straight away.
- * @param[in]  fp      Pointer to the Image file
- * @param[in]  bitmap  The bitmap class where the decoded image will be stored
- * @param[in]  attributes  Describes the dimensions, pixel format and other details for loading the image data
+ * @param[in]  input  Information about the input image (including file pointer)
+ * @param[out] bitmap The bitmap class where the decoded image will be stored
  * @return  true if file decoded successfully, false otherwise
  */
-bool LoadBitmapFromPng( FILE *fp, Integration::Bitmap& bitmap, ImageAttributes& attributes, const ResourceLoadingClient& client );
+bool LoadBitmapFromPng( const ImageLoader::Input& input, Dali::Devel::PixelBuffer& bitmap );
 
 /**
  * Loads the header of a PNG file and fills in the width and height appropriately.
@@ -61,12 +59,7 @@ bool LoadBitmapFromPng( FILE *fp, Integration::Bitmap& bitmap, ImageAttributes&
  * @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(FILE *fp, const ImageAttributes& attributes, unsigned int &width, unsigned int &height );
-
-/**
- * A bucket of bytes representing a PNG image.
- **/
-typedef std::vector<unsigned char> PngBuffer;
+bool LoadPngHeader( const ImageLoader::Input& input, unsigned int& width, unsigned int& height );
 
 /**
  * Encode raw pixel data to PNG format.
@@ -76,7 +69,7 @@ typedef std::vector<unsigned char> PngBuffer;
  * @param[in]  height         Image height
  * @param[in]  pixelFormat    Input pixel format (must be Pixel::RGB888)
  */
-bool EncodeToPng( const unsigned char* pixelBuffer, PngBuffer& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat );
+bool EncodeToPng( const unsigned char* pixelBuffer, Vector<unsigned char>& encodedPixels, std::size_t width, std::size_t height, Pixel::Format pixelFormat );
 
 } // namespace TizenPlatform