Revert "Revert "[4.0] Exposing Exif Image metadata""
[platform/core/uifw/dali-adaptor.git] / automated-tests / src / dali-adaptor-internal / image-loaders.h
index caa078e..4c1d34d 100644 (file)
@@ -1,24 +1,27 @@
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.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://floralicense.org/license/
-//
-// 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.
-//
+/*
+ * 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.
+ *
+ */
 
 #ifndef __DALI_ADAPTOR_TET_IMAGE_LOADERS_H_
 #define __DALI_ADAPTOR_TET_IMAGE_LOADERS_H_
 
 #include <dali/dali.h>
 #include <dali/integration-api/bitmap.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include "platform-abstractions/tizen/image-loaders/image-loader-input.h"
 
 // Simple structure to close the file when finished with it.
 struct AutoCloseFile
@@ -64,7 +67,7 @@ struct ImageDetails
   unsigned int reportedWidth;
   unsigned int reportedHeight;
   unsigned int refBufferSize;
-  Dali::PixelBuffer* const refBuffer;
+  Dali::PixelBuffer* refBuffer;
 
 private:
 
@@ -80,8 +83,8 @@ private:
  */
 struct LoadFunctions
 {
-  typedef bool (*LoadBitmapFunction)(FILE*, Dali::Integration::Bitmap&, Dali::ImageAttributes&);
-  typedef bool (*LoadBitmapHeaderFunction)(FILE*, const Dali::ImageAttributes& attrs, unsigned int& width, unsigned int& height );
+  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 );
 
   LoadFunctions( LoadBitmapHeaderFunction _header, LoadBitmapFunction _loader );
   LoadBitmapHeaderFunction header;
@@ -93,10 +96,20 @@ struct LoadFunctions
  * Use this method to test the header and and bitmap loading of each image.
  * The loaded bitmap is then checked with the reference bitmap in ImageDetails.
  *
- * @param[in]  image      The image details.
- * @param[in]  functions  The loader functions that need to be called.
+ * @param[in]  image         The image details.
+ * @param[in]  functions     The loader functions that need to be called.
+ * @param[in]  bitmapProfile Whether or not the bitmap is raw
+ */
+void TestImageLoading( const ImageDetails& image, const LoadFunctions& functions, Dali::Integration::Bitmap::Profile bitmapProfile = Dali::Integration::Bitmap::BITMAP_2D_PACKED_PIXELS );
+
+/**
+ * Helper method to compare the resultant loaded image data of the specified image with a golden master data.
+ *
+ * @param[in] image         The image to load
+ * @param[in] functions     The functions to use to load the image
+ * @param[in] master        Golden master data to compare the resultant loaded image with
  */
-void TestImageLoading( const ImageDetails& image, const LoadFunctions& functions );
+void CompareLoadedImageData( const ImageDetails& image, const LoadFunctions& functions, const uint32_t* master );
 
 /**
  * Helper function which should be used when first creating a reference buffer file.