Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Dali::PixelData Class Reference

Reference counted pixel data . More...

#include <pixel-data.h>

Inheritance diagram for Dali::PixelData:
Inheritance graph
[legend]
Collaboration diagram for Dali::PixelData:
Collaboration graph
[legend]

Public Types

enum  ReleaseFunction { FREE, DELETE_ARRAY }
 

Public Member Functions

unsigned int GetWidth () const
 Get the width of the buffer in pixels. More...
 
unsigned int GetHeight () const
 Get the height of the buffer in pixels. More...
 
Pixel::Format GetPixelFormat () const
 Get the pixel format. More...
 
unsigned char * GetBuffer () const
 Get the pixel buffer if it's present. More...
 
 PixelData (unsigned char *buffer, unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleaseFunction releaseFunction)
 Constructor. More...
 
 ~PixelData ()
 Destructor. More...
 
- 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...
 

Static Public Member Functions

static PixelDataPtr New (unsigned char *buffer, unsigned int width, unsigned int height, Pixel::Format pixelFormat, ReleaseFunction releaseFunction)
 Create a PixelData object. More...
 

Private Member Functions

 PixelData (const PixelData &other)
 
PixelDataoperator= (const PixelData &other)
 

Private Attributes

unsigned char * mBuffer
 The raw pixel data. More...
 
unsigned int mWidth
 Buffer width in pixels. More...
 
unsigned int mHeight
 Buffer height in pixels. More...
 
Pixel::Format mPixelFormat
 Pixel format. More...
 
ReleaseFunction mReleaseFunction
 Function for releasing memory. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

Reference counted pixel data .

The PixelData takes over the ownership of the pixel buffer. The buffer memory must NOT be released outside of this class, instead, the PixelData object will release it automatically when the reference count falls to zero.

Definition at line 36 of file pixel-data.h.

Member Enumeration Documentation

Enumerator
FREE 

Use free function to release the pixel buffer.

DELETE_ARRAY 

Use delete[] operator to release the pixel buffer.

Definition at line 40 of file pixel-data.h.

Constructor & Destructor Documentation

Dali::PixelData::PixelData ( unsigned char *  buffer,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
ReleaseFunction  releaseFunction 
)

Constructor.

Parameters
[in]bufferThe raw pixel data.
[in]widthBuffer width in pixels
[in]heightBuffer height in pixels
[in]pixelFormatThe pixel format
[in]releaseThe function used to release the memory.

Definition at line 27 of file pixel-data.cpp.

Referenced by New().

Here is the caller graph for this function:

Dali::PixelData::~PixelData ( )

Destructor.

Release the pixel buffer if exists.

Definition at line 40 of file pixel-data.cpp.

References FREE, mBuffer, and mReleaseFunction.

Dali::PixelData::PixelData ( const PixelData other)
private

Member Function Documentation

unsigned char * Dali::PixelData::GetBuffer ( ) const

Get the pixel buffer if it's present.

Returns
The buffer if exits, or NULL if there is no pixel buffer.

Definition at line 79 of file pixel-data.cpp.

References mBuffer.

Referenced by Dali::Internal::BitmapTexture::Update(), UtcDaliPixelData01(), and UtcDaliPixelData02().

Here is the caller graph for this function:

unsigned int Dali::PixelData::GetHeight ( ) const

Get the height of the buffer in pixels.

Returns
The height of the buffer in pixels

Definition at line 69 of file pixel-data.cpp.

References mHeight.

Referenced by Dali::Internal::BitmapTexture::Update(), Dali::Internal::Atlas::Upload(), and UtcDaliPixelData01().

Here is the caller graph for this function:

Pixel::Format Dali::PixelData::GetPixelFormat ( ) const

Get the pixel format.

Returns
The pixel format

Definition at line 74 of file pixel-data.cpp.

References mPixelFormat.

Referenced by Dali::Internal::BitmapTexture::Update(), and UtcDaliPixelData01().

Here is the caller graph for this function:

unsigned int Dali::PixelData::GetWidth ( ) const

Get the width of the buffer in pixels.

Returns
The width of the buffer in pixels

Definition at line 64 of file pixel-data.cpp.

References mWidth.

Referenced by Dali::Internal::BitmapTexture::Update(), Dali::Internal::Atlas::Upload(), and UtcDaliPixelData01().

Here is the caller graph for this function:

PixelDataPtr Dali::PixelData::New ( unsigned char *  buffer,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat,
ReleaseFunction  releaseFunction 
)
static

Create a PixelData object.

Parameters
[in]bufferThe raw pixel data.
[in]widthBuffer width in pixels
[in]heightBuffer height in pixels
[in]pixelFormatThe pixel format
[in]releaseThe function used to release the memory.

Definition at line 55 of file pixel-data.cpp.

References PixelData().

Referenced by Dali::Internal::BitmapLoader::Load(), Dali::Toolkit::Internal::ImageAtlas::UploadBrokenImage(), UtcDaliPixelData01(), and UtcDaliPixelData02().

Here is the call graph for this function:

Here is the caller graph for this function:

PixelData& Dali::PixelData::operator= ( const PixelData other)
private

Member Data Documentation

unsigned char* Dali::PixelData::mBuffer
private

The raw pixel data.

Definition at line 124 of file pixel-data.h.

Referenced by GetBuffer(), and ~PixelData().

unsigned int Dali::PixelData::mHeight
private

Buffer height in pixels.

Definition at line 126 of file pixel-data.h.

Referenced by GetHeight().

Pixel::Format Dali::PixelData::mPixelFormat
private

Pixel format.

Definition at line 127 of file pixel-data.h.

Referenced by GetPixelFormat().

ReleaseFunction Dali::PixelData::mReleaseFunction
private

Function for releasing memory.

Definition at line 128 of file pixel-data.h.

Referenced by ~PixelData().

unsigned int Dali::PixelData::mWidth
private

Buffer width in pixels.

Definition at line 125 of file pixel-data.h.

Referenced by GetWidth().


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