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

A Bitmap-based implementation of the NativeImage interface. More...

#include <native-bitmap-buffer-impl.h>

Inheritance diagram for Dali::Internal::Adaptor::NativeBitmapBuffer:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Adaptor::NativeBitmapBuffer:
Collaboration graph
[legend]

Public Member Functions

 NativeBitmapBuffer (Adaptor *adaptor, unsigned int width, unsigned int height, Pixel::Format pixelFormat)
 Constructor. More...
 
virtual ~NativeBitmapBuffer ()
 virtual destructor More...
 
void Write (const unsigned char *src, size_t size)
 Write to buffer. More...
 
virtual bool GlExtensionCreate ()
 Forward declare future extension interface. More...
 
virtual void GlExtensionDestroy ()
 Destroy the GL resource for the NativeImage. More...
 
virtual unsigned int TargetTexture ()
 Use the NativeImage as a texture for rendering. More...
 
virtual void PrepareTexture ()
 Called in each NativeTexture::Bind() call to allow implementation specific operations. More...
 
virtual unsigned int GetWidth () const
 Returns the width of the NativeImage. More...
 
virtual unsigned int GetHeight () const
 Returns the height of the NativeImage. More...
 
virtual bool RequiresBlending () const
 Query whether blending is required .0. More...
 
- Public Member Functions inherited from Dali::NativeImageInterface
virtual ExtensionGetExtension ()
 Retrieve the extension for the interface. 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...
 

Private Member Functions

 NativeBitmapBuffer (const NativeBitmapBuffer &)
 not defined More...
 
NativeBitmapBufferoperator= (const NativeBitmapBuffer &)
 not defined More...
 
 NativeBitmapBuffer ()
 not defined More...
 

Private Attributes

Integration::GlAbstractionmGlAbstraction
 GlAbstraction used. More...
 
Integration::LocklessBuffermBuffer
 bitmap data double buffered More...
 
unsigned int mWidth
 Image width. More...
 
unsigned int mHeight
 Image height. More...
 
Pixel::Format mPixelFormat
 Image pixelformat. More...
 
const unsigned char * mLastReadBuffer
 last buffer that was read More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::NativeImageInterface
virtual ~NativeImageInterface ()
 A reference counted object may only be deleted by calling Unreference(). More...
 

Detailed Description

A Bitmap-based implementation of the NativeImage interface.

Definition at line 46 of file native-bitmap-buffer-impl.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::NativeBitmapBuffer::NativeBitmapBuffer ( Adaptor adaptor,
unsigned int  width,
unsigned int  height,
Pixel::Format  pixelFormat 
)

Constructor.

Parameters
adaptorAdaptor used
widthwidth of image
heightheight of image
pixelFormatpixel format for image

Definition at line 37 of file native-bitmap-buffer-impl.cpp.

References DALI_ASSERT_ALWAYS, Dali::Pixel::GetBytesPerPixel(), mBuffer, and mGlAbstraction.

Here is the call graph for this function:

Dali::Internal::Adaptor::NativeBitmapBuffer::~NativeBitmapBuffer ( )
virtual

virtual destructor

Definition at line 48 of file native-bitmap-buffer-impl.cpp.

References mBuffer.

Dali::Internal::Adaptor::NativeBitmapBuffer::NativeBitmapBuffer ( const NativeBitmapBuffer )
private

not defined

Dali::Internal::Adaptor::NativeBitmapBuffer::NativeBitmapBuffer ( )
private

not defined

Member Function Documentation

unsigned int Dali::Internal::Adaptor::NativeBitmapBuffer::GetHeight ( ) const
virtual

Returns the height of the NativeImage.

.0

Returns
height

Implements Dali::NativeImageInterface.

Definition at line 96 of file native-bitmap-buffer-impl.cpp.

References mHeight.

unsigned int Dali::Internal::Adaptor::NativeBitmapBuffer::GetWidth ( ) const
virtual

Returns the width of the NativeImage.

.0

Returns
width

Implements Dali::NativeImageInterface.

Definition at line 91 of file native-bitmap-buffer-impl.cpp.

References mWidth.

bool Dali::Internal::Adaptor::NativeBitmapBuffer::GlExtensionCreate ( )
virtual

Forward declare future extension interface.

Create the GL resource for the NativeImage.

e.g. For the EglImageKHR extension, this corresponds to calling eglCreateImageKHR() .0

Returns
false If the initialization fails.
Precondition
There is a GL context for the current thread.

Implements Dali::NativeImageInterface.

Definition at line 77 of file native-bitmap-buffer-impl.cpp.

void Dali::Internal::Adaptor::NativeBitmapBuffer::GlExtensionDestroy ( )
virtual

Destroy the GL resource for the NativeImage.

e.g. For the EglImageKHR extension, this corresponds to calling eglDestroyImageKHR() .0

Precondition
There is a GL context for the current thread.

Implements Dali::NativeImageInterface.

Definition at line 82 of file native-bitmap-buffer-impl.cpp.

NativeBitmapBuffer& Dali::Internal::Adaptor::NativeBitmapBuffer::operator= ( const NativeBitmapBuffer )
private

not defined

void Dali::Internal::Adaptor::NativeBitmapBuffer::PrepareTexture ( )
virtual

Called in each NativeTexture::Bind() call to allow implementation specific operations.

The correct texture sampler has already been bound before the function gets called. .0

Precondition
glAbstraction is being used by context in current thread

Implements Dali::NativeImageInterface.

Definition at line 53 of file native-bitmap-buffer-impl.cpp.

References Dali::Integration::ConvertToGlFormat(), DALI_ASSERT_ALWAYS, GL_RGBA, GL_TEXTURE_2D, GL_UNSIGNED_BYTE, mBuffer, mGlAbstraction, mHeight, mLastReadBuffer, mPixelFormat, mWidth, Dali::Integration::LocklessBuffer::Read(), and Dali::Integration::GlAbstraction::TexImage2D().

Here is the call graph for this function:

bool Dali::Internal::Adaptor::NativeBitmapBuffer::RequiresBlending ( ) const
virtual

Query whether blending is required .0.

Implements Dali::NativeImageInterface.

Definition at line 101 of file native-bitmap-buffer-impl.cpp.

References Dali::Pixel::HasAlpha(), and mPixelFormat.

Here is the call graph for this function:

unsigned int Dali::Internal::Adaptor::NativeBitmapBuffer::TargetTexture ( )
virtual

Use the NativeImage as a texture for rendering.

.0

Returns
A GL error code
Precondition
There is a GL context for the current thread.

Implements Dali::NativeImageInterface.

Definition at line 86 of file native-bitmap-buffer-impl.cpp.

void Dali::Internal::Adaptor::NativeBitmapBuffer::Write ( const unsigned char *  src,
size_t  size 
)

Write to buffer.

Does not block.

Parameters
[in]srcdata source
[in]sizesize of data in bytes
Returns
true if successful, false if currently reading from buffer in render thread

Definition at line 72 of file native-bitmap-buffer-impl.cpp.

References mBuffer, and Dali::Integration::LocklessBuffer::Write().

Here is the call graph for this function:

Member Data Documentation

Integration::LocklessBuffer* Dali::Internal::Adaptor::NativeBitmapBuffer::mBuffer
private

bitmap data double buffered

Definition at line 116 of file native-bitmap-buffer-impl.h.

Referenced by NativeBitmapBuffer(), PrepareTexture(), Write(), and ~NativeBitmapBuffer().

Integration::GlAbstraction* Dali::Internal::Adaptor::NativeBitmapBuffer::mGlAbstraction
private

GlAbstraction used.

Definition at line 114 of file native-bitmap-buffer-impl.h.

Referenced by NativeBitmapBuffer(), and PrepareTexture().

unsigned int Dali::Internal::Adaptor::NativeBitmapBuffer::mHeight
private

Image height.

Definition at line 118 of file native-bitmap-buffer-impl.h.

Referenced by GetHeight(), and PrepareTexture().

const unsigned char* Dali::Internal::Adaptor::NativeBitmapBuffer::mLastReadBuffer
private

last buffer that was read

Definition at line 120 of file native-bitmap-buffer-impl.h.

Referenced by PrepareTexture().

Pixel::Format Dali::Internal::Adaptor::NativeBitmapBuffer::mPixelFormat
private

Image pixelformat.

Definition at line 119 of file native-bitmap-buffer-impl.h.

Referenced by PrepareTexture(), and RequiresBlending().

unsigned int Dali::Internal::Adaptor::NativeBitmapBuffer::mWidth
private

Image width.

Definition at line 117 of file native-bitmap-buffer-impl.h.

Referenced by GetWidth(), and PrepareTexture().


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