1 #ifndef __DALI_INTERNAL_BITMAP_EXTERNAL_H__
2 #define __DALI_INTERNAL_BITMAP_EXTERNAL_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
23 #include <dali/internal/event/images/bitmap-packed-pixel.h>
33 * A container for external image data
35 class BitmapExternal : public BitmapPackedPixel
43 * Creates new BitmapExternal instance with pixel buffer pointer and details.
44 * Application has ownership of the buffer, its contents can be modified.
45 * Bitmap stores given size information about the image.
46 * @pre bufferWidth, bufferHeight have to be power of two
47 * @param[in] pixBuf pointer to external pixel buffer
48 * @param[in] width Image width in pixels
49 * @param[in] height Image height in pixels
50 * @param[in] pixelformat pixel format
51 * @param[in] bufferWidth Buffer width in pixels
52 * @param[in] bufferHeight Buffer height in pixels
54 BitmapExternal(Dali::Integration::PixelBuffer* pixBuf,
57 Pixel::Format pixelformat,
58 unsigned int bufferWidth = 0,
59 unsigned int bufferHeight = 0);
62 * This does nothing, data is owned by external application.
64 virtual Dali::Integration::PixelBuffer* ReserveBuffer(Pixel::Format pixelFormat,
67 unsigned int bufferWidth = 0,
68 unsigned int bufferHeight = 0)
74 * Get the pixel buffer
75 * @return The buffer. You can modify its contents.
77 virtual Dali::Integration::PixelBuffer* GetBuffer()
84 * A reference counted object may only be deleted by calling Unreference()
86 virtual ~BitmapExternal();
90 Dali::Integration::PixelBuffer* mExternalData; ///< Externally owned pixel data
93 BitmapExternal(); ///< defined private to prevent use
94 BitmapExternal(const BitmapExternal& other); ///< defined private to prevent use
95 BitmapExternal& operator = (const BitmapExternal& other); ///< defined private to prevent use
97 // Changes scope, should be at end of class
98 DALI_LOG_OBJECT_STRING_DECLARATION;
101 } // namespace Internal
105 #endif // __DALI_INTERNAL_BITMAP_EXTERNAL_H__