1 #ifndef __DALI_INTERNAL_FRAME_BUFFER_IMAGE_H__
2 #define __DALI_INTERNAL_FRAME_BUFFER_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.
22 #include <dali/internal/event/images/image-impl.h>
23 #include <dali/public-api/images/frame-buffer-image.h>
31 class FrameBufferImage;
32 typedef IntrusivePtr<FrameBufferImage> FrameBufferImagePtr;
35 * @copydoc Dali::FrameBufferImage
37 class FrameBufferImage : public Image
42 * @copydoc Dali::FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format)
44 static FrameBufferImagePtr New( unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferformat );
47 * @copydoc Dali::FrameBufferImage::New(NativeImageInterface&)
49 static FrameBufferImagePtr New( NativeImageInterface& nativeImage );
52 * @copydoc Dali::FrameBufferImage::FrameBufferImage
54 FrameBufferImage( unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferformat );
57 * @copydoc Dali::FrameBufferImage::FrameBufferImage
59 FrameBufferImage( NativeImageInterface& image );
62 * @return true if this FBO is targeting a NativeImageInterface
64 bool IsNativeFbo() const;
68 * @copydoc Dali::Internal::Image::Connect()
70 virtual void Connect();
73 * @copydoc Dali::Internal::Image::Disconnect()
75 virtual void Disconnect();
79 * A reference counted object may only be deleted by calling Unreference()
81 virtual ~FrameBufferImage();
84 // cached values for the size / pixel format we were created with. Needed to recreate us when we Connect() to stage and mTicket was reset from a previous call to Disconnect().
85 NativeImageInterfacePtr mNativeImage;
86 Pixel::Format mPixelFormat;
87 RenderBuffer::Format mBufferFormat;
89 }; // class FrameBufferImage
91 } // namespace Internal
94 * Helper methods for public API.
96 inline Internal::FrameBufferImage& GetImplementation(Dali::FrameBufferImage& image)
98 DALI_ASSERT_ALWAYS( image && "FrameBufferImage handle is empty" );
100 BaseObject& handle = image.GetBaseObject();
102 return static_cast<Internal::FrameBufferImage&>(handle);
105 inline const Internal::FrameBufferImage& GetImplementation(const Dali::FrameBufferImage& image)
107 DALI_ASSERT_ALWAYS( image && "FrameBufferImage handle is empty" );
109 const BaseObject& handle = image.GetBaseObject();
111 return static_cast<const Internal::FrameBufferImage&>(handle);
116 #endif // __DALI_INTERNAL_FRAME_BUFFER_IMAGE_H__