1 #ifndef __DALI_INTERNAL_NATIVE_IMAGE_H__
2 #define __DALI_INTERNAL_NATIVE_IMAGE_H__
5 * Copyright (c) 2015 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.
25 #include <dali/public-api/images/native-image.h>
26 #include <dali/internal/event/images/image-impl.h>
35 typedef IntrusivePtr<NativeImage> NativeImagePtr;
38 * @copydoc Dali::NativeImage
40 class NativeImage : public Image
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.
50 static NativeImagePtr New( NativeImageInterface& nativeImageInterface );
57 NativeImage( NativeImageInterface& nativeImageInterface );
60 * A reference counted object may only be deleted by calling Unreference()
62 virtual ~NativeImage();
67 * @copydoc Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix()
69 const char* GetCustomFragmentPreFix();
72 * @copydoc Dali::NativeImageInterface::Extension::GetCustomSamplerTypename()
74 const char* GetCustomSamplerTypename();
77 std::string mCustomFragmentPreFix;
78 std::string mCustomSamplerTypename;
81 } // namespace Internal
84 * Helper methods for public API.
86 inline Internal::NativeImage& GetImplementation(Dali::NativeImage& image)
88 DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
90 BaseObject& handle = image.GetBaseObject();
92 return static_cast<Internal::NativeImage&>(handle);
95 inline const Internal::NativeImage& GetImplementation(const Dali::NativeImage& image)
97 DALI_ASSERT_ALWAYS( image && "Image handle is empty" );
99 const BaseObject& handle = image.GetBaseObject();
101 return static_cast<const Internal::NativeImage&>(handle);
105 #endif // __DALI_INTERNAL_NATIVE_IMAGE_H__