Seperate the API macros
[platform/core/uifw/dali-core.git] / dali / public-api / images / native-image.h
1 #ifndef __DALI_NATIVE_IMAGE_H__
2 #define __DALI_NATIVE_IMAGE_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
21 // INTERNAL INCLUDES
22 #include <dali/public-api/images/image.h>
23 #include <dali/public-api/images/native-image-interface.h>
24
25 namespace Dali
26 {
27 /**
28  * @addtogroup dali_core_images
29  * @{
30  */
31
32 namespace Internal DALI_INTERNAL
33 {
34 class NativeImage;
35 }
36
37 /**
38  * @DEPRECATED_1_2.41
39  *
40  * @brief NativeImage represents a platform specific image resource.
41  *
42  * Its data is provided by native resources, such as shared bitmap memory or pixmap.
43  * @SINCE_1_0.0
44  */
45 class DALI_CORE_API  NativeImage : public Image
46 {
47 public:
48
49   /**
50    * @DEPRECATED_1_2.41
51    *
52    * @brief Constructor with creates an uninitialized NativeImage object.
53    *
54    * Use NativeImage::New(...) to create an initialised object.
55    * @SINCE_1_0.0
56    */
57   NativeImage() DALI_DEPRECATED_API;
58
59   /**
60    * @DEPRECATED_1_2.41
61    *
62    * @brief Destructor.
63    *
64    * This is non-virtual since derived Handle types must not contain data or virtual methods.
65    * @SINCE_1_0.0
66    */
67    ~NativeImage() DALI_DEPRECATED_API;
68
69   /**
70    * @DEPRECATED_1_2.41
71    *
72    * @brief This copy constructor is required for (smart) pointer semantics.
73    *
74    * @SINCE_1_0.0
75    * @param[in] handle A reference to the copied handle
76    */
77   NativeImage( const NativeImage& handle ) DALI_DEPRECATED_API;
78
79   /**
80    * @DEPRECATED_1_2.41
81    *
82    * @brief This assignment operator is required for (smart) pointer semantics.
83    *
84    * @SINCE_1_0.0
85    * @param[in] rhs A reference to the copied handle
86    * @return A reference to this
87    */
88   NativeImage& operator=( const NativeImage& rhs ) DALI_DEPRECATED_API;
89
90   /**
91    * @DEPRECATED_1_2.41
92    *
93    * @brief Triggers asynchronous creation of backing GL texture immediately.
94    *
95    * The normal policy is for a GL texture to created lazily when needed.
96    * This function forces the allocation of a texture to happen at the earliest
97    * opportunity.
98    *
99    * @SINCE_1_0.0
100    * @note If the application loses its GL context, native images may lose their
101    * GL textures. This function can be called again after context regain to force
102    * the creation of the GL texture if still needed.
103    */
104   void CreateGlTexture() DALI_DEPRECATED_API;
105
106   /**
107    * @DEPRECATED_1_2.41
108    *
109    * @brief Creates a new NativeImage, which used native resources.
110    *
111    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE
112    * @SINCE_1_0.0
113    * @param[in] nativeImageInterface An reference to the object of the interface implementation
114    * @return A handle to a newly allocated object
115    */
116   static NativeImage New( NativeImageInterface& nativeImageInterface ) DALI_DEPRECATED_API;
117
118   /**
119    * @DEPRECATED_1_2.41
120    *
121    * @brief Downcasts a handle to NativeImage handle.
122    *
123    * If handle points to a NativeImage object, the downcast produces valid handle.
124    * If not, the returned handle is left uninitialized.
125    * @SINCE_1_0.0
126    * @param[in] handle Handle to an object
127    * @return handle to a NativeImage or an uninitialized handle
128    */
129   static NativeImage DownCast( BaseHandle handle ) DALI_DEPRECATED_API;
130
131   /**
132    * @DEPRECATED_1_2.41
133    *
134    * @brief Gets custom fragment prefix for rendering a native image.
135    *
136    * @return String for custom fragment prefix
137    */
138   const char* GetCustomFragmentPreFix() DALI_DEPRECATED_API;
139
140   /**
141    * @DEPRECATED_1_2.41
142    *
143    * @brief Gets custom sampler type name for rendering a native image.
144    *
145    * @return String for custom sampler type name
146    */
147   const char* GetCustomSamplerTypename() DALI_DEPRECATED_API;
148
149 public: // Not intended for application developers
150
151   explicit DALI_INTERNAL NativeImage( Internal::NativeImage* ) DALI_DEPRECATED_API;
152
153 };
154
155 /**
156  * @}
157  */
158 } // namespace Dali
159
160 #endif // __DALI_NATIVE_IMAGE_H__