Revert "[4.0] Exposing Exif Image metadata"
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / image-loaders / image-loader.h
1 #ifndef __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
2 #define __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__
3
4 /*
5  * Copyright (c) 2017 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  */
19
20 // EXTERNAL INCLUDES
21 #include <dali/public-api/images/image-operations.h>
22 #include <dali/integration-api/resource-types.h>
23 #include <dali/integration-api/bitmap.h>
24
25 namespace Dali
26 {
27 namespace Integration
28 {
29 typedef IntrusivePtr<Dali::RefObject> ResourcePointer;
30 } // Integration
31
32 namespace TizenPlatform
33 {
34 namespace ImageLoader
35 {
36 /**
37  * Convert a file stream into a bitmap.
38  * @param[in] resource The resource to convert.
39  * @param[in] path The path to the resource.
40  * @param[in] fp File Pointer. Closed on exit.
41  * @param[out] bitmap Pointer to write bitmap to
42  * @return true on success, false on failure
43  */
44 bool ConvertStreamToBitmap( const Integration::BitmapResourceType& resource, std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
45
46 /**
47  * Convert a bitmap and write to a file stream.
48  * @param[in] path The path to the resource.
49  * @param[in] fp File Pointer. Closed on exit.
50  * @param[out] bitmap Pointer from which to read bitmap
51  * @return true on success, false on failure
52  */
53 bool ConvertBitmapToStream( std::string path, FILE * const fp, Integration::BitmapPtr& ptr );
54
55 /**
56  * Loads an image synchronously
57  * @param resource details of the image
58  * @param path to the image
59  * @return bitmap
60  */
61 Integration::ResourcePointer LoadImageSynchronously( const Integration::BitmapResourceType& resource, const std::string& path );
62
63 /**
64  * @returns the closest image size
65  */
66 ImageDimensions  GetClosestImageSize( const std::string& filename,
67                           ImageDimensions size,
68                           FittingMode::Type fittingMode,
69                           SamplingMode::Type samplingMode,
70                           bool orientationCorrection );
71
72 /**
73  * @returns the closest image size
74  */
75 ImageDimensions GetClosestImageSize( Integration::ResourcePointer resourceBuffer,
76                           ImageDimensions size,
77                           FittingMode::Type fittingMode,
78                           SamplingMode::Type samplingMode,
79                           bool orientationCorrection );
80
81 } // ImageLoader
82 } // TizenPlatform
83 } // Dali
84
85 #endif // __DALI_TIZEN_PLATFORM_IMAGE_LOADER_H__