Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / image-loading.h
1 #ifndef DALI_IMAGE_LOADING_H
2 #define DALI_IMAGE_LOADING_H
3
4 /*
5  * Copyright (c) 2016 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/common/dali-common.h>
23 #include <dali/public-api/images/image-operations.h>
24 #include <dali/public-api/images/pixel-data.h>
25
26 namespace Dali
27 {
28
29 /**
30  * @brief Load an image synchronously from local file.
31  *
32  * @note This method is thread safe, i.e. can be called from any thread.
33  *
34  * @param [in] url The URL of the image file to load.
35  * @param [in] size The width and height to fit the loaded image to, 0.0 means whole image
36  * @param [in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter.
37  * @param [in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size.
38  * @param [in] orientationCorrection Reorient the image to respect any orientation metadata in its header.
39  * @return handle to the loaded PixelData object or an empty handle in case loading failed.
40  */
41 DALI_IMPORT_API PixelData LoadImageFromFile( const std::string& url,
42                                              ImageDimensions size = ImageDimensions( 0, 0 ),
43                                              FittingMode::Type fittingMode = FittingMode::DEFAULT,
44                                              SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR,
45                                              bool orientationCorrection = true );
46
47 } // Dali
48
49 #endif // DALI_IMAGE_LOADING_H