Remove orientation from application class
[platform/core/uifw/dali-adaptor.git] / adaptors / public-api / adaptor-framework / bitmap-loader.h
1 #ifndef __DALI_BITMAP_LOADER_H__
2 #define __DALI_BITMAP_LOADER_H__
3
4 /*
5  * Copyright (c) 2014 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/pixel.h>
24 #include <dali/public-api/object/base-handle.h>
25
26 namespace Dali
27 {
28 namespace Internal
29 {
30 class BitmapLoader;
31 }
32
33 class DALI_IMPORT_API BitmapLoader : public BaseHandle
34 {
35 public:
36   /**
37    * @brief Create an initialized bitmap loader. This will automatically load the image.
38    *
39    * @param[in] filename  Filename of the bitmap image to load.
40    */
41   static BitmapLoader New(const std::string& filename);
42
43   /**
44    * @brief Create an empty handle.
45    *
46    * Use BitmapLoader::New() to create an initialized object.
47    */
48   BitmapLoader();
49
50   /**
51    * Destructor
52    */
53   ~BitmapLoader();
54
55   /**
56    * @brief This copy constructor is required for (smart) pointer semantics.
57    *
58    * @param [in] handle A reference to the copied handle
59    */
60   BitmapLoader(const BitmapLoader& handle);
61
62   /**
63    * @brief This assignment operator is required for (smart) pointer semantics.
64    *
65    * @param [in] rhs  A reference to the copied handle
66    * @return A reference to this
67    */
68   BitmapLoader& operator=(const BitmapLoader& rhs);
69
70 public:
71
72   /**
73    * Get the raw pixel data.
74    * @return The pixel data. Use the GetHeight(), GetWidth(), GetStride() and GetPixelFormat() methods
75    * to decode the data.
76    */
77   unsigned char* GetPixelData() const;
78
79   /**
80    * Get the buffer height in pixels
81    * @return the height of the buffer in pixels
82    */
83   unsigned int GetImageHeight() const;
84
85   /**
86    * Get the buffer width in pixels
87    * @return the width of the buffer in pixels
88    */
89   unsigned int GetImageWidth() const;
90
91   /**
92    * Get the number of bytes in each row of pixels
93    * @return The buffer stride in bytes.
94    */
95   unsigned int GetBufferStride() const;
96
97   /**
98    * Get the pixel format of the loaded bitmap.
99    */
100   Pixel::Format GetPixelFormat() const;
101
102 public: // Not intended for application developers
103
104   explicit DALI_INTERNAL BitmapLoader(Internal::BitmapLoader*);
105 };
106
107 } // Dali
108
109 #endif // __DALI_BITMAP_LOADER_H__