Dali 3D User Interface Engine
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Dali::Internal::BitmapPackedPixel Class Reference

BitmapPackedPixel class. More...

#include <bitmap-packed-pixel.h>

Inheritance diagram for Dali::Internal::BitmapPackedPixel:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::BitmapPackedPixel:
Collaboration graph
[legend]

Public Member Functions

 BitmapPackedPixel (ResourcePolicy::Discardable discardable=ResourcePolicy::OWNED_RETAIN, Dali::Integration::PixelBuffer *pixBuf=0)
 Constructor. More...
 
virtual const
Bitmap::PackedPixelsProfile
GetPackedPixelsProfile () const
 Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile. More...
 
virtual
Bitmap::PackedPixelsProfile
GetPackedPixelsProfile ()
 Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile. More...
 
virtual
Dali::Integration::PixelBuffer
ReserveBuffer (Pixel::Format pixelFormat, unsigned int width, unsigned int height, unsigned int bufferWidth=0, unsigned int bufferHeight=0)
 (Re-)Allocate pixel buffer for the Bitmap. More...
 
virtual void AssignBuffer (Pixel::Format pixelFormat, Dali::Integration::PixelBuffer *buffer, std::size_t bufferSize, unsigned int width, unsigned int height, unsigned int bufferWidth=0, unsigned int bufferHeight=0)
 Assign a pixel buffer. More...
 
virtual unsigned GetBufferWidth () const
 Get the width of the buffer (stride) More...
 
virtual unsigned GetBufferHeight () const
 Get the height of the buffer. More...
 
virtual size_t GetBufferSize () const
 Get the pixel buffer size in bytes. More...
 
virtual unsigned int GetBufferStride () const
 Get the pixel buffer stride. More...
 
Pixel::Format GetPixelFormat () const
 Get the pixel format. More...
 
virtual void TestForTransparency ()
 Check the bitmap data and test whether it has any transparent pixels. More...
 
- Public Member Functions inherited from Dali::Integration::Bitmap
void DiscardBuffer ()
 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. More...
 
bool IsDiscardable () const
 Check if the pixel buffer can be discarded. More...
 
void DeletePixelBuffer ()
 Delete the pixel buffer data. More...
 
virtual ~Bitmap ()
 A reference counted object may only be deleted by calling Unreference() More...
 
unsigned int GetImageWidth () const
 Get the width of the image. More...
 
unsigned int GetImageHeight () const
 Get the height of the image. More...
 
Pixel::Format GetPixelFormat () const
 Get the pixel format. More...
 
virtual PixelBufferGetBuffer ()
 Get the pixel buffer if it's present. More...
 
PixelBufferGetBufferOwnership ()
 Get the pixel buffer if it's present and take over the ownership. More...
 
bool HasAlphaChannel () const
 Queries if the bitmap has an alpha channel. More...
 
bool IsFullyOpaque () const
 Queries if the bitmap has any transparent data. More...
 
virtual const CompressedProfileGetCompressedProfile () const
 
virtual CompressedProfileGetCompressedProfile ()
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 

Protected Member Functions

virtual ~BitmapPackedPixel ()
 A reference counted object may only be deleted by calling Unreference() More...
 
- Protected Member Functions inherited from Dali::Integration::Bitmap
 Bitmap (ResourcePolicy::Discardable discardable=ResourcePolicy::OWNED_RETAIN, Dali::Integration::PixelBuffer *pixBuf=0)
 Constructor Use the static function Bitmap::New() to create instances. More...
 
void Initialize (Pixel::Format pixelFormat, unsigned int width, unsigned int height)
 Initializes internal class members. More...
 
- Protected Member Functions inherited from Dali::RefObject
 RefObject ()
 Default constructor. More...
 
virtual ~RefObject ()
 RefObject is intended as a base class. More...
 
 RefObject (const RefObject &rhs)
 Copy constructor. More...
 
RefObjectoperator= (const RefObject &rhs)
 Assignment operator. More...
 

Protected Attributes

unsigned int mBufferWidth
 Buffer width (stride) in pixels. More...
 
unsigned int mBufferHeight
 Buffer height in pixels. More...
 
unsigned int mBytesPerPixel
 Bytes per pixel. More...
 
- Protected Attributes inherited from Dali::Integration::Bitmap
unsigned int mImageWidth
 Image width in pixels. More...
 
unsigned int mImageHeight
 Image height in pixels. More...
 
Pixel::Format mPixelFormat
 Pixel format. More...
 
bool mHasAlphaChannel
 Whether the image has an alpha channel. More...
 
bool mAlphaChannelUsed
 Whether the alpha channel is used in case the image owns one. More...
 
PixelBuffermData
 Raw pixel data. More...
 

Private Member Functions

void Initialize (Pixel::Format pixelFormat, unsigned int width, unsigned int height, unsigned int bufferWidth, unsigned int bufferHeight)
 Initializes internal class members. More...
 
 BitmapPackedPixel (const BitmapPackedPixel &other)
 defined private to prevent use More...
 
BitmapPackedPixeloperator= (const BitmapPackedPixel &other)
 defined private to prevent use More...
 

Private Attributes

 DALI_LOG_OBJECT_STRING_DECLARATION
 

Additional Inherited Members

- Public Types inherited from Dali::Integration::Bitmap
enum  Profile { BITMAP_2D_PACKED_PIXELS, BITMAP_COMPRESSED }
 Defines the characteristics of the Bitmap returned from the factory function. More...
 
- Static Public Member Functions inherited from Dali::Integration::Bitmap
static BitmapNew (Profile profile, ResourcePolicy::Discardable discardable)
 Create a new instance of a Bitmap with the required profile. More...
 

Detailed Description

BitmapPackedPixel class.

A container for image data that is packed into individual struct-like pixels in an addressable 2D array, with each pixel occupying a whole number of bytes. This is a vanilla Bitmap class, typically used to hold data decompressed from PNG and JPEG file formats for example.

Definition at line 42 of file bitmap-packed-pixel.h.

Constructor & Destructor Documentation

Dali::Internal::BitmapPackedPixel::BitmapPackedPixel ( ResourcePolicy::Discardable  discardable = ResourcePolicy::OWNED_RETAIN,
Dali::Integration::PixelBuffer pixBuf = 0 
)

Constructor.

Parameters
[in]discardableFlag to tell the bitmap if it can delete the buffer with the pixel data.

Definition at line 37 of file bitmap-packed-pixel.cpp.

Dali::Internal::BitmapPackedPixel::~BitmapPackedPixel ( )
protectedvirtual

A reference counted object may only be deleted by calling Unreference()

Definition at line 124 of file bitmap-packed-pixel.cpp.

References DALI_LOG_TRACE_METHOD.

Dali::Internal::BitmapPackedPixel::BitmapPackedPixel ( const BitmapPackedPixel other)
private

defined private to prevent use

Member Function Documentation

void Dali::Internal::BitmapPackedPixel::AssignBuffer ( Pixel::Format  pixelFormat,
Dali::Integration::PixelBuffer buffer,
std::size_t  bufferSize,
unsigned int  width,
unsigned int  height,
unsigned int  bufferWidth = 0,
unsigned int  bufferHeight = 0 
)
virtual

Assign a pixel buffer.

Any previously allocated pixel buffer is deleted. Dali has ownership of the buffer, but its contents can be modified. Bitmap stores given size information about the image.

Precondition
bufferWidth, bufferHeight have to be power of two
Parameters
[in]pixelFormatpixel format
[in]bufferthe pixel buffer
[in]bufferSizesize of the pixel buffer
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]bufferWidthBuffer width (stride) in pixels
[in]bufferHeightBuffer height in pixels

Implements Dali::Integration::Bitmap::PackedPixelsProfile.

Definition at line 65 of file bitmap-packed-pixel.cpp.

References DALI_ASSERT_DEBUG, Dali::Integration::Bitmap::DeletePixelBuffer(), Initialize(), mBufferHeight, mBufferWidth, mBytesPerPixel, and Dali::Integration::Bitmap::mData.

Here is the call graph for this function:

virtual unsigned Dali::Internal::BitmapPackedPixel::GetBufferHeight ( ) const
inlinevirtual

Get the height of the buffer.

Returns
The height of the buffer in pixels

Implements Dali::Integration::Bitmap::PackedPixelsProfile.

Definition at line 107 of file bitmap-packed-pixel.h.

References mBufferHeight.

virtual size_t Dali::Internal::BitmapPackedPixel::GetBufferSize ( ) const
inlinevirtual

Get the pixel buffer size in bytes.

Returns
The buffer size in bytes.

Implements Dali::Integration::Bitmap.

Definition at line 117 of file bitmap-packed-pixel.h.

References mBufferHeight, mBufferWidth, and mBytesPerPixel.

unsigned int Dali::Internal::BitmapPackedPixel::GetBufferStride ( ) const
virtual

Get the pixel buffer stride.

Returns
The buffer stride (in bytes).

Implements Dali::Integration::Bitmap::PackedPixelsProfile.

Definition at line 142 of file bitmap-packed-pixel.cpp.

References mBufferWidth, and mBytesPerPixel.

virtual unsigned Dali::Internal::BitmapPackedPixel::GetBufferWidth ( ) const
inlinevirtual

Get the width of the buffer (stride)

Returns
The width of the buffer in pixels

Implements Dali::Integration::Bitmap::PackedPixelsProfile.

Definition at line 98 of file bitmap-packed-pixel.h.

References mBufferWidth.

virtual const Bitmap::PackedPixelsProfile* Dali::Internal::BitmapPackedPixel::GetPackedPixelsProfile ( ) const
inlinevirtual

Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile.

Reimplemented from Dali::Integration::Bitmap.

Definition at line 52 of file bitmap-packed-pixel.h.

virtual Bitmap::PackedPixelsProfile* Dali::Internal::BitmapPackedPixel::GetPackedPixelsProfile ( )
inlinevirtual

Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile.

Reimplemented from Dali::Integration::Bitmap.

Definition at line 53 of file bitmap-packed-pixel.h.

Pixel::Format Dali::Internal::BitmapPackedPixel::GetPixelFormat ( ) const
inline

Get the pixel format.

Returns
The pixel format

Definition at line 135 of file bitmap-packed-pixel.h.

References Dali::Integration::Bitmap::mPixelFormat.

void Dali::Internal::BitmapPackedPixel::Initialize ( Pixel::Format  pixelFormat,
unsigned int  width,
unsigned int  height,
unsigned int  bufferWidth,
unsigned int  bufferHeight 
)
private

Initializes internal class members.

Parameters
[in]pixelFormatpixel format
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]bufferWidthBuffer width (stride) in pixels
[in]bufferHeightBuffer height in pixels

Definition at line 129 of file bitmap-packed-pixel.cpp.

References DALI_ASSERT_DEBUG, Dali::Pixel::GetBytesPerPixel(), Dali::Integration::Bitmap::Initialize(), mBufferHeight, mBufferWidth, mBytesPerPixel, Dali::Integration::Bitmap::mImageHeight, and Dali::Integration::Bitmap::mImageWidth.

Referenced by AssignBuffer(), and ReserveBuffer().

Here is the call graph for this function:

Here is the caller graph for this function:

BitmapPackedPixel& Dali::Internal::BitmapPackedPixel::operator= ( const BitmapPackedPixel other)
private

defined private to prevent use

Dali::Integration::PixelBuffer * Dali::Internal::BitmapPackedPixel::ReserveBuffer ( Pixel::Format  pixelFormat,
unsigned int  width,
unsigned int  height,
unsigned int  bufferWidth = 0,
unsigned int  bufferHeight = 0 
)
virtual

(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. Bitmap stores given size information about the image.

Precondition
bufferWidth, bufferHeight have to be power of two
Parameters
[in]pixelFormatpixel format
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]bufferWidthBuffer width (stride) in pixels
[in]bufferHeightBuffer height in pixels
Returns
pixel buffer pointer

Implements Dali::Integration::Bitmap::PackedPixelsProfile.

Definition at line 46 of file bitmap-packed-pixel.cpp.

References Dali::Integration::Bitmap::DeletePixelBuffer(), Initialize(), mBufferHeight, mBufferWidth, mBytesPerPixel, and Dali::Integration::Bitmap::mData.

Here is the call graph for this function:

void Dali::Internal::BitmapPackedPixel::TestForTransparency ( )
virtual

Member Data Documentation

Dali::Internal::BitmapPackedPixel::DALI_LOG_OBJECT_STRING_DECLARATION
private

Definition at line 180 of file bitmap-packed-pixel.h.

unsigned int Dali::Internal::BitmapPackedPixel::mBufferHeight
protected

Buffer height in pixels.

Definition at line 156 of file bitmap-packed-pixel.h.

Referenced by AssignBuffer(), GetBufferHeight(), GetBufferSize(), Initialize(), and ReserveBuffer().

unsigned int Dali::Internal::BitmapPackedPixel::mBufferWidth
protected

Buffer width (stride) in pixels.

Definition at line 155 of file bitmap-packed-pixel.h.

Referenced by AssignBuffer(), GetBufferSize(), GetBufferStride(), GetBufferWidth(), Initialize(), ReserveBuffer(), and TestForTransparency().

unsigned int Dali::Internal::BitmapPackedPixel::mBytesPerPixel
protected

The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali