1 #ifndef DALI_INTERNAL_FRAME_BUFFER_IMAGE_H
2 #define DALI_INTERNAL_FRAME_BUFFER_IMAGE_H
5 * Copyright (c) 2019 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>
24 #include <dali/internal/event/rendering/frame-buffer-impl.h>
32 class FrameBufferImage;
33 typedef IntrusivePtr<FrameBufferImage> FrameBufferImagePtr;
36 * @copydoc Dali::FrameBufferImage
38 class FrameBufferImage : public Image
43 * @copydoc Dali::FrameBufferImage::New(unsigned int, unsigned int, Pixel::Format)
45 static FrameBufferImagePtr New( unsigned int width, unsigned int height, Pixel::Format pixelFormat, RenderBuffer::Format bufferformat );
48 * @copydoc Dali::FrameBufferImage::New(NativeImageInterface&)
50 static FrameBufferImagePtr New( NativeImageInterface& nativeImage );
53 * @copydoc Dali::FrameBufferImage::FrameBufferImage
55 FrameBufferImage( unsigned int width, unsigned int height );
58 * @copydoc Dali::FrameBufferImage::FrameBufferImage
60 FrameBufferImage( NativeImageInterface& image );
63 * @return true if this FBO is targeting a NativeImageInterface
65 bool IsNativeFbo() const;
68 * @return Internal FrameBuffer used by this FrameBufferImage
70 FrameBuffer* GetFrameBuffer() const
72 return mFrameBufferObject.Get();
77 * A reference counted object may only be deleted by calling Unreference()
79 virtual ~FrameBufferImage();
82 // 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().
83 FrameBufferPtr mFrameBufferObject;
84 NativeImageInterfacePtr mNativeImage;
86 }; // class FrameBufferImage
88 } // namespace Internal
91 * Helper methods for public API.
93 inline Internal::FrameBufferImage& GetImplementation(Dali::FrameBufferImage& image)
95 DALI_ASSERT_ALWAYS( image && "FrameBufferImage handle is empty" );
97 BaseObject& handle = image.GetBaseObject();
99 return static_cast<Internal::FrameBufferImage&>(handle);
102 inline const Internal::FrameBufferImage& GetImplementation(const Dali::FrameBufferImage& image)
104 DALI_ASSERT_ALWAYS( image && "FrameBufferImage handle is empty" );
106 const BaseObject& handle = image.GetBaseObject();
108 return static_cast<const Internal::FrameBufferImage&>(handle);
113 #endif // DALI_INTERNAL_FRAME_BUFFER_IMAGE_H