Add '@addtogroup' tag to generate doxygen page
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / public-api / image-loader / sync-image-loader.h
1 #ifndef DALI_TOOLKIT_SYNC_IMAGE_LOADER_H
2 #define DALI_TOOLKIT_SYNC_IMAGE_LOADER_H
3
4 /*
5  * Copyright (c) 2018 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 <string>
22 #include <dali/public-api/images/image-operations.h>
23 #include <dali/public-api/images/pixel-data.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/dali-toolkit-common.h>
27
28 namespace Dali
29 {
30
31 namespace Toolkit
32 {
33
34 /**
35  * @addtogroup dali_toolkit_image_loader
36  * @{
37  */
38
39 namespace SyncImageLoader
40 {
41
42 /**
43  * @brief The methods in the SyncImageLoader namespace are used to load pixel data from a URL synchronously.
44  *
45  * Example:
46  *
47  * @code
48  * PixelData pixelData = Toolkit::SyncImageLoader::Load( "image_url.jpg" );
49  *
50  * // Check the image was loaded without error.
51  * if( pixelData )
52  * {
53  *   // Do work...
54  * }
55  *
56  * @endcode
57  */
58
59 /**
60  * @brief Loads an image synchronously.
61  * Note: When using this method, the following defaults will be used:
62  * fittingMode = FittingMode::DEFAULT
63  * samplingMode = SamplingMode::BOX_THEN_LINEAR
64  * orientationCorrection = true
65  *
66  * @SINCE_1_2_14
67  * @REMARK_INTERNET
68  * @REMARK_STORAGE
69  * @param[in] url The URL of the image file to load
70  * @return A PixelData object containing the image, or an invalid object on failure
71  */
72 DALI_TOOLKIT_API PixelData Load( const std::string& url );
73
74 /**
75  * @brief Loads an image synchronously by specifying the target dimensions.
76  * Note: When using this method, the following defaults will be used:
77  * fittingMode = FittingMode::DEFAULT
78  * samplingMode = SamplingMode::BOX_THEN_LINEAR
79  * orientationCorrection = true
80  *
81  * @SINCE_1_2_14
82  * @REMARK_INTERNET
83  * @REMARK_STORAGE
84  * @param[in] url The URL of the image file to load
85  * @param[in] dimensions The width and height to fit the loaded image to
86  * @return A PixelData object containing the image, or an invalid object on failure
87  */
88 DALI_TOOLKIT_API PixelData Load( const std::string& url, ImageDimensions dimensions );
89
90 /**
91  * @brief Loads an image synchronously by specifying the target dimensions and options.
92  * @SINCE_1_2_14
93  * @REMARK_INTERNET
94  * @REMARK_STORAGE
95  * @param[in] url The URL of the image file to load
96  * @param[in] dimensions The width and height to fit the loaded image to
97  * @param[in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter
98  * @param[in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size
99  * @param[in] orientationCorrection Reorient the image to respect any orientation metadata in its header
100  * @return A PixelData object containing the image, or an invalid object on failure
101  */
102 DALI_TOOLKIT_API PixelData Load( const std::string& url,
103                 ImageDimensions dimensions,
104                 FittingMode::Type fittingMode,
105                 SamplingMode::Type samplingMode,
106                 bool orientationCorrection );
107
108 } // namespace SyncImageLoader
109
110 /**
111  * @}
112  */
113 } // namespace Toolkit
114
115 } // namespace Dali
116
117 #endif // DALI_TOOLKIT_SYNC_IMAGE_LOADER_H