Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-adaptor.git] / adaptors / devel-api / adaptor-framework / gif-loading.h
1 #ifndef __DALI_INTERNAL_GIF_LOADING_H__
2 #define __DALI_INTERNAL_GIF_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 <stdint.h>
22 #include <dali/public-api/common/dali-vector.h>
23 #include <dali/public-api/common/vector-wrapper.h>
24 #include <dali/public-api/math/uint-16-pair.h>
25
26 namespace Dali
27 {
28 class PixelData;
29 typedef Dali::Uint16Pair ImageDimensions;
30
31 /**
32  * @brief Load an animated gif file.
33  *
34  * @param[in] url The url of the gif to load.
35  * @param[out] pixelData The loaded pixel data for each frame.
36  * @param[out] frameDelays The loaded delay time for each frame.
37  *
38  * @return True if the loading succeeded, false otherwise.
39  */
40 DALI_IMPORT_API bool LoadAnimatedGifFromFile( const std::string& url, std::vector<Dali::PixelData>& pixelData, Dali::Vector<uint32_t>& frameDelays );
41
42 /**
43  * @brief Get the size of a gif image.
44  *
45  * This function will read the header info from file on disk.
46  *
47  * @param [in] url The URL of the gif file.
48  * @return The width and height in pixels of the gif image.
49  */
50 DALI_IMPORT_API ImageDimensions GetGifImageSize( const std::string& url );
51
52 } // namespace Dali
53
54 #endif // __DALI_INTERNAL_GIF_LOADING_H__