Merge remote-tracking branch 'origin/tizen' into new_text
[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) 2015 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 namespace Internal DALI_INTERNAL
29 {
30 class NativeImage;
31 }
32
33 /**
34  * @brief NativeImage represents an image resource that can be added to ImageActors.
35  * Its data is provided by native resources, such as shared bitmap memory or pixmap from X11 or ECORE-X11, etc.
36  */
37 class DALI_IMPORT_API  NativeImage : public Image
38 {
39 public:
40
41   /**
42    * @brief Constructor with creates an uninitialized NativeImage object.
43    *
44    * Use NativeImage::New(...) to create an initialised object.
45    */
46   NativeImage();
47
48   /**
49    * @brief Destructor.
50    *
51    * This is non-virtual since derived Handle types must not contain data or virtual methods.
52    */
53    ~NativeImage();
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    NativeImage( const NativeImage& 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   NativeImage& operator=( const NativeImage& rhs );
69
70   /**
71    * @brief Create a new NativeImage, which used native resources.
72    *
73    * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE
74    * @param [in] nativeImageInterface An reference to the object of the interface implementation.
75    * @return A handle to a newly allocated object.
76    */
77   static NativeImage New( NativeImageInterface& nativeImageInterface );
78
79   /**
80    * @brief Downcast an Object handle to NativeImage handle.
81    *
82    * If handle points to a NativeImage object, the downcast produces valid handle.
83    * If not, the returned handle is left unintialized.
84    * @param[in] handle Handle to an object.
85    * @return handle to a NativeImage or an uninitialized handle.
86    */
87   static NativeImage DownCast( BaseHandle handle );
88
89 public: // Not intended for application developers
90
91   explicit DALI_INTERNAL NativeImage( Internal::NativeImage* );
92
93 };
94
95 } // namespace Dali
96
97 #endif // __DALI_NATIVE_IMAGE_H__