1 #ifndef __DALI_NATIVE_IMAGE_H__
2 #define __DALI_NATIVE_IMAGE_H__
5 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/images/image.h>
23 #include <dali/public-api/images/native-image-interface.h>
28 * @addtogroup dali_core_images
32 namespace Internal DALI_INTERNAL
40 * @brief NativeImage represents a platform specific image resource.
42 * Its data is provided by native resources, such as shared bitmap memory or pixmap.
45 class DALI_IMPORT_API NativeImage : public Image
52 * @brief Constructor with creates an uninitialized NativeImage object.
54 * Use NativeImage::New(...) to create an initialised object.
57 NativeImage() DALI_DEPRECATED_API;
64 * This is non-virtual since derived Handle types must not contain data or virtual methods.
67 ~NativeImage() DALI_DEPRECATED_API;
72 * @brief This copy constructor is required for (smart) pointer semantics.
75 * @param[in] handle A reference to the copied handle
77 NativeImage( const NativeImage& handle ) DALI_DEPRECATED_API;
82 * @brief This assignment operator is required for (smart) pointer semantics.
85 * @param[in] rhs A reference to the copied handle
86 * @return A reference to this
88 NativeImage& operator=( const NativeImage& rhs ) DALI_DEPRECATED_API;
93 * @brief Triggers asynchronous creation of backing GL texture immediately.
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
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.
104 void CreateGlTexture() DALI_DEPRECATED_API;
109 * @brief Creates a new NativeImage, which used native resources.
111 * The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE
113 * @param[in] nativeImageInterface An reference to the object of the interface implementation
114 * @return A handle to a newly allocated object
116 static NativeImage New( NativeImageInterface& nativeImageInterface ) DALI_DEPRECATED_API;
121 * @brief Downcasts a handle to NativeImage handle.
123 * If handle points to a NativeImage object, the downcast produces valid handle.
124 * If not, the returned handle is left uninitialized.
126 * @param[in] handle Handle to an object
127 * @return handle to a NativeImage or an uninitialized handle
129 static NativeImage DownCast( BaseHandle handle ) DALI_DEPRECATED_API;
134 * @brief Gets custom fragment prefix for rendering a native image.
136 * @return String for custom fragment prefix
138 const char* GetCustomFragmentPreFix() DALI_DEPRECATED_API;
143 * @brief Gets custom sampler type name for rendering a native image.
145 * @return String for custom sampler type name
147 const char* GetCustomSamplerTypename() DALI_DEPRECATED_API;
149 public: // Not intended for application developers
151 explicit DALI_INTERNAL NativeImage( Internal::NativeImage* ) DALI_DEPRECATED_API;
160 #endif // __DALI_NATIVE_IMAGE_H__