Tizen Native API  6.0
Dali::BufferImage Class Reference

BufferImage represents an image resource as a pixel data buffer. More...

Inheritance diagram for Dali::BufferImage:
Dali::Image Dali::BaseHandle

Public Member Functions

 BufferImage () DALI_DEPRECATED_API
 Constructor which creates an uninitialized BufferImage object.
 ~BufferImage () DALI_DEPRECATED_API
 Destructor.
 BufferImage (const BufferImage &handle) DALI_DEPRECATED_API
 This copy constructor is required for (smart) pointer semantics.
BufferImageoperator= (const BufferImage &rhs) DALI_DEPRECATED_API
 This assignment operator is required for (smart) pointer semantics.
PixelBufferGetBuffer () DALI_DEPRECATED_API
 Returns the pixel buffer of the Image.
uint32_t GetBufferSize () const DALI_DEPRECATED_API
 Returns buffer size in bytes.
uint32_t GetBufferStride () const DALI_DEPRECATED_API
 Returns buffer stride (in bytes).
Pixel::Format GetPixelFormat () const DALI_DEPRECATED_API
 Returns the pixel format of the contained buffer.
void Update () DALI_DEPRECATED_API
 Inform Dali that the contents of the buffer have changed.
void Update (RectArea updateArea) DALI_DEPRECATED_API
bool IsDataExternal () const DALI_DEPRECATED_API
 Returns whether BufferImage uses external data source or not.

Static Public Member Functions

static BufferImage New (uint32_t width, uint32_t height, Pixel::Format pixelformat=Pixel::RGBA8888) DALI_DEPRECATED_API
 Creates a new BufferImage.
static BufferImage New (PixelBuffer *pixelBuffer, uint32_t width, uint32_t height, Pixel::Format pixelFormat=Pixel::RGBA8888, uint32_t stride=0) DALI_DEPRECATED_API
 Creates a new BufferImage, which uses an external data source.
static BufferImage DownCast (BaseHandle handle) DALI_DEPRECATED_API
 Downcasts a handle to BufferImage handle.
static const BufferImage WHITE () DALI_DEPRECATED_API
 White pixel as image data.

Detailed Description

BufferImage represents an image resource as a pixel data buffer.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Its pixel buffer data is provided by the application developer.

If the pixel format of the pixel buffer contains an alpha channel, then the image is considered to be have transparent pixels without regard for the actual content of the channel, and will be blended.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Constructor which creates an uninitialized BufferImage object.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Use BufferImage::New(...) to create an initialized object.

Since:
2.4, DALi version 1.0.0

Destructor.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
2.4, DALi version 1.0.0

This copy constructor is required for (smart) pointer semantics.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41
Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

static BufferImage Dali::BufferImage::DownCast ( BaseHandle  handle) [static]

Downcasts a handle to BufferImage handle.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

If the handle points to a BufferImage, the downcast produces valid handle. If not, the returned handle is left uninitialized.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
Handle to a BufferImage or an uninitialized handle

Reimplemented from Dali::Image.

Returns the pixel buffer of the Image.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

The application can write to the buffer to modify its contents.

Whilst the image is on stage, after writing to the buffer the application should call Update() and wait for the Image::UploadedSignal() method before writing again.

Since:
2.4, DALi version 1.0.0
Returns:
The pixel buffer

Returns buffer size in bytes.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41
Since:
2.4, DALi version 1.0.0
Returns:
The buffer size in bytes

Returns buffer stride (in bytes).

Deprecated:
Deprecated since 4.0, DALi version 1.2.41
Since:
2.4, DALi version 1.0.0
Returns:
The buffer stride

Returns the pixel format of the contained buffer.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41
Since:
2.4, DALi version 1.0.0
Returns:
The pixel format

Returns whether BufferImage uses external data source or not.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

If not, dali holds ownership of the PixelBuffer, otherwise the application is responsible for freeing it.

The application must not destroy an external PixelBuffer on a staged image if it has called Update() and hasn't received a Image::UploadedSignal.

Since:
2.4, DALi version 1.0.0
Returns:
true if application owns data, false otherwise
static BufferImage Dali::BufferImage::New ( uint32_t  width,
uint32_t  height,
Pixel::Format  pixelformat = Pixel::RGBA8888 
) [static]

Creates a new BufferImage.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Also a pixel buffer for image data is allocated. Dali has ownership of the buffer. For better performance and portability use power of two dimensions. The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]pixelformatThe pixel format (rgba 32 bit by default)
Returns:
A handle to a new instance of BufferImage
Precondition:
width & height are greater than zero
Note:
default resource management policies are Immediate and Never
static BufferImage Dali::BufferImage::New ( PixelBuffer pixelBuffer,
uint32_t  width,
uint32_t  height,
Pixel::Format  pixelFormat = Pixel::RGBA8888,
uint32_t  stride = 0 
) [static]

Creates a new BufferImage, which uses an external data source.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

The PixelBuffer has to be allocated by application.

The application holds ownership of the buffer. It must not destroy the PixelBuffer on a staged image if it has called Update() and hasn't received a Image::UploadedSignal, or if it has just added it to the stage and has not received a Image::UploadedSignal.

For better performance and portability use power of two dimensions. The maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]pixelBufferPixel buffer has to be allocated by application
[in]widthImage width in pixels
[in]heightImage height in pixels
[in]pixelFormatThe pixel format (rgba 32 bit by default)
[in]strideThe internal stride of the pixelbuffer in pixels
Returns:
A handle to a new instance of BufferImage
Precondition:
width & height are greater than zero
BufferImage& Dali::BufferImage::operator= ( const BufferImage rhs)

This assignment operator is required for (smart) pointer semantics.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41
Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

Inform Dali that the contents of the buffer have changed.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Image::UploadedSignal will be sent in response if the image is on stage and the image data has been successfully copied to graphics memory. To avoid visual tearing, the application should wait for the Image::UploadedSignal before modifying the data.

The application must not destroy an external PixelBuffer on a staged image after calling this method until the Image::UploadedSignal has been successfully received.

Since:
2.4, DALi version 1.0.0
Note:
BufferImage::Update might not work with BGR/BGRA formats!
Some GPUs may not support Non power of two buffer updates (for example C110/SGX540)
void Dali::BufferImage::Update ( RectArea  updateArea)
Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Inform Dali that the contents of the buffer have changed.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Image::UploadedSignal will be sent in response if the image is on stage and the image data has been successfully copied to graphics memory. To avoid visual tearing, the application should wait for the Image::UploadedSignal before modifying the data.

The application must not destroy an external PixelBuffer on a staged image after calling this method until the Image::UploadedSignal has been successfully received.

Since:
2.4, DALi version 1.0.0
Note:
BufferImage::Update might not work with BGR/BGRA formats!
Some GPUs may not support Non power of two buffer updates (for example C110/SGX540)
Parameters:
[in]updateAreaArea that has changed in buffer
static const BufferImage Dali::BufferImage::WHITE ( ) [static]

White pixel as image data.

Deprecated:
Deprecated since 4.0, DALi version 1.2.41

Can be used to create solid color actors.

Since:
2.4, DALi version 1.0.0
Returns:
1 white pixel with 32 bit colordepth