*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/public-api/images/pixel.h>
#include <dali/public-api/object/ref-object.h>
#include <dali/public-api/common/intrusive-ptr.h>
#include <dali/public-api/images/pixel.h>
#include <dali/public-api/object/ref-object.h>
/**
* Returns GL data type and internal format for specified pixel format
* @param[in] pixelformat pixel format (eg. Pixel::RGBA32)
/**
* Returns GL data type and internal format for specified pixel format
* @param[in] pixelformat pixel format (eg. Pixel::RGBA32)
/**
* Constructor
* Use the static function Bitmap::New() to create instances.
* @param[in] discardable Flag to tell the bitmap if it can delete the buffer with the pixel data.
* @param[in] pixBuf External buffer of pixel data or null.
*/
/**
* Constructor
* Use the static function Bitmap::New() to create instances.
* @param[in] discardable Flag to tell the bitmap if it can delete the buffer with the pixel data.
* @param[in] pixBuf External buffer of pixel data or null.
*/
* @param[in] height Image height in pixels
*/
void Initialize(Pixel::Format pixelFormat,
* @param[in] height Image height in pixels
*/
void Initialize(Pixel::Format pixelFormat,
- FREE, ///< Use free function to release the buffer
- DELETE_ARRAY, ///< Use delete[] operator to release the buffer
+ FREE, ///< Use free function to release the buffer
+ DELETE_ARRAY, ///< Use delete[] operator to release the buffer
* OWNED_RETAIN means that the data is owned and must be kept in CPU memory
* e.g. for an image that cannot be reloaded from disk.
*/
* OWNED_RETAIN means that the data is owned and must be kept in CPU memory
* e.g. for an image that cannot be reloaded from disk.
*/
/** \name PackedPixelsProfile
* Features that are active only if the Bitmap was created with a
* BITMAP_2D_PACKED_PIXELS profile. */
/** \name PackedPixelsProfile
* Features that are active only if the Bitmap was created with a
* BITMAP_2D_PACKED_PIXELS profile. */
/**
* (Re-)Allocate pixel buffer for the Bitmap. Any previously allocated pixel buffer is deleted.
* Dali has ownership of the buffer, but its contents can be modified.
/**
* (Re-)Allocate pixel buffer for the Bitmap. Any previously allocated pixel buffer is deleted.
* Dali has ownership of the buffer, but its contents can be modified.
* @return pixel buffer pointer
*/
virtual PixelBuffer* ReserveBuffer(Pixel::Format pixelFormat,
* @return pixel buffer pointer
*/
virtual PixelBuffer* ReserveBuffer(Pixel::Format pixelFormat,
- uint32_t width,
- uint32_t height,
- uint32_t bufferWidth = 0,
- uint32_t bufferHeight = 0) = 0;
+ uint32_t width,
+ uint32_t height,
+ uint32_t bufferWidth = 0,
+ uint32_t bufferHeight = 0) = 0;
* @param[in] bufferHeight Buffer height in pixels
*/
virtual void AssignBuffer(Pixel::Format pixelFormat,
* @param[in] bufferHeight Buffer height in pixels
*/
virtual void AssignBuffer(Pixel::Format pixelFormat,
- PixelBuffer* buffer,
- uint32_t bufferSize,
- uint32_t width,
- uint32_t height,
- uint32_t bufferWidth = 0,
- uint32_t bufferHeight = 0) = 0;
+ PixelBuffer* buffer,
+ uint32_t bufferSize,
+ uint32_t width,
+ uint32_t height,
+ uint32_t bufferWidth = 0,
+ uint32_t bufferHeight = 0) = 0;
};
/**
* Get interface to features that are active only if the Bitmap was created
* with a BITMAP_2D_PACKED_PIXELS profile. */
};
/**
* Get interface to features that are active only if the Bitmap was created
* with a BITMAP_2D_PACKED_PIXELS profile. */
/**
* Get interface to features that are active only if the Bitmap was created
* with a BITMAP_2D_PACKED_PIXELS profile. */
/**
* Get interface to features that are active only if the Bitmap was created
* with a BITMAP_2D_PACKED_PIXELS profile. */
- virtual PixelBuffer* ReserveBufferOfSize( Pixel::Format pixelFormat,
- const unsigned width,
- const unsigned height,
- const uint32_t numBytes ) = 0;
- protected:
+ virtual PixelBuffer* ReserveBufferOfSize(Pixel::Format pixelFormat,
+ const unsigned width,
+ const unsigned height,
+ const uint32_t numBytes) = 0;
- virtual const CompressedProfile* GetCompressedProfile() const { return nullptr; }
- virtual CompressedProfile* GetCompressedProfile() { return nullptr; }
+ virtual const CompressedProfile* GetCompressedProfile() const
+ {
+ return nullptr;
+ }
+ virtual CompressedProfile* GetCompressedProfile()
+ {
+ return nullptr;
+ }
/**
* Inform the bitmap that its pixel buffer is no longer required and can be
* deleted to free up memory if the bitmap owns the buffer.
/**
* Inform the bitmap that its pixel buffer is no longer required and can be
* deleted to free up memory if the bitmap owns the buffer.
-
- uint32_t mImageWidth; ///< Image width in pixels
- uint32_t mImageHeight; ///< Image height in pixels
- Pixel::Format mPixelFormat; ///< Pixel format
- bool mHasAlphaChannel; ///< Whether the image has an alpha channel
- bool mAlphaChannelUsed; ///< Whether the alpha channel is used in case the image owns one.
- PixelBuffer* mData; ///< Raw pixel data
+ uint32_t mImageWidth; ///< Image width in pixels
+ uint32_t mImageHeight; ///< Image height in pixels
+ Pixel::Format mPixelFormat; ///< Pixel format
+ bool mHasAlphaChannel; ///< Whether the image has an alpha channel
+ bool mAlphaChannelUsed; ///< Whether the alpha channel is used in case the image owns one.
+ PixelBuffer* mData; ///< Raw pixel data
- Bitmap(const Bitmap& other); ///< defined private to prevent use
- Bitmap& operator = (const Bitmap& other); ///< defined private to prevent use
+ Bitmap(const Bitmap& other); ///< defined private to prevent use
+ Bitmap& operator=(const Bitmap& other); ///< defined private to prevent use
// Changes scope, should be at end of class
DALI_LOG_OBJECT_STRING_DECLARATION;
// Changes scope, should be at end of class
DALI_LOG_OBJECT_STRING_DECLARATION;