Purge underscored header file barriers
[platform/core/uifw/dali-core.git] / dali / internal / event / images / native-image-impl.h
1 #ifndef DALI_INTERNAL_NATIVE_IMAGE_H
2 #define DALI_INTERNAL_NATIVE_IMAGE_H
3
4 /*
5  * Copyright (c) 2019 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 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/images/native-image.h>
26 #include <dali/internal/event/images/image-impl.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 class NativeImage;
35 typedef IntrusivePtr<NativeImage> NativeImagePtr;
36
37 /**
38  * @copydoc Dali::NativeImage
39  */
40 class NativeImage : public Image
41 {
42 public:
43
44   /**
45    * Creates object by using native resources
46    * the maximum size of the image is limited by GL_MAX_TEXTURE_SIZE
47    * @param [in] nativeImageInterface An reference to the object of the interface implementation.
48    * @return a pointer to a newly created object.
49    */
50   static NativeImagePtr New( NativeImageInterface& nativeImageInterface );
51
52 protected:
53
54   /**
55    * Constructor
56    */
57   NativeImage( NativeImageInterface& nativeImageInterface );
58
59   /**
60    * A reference counted object may only be deleted by calling Unreference()
61    */
62   virtual ~NativeImage();
63
64 public:
65
66   /**
67    * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
68    */
69   const char* GetCustomFragmentPreFix();
70
71   /**
72    * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
73    */
74   const char* GetCustomSamplerTypename();
75
76 private:
77   std::string mCustomFragmentPreFix;
78   std::string mCustomSamplerTypename;
79 };
80
81 } // namespace Internal
82
83 /**
84  * Helper methods for public API.
85  */
86 inline Internal::NativeImage& GetImplementation(Dali::NativeImage& image)
87 {
88   DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
89
90   BaseObject& handle = image.GetBaseObject();
91
92   return static_cast<Internal::NativeImage&>(handle);
93 }
94
95 inline const Internal::NativeImage& GetImplementation(const Dali::NativeImage& image)
96 {
97   DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
98
99   const BaseObject& handle = image.GetBaseObject();
100
101   return static_cast<const Internal::NativeImage&>(handle);
102 }
103
104 } // namespace Dali
105 #endif // DALI_INTERNAL_NATIVE_IMAGE_H