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

Compressed Texture class. More...

#include <compressed-bitmap-texture.h>

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

Public Member Functions

 CompressedBitmapTexture (Internal::BitmapCompressed *const bitmap, Context &context, ResourcePolicy::Discardable discardPolicy)
 Constructor Creates a new texture object from a Bitmap. More...
 
virtual ~CompressedBitmapTexture ()
 Destructor. More...
 
virtual bool Init ()
 Initialization method for Texture. More...
 
virtual unsigned int GetWidth () const
 Return the width of image in pixels. More...
 
virtual unsigned int GetHeight () const
 Return the height of image in pixels. More...
 
virtual bool HasAlphaChannel () const
 Query whether the texture data has an alpha channel. More...
 
virtual bool IsFullyOpaque () const
 Query whether the texture is completely opaque. More...
 
virtual void Update (Integration::Bitmap *bitmap)
 Bitmap has been reloaded - update the texture appropriately. More...
 
virtual bool UpdateOnCreate ()
 
- Public Member Functions inherited from Dali::Internal::Texture
virtual void UpdateArea (const RectArea &area)
 Update the texture from the modified bitmap. More...
 
virtual void Update (Integration::Bitmap *srcBitmap, std::size_t xOffset, std::size_t yOffset)
 Update part of the texture with a different bitmap. More...
 
virtual void Update (PixelData *srcPixelData, std::size_t xOffset, std::size_t yOffset)
 Update part of the texture with a pixel buffer. More...
 
virtual bool Bind (GLenum target, TextureUnit textureunit)
 Binds the texture for use. More...
 
unsigned int GetTextureId ()
 Returns GL texture ID. More...
 
void SetTextureId (GLuint id)
 Sets the texture id. More...
 
void ApplySampler (TextureUnit unit, unsigned int samplerBitfield)
 Apply the given sampler to the texture. More...
 
virtual ~Texture ()
 Destructor. More...
 
virtual void GlContextDestroyed ()
 Reset all GL resources. More...
 
virtual void GlCleanup ()
 Release all GL resources. 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...
 
- Public Member Functions inherited from Dali::Internal::GlResourceOwner
virtual ~GlResourceOwner ()
 Virtual destructor. More...
 

Protected Member Functions

virtual bool CreateGlTexture ()
 Initialize texture for rendering. More...
 
- Protected Member Functions inherited from Dali::Internal::Texture
 Texture (Context &context, unsigned int width, unsigned int height, unsigned int imageWidth, unsigned int imageHeight)
 Constructor. More...
 
 Texture (Context &context, unsigned int width, unsigned int height)
 Constructor. 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...
 

Private Member Functions

void AssignBitmap (bool generateTexture, const unsigned char *pixels, const size_t bufferSize)
 Assigns the bitmap data to an OpenGL texture Creates a new texture object and copies the image data held in the pixels parameter. More...
 

Private Attributes

Internal::BitmapCompressedPtr mBitmap
 The Bitmap the Texture was created from (may be NULL) More...
 
Pixel::Format mPixelFormat
 
 DALI_LOG_OBJECT_STRING_DECLARATION
 

Additional Inherited Members

- Public Types inherited from Dali::Internal::Texture
typedef Rect< int > PixelArea
 Used to define the area of the texture to display. More...
 
typedef Rect< unsigned int > RectArea
 Used to define a region of a bitmap. More...
 
- Protected Attributes inherited from Dali::Internal::Texture
ContextmContext
 The GL Context. More...
 
GLuint mId
 Texture id. More...
 
unsigned int mSamplerBitfield
 The packed bitfield of the current sampler. More...
 
unsigned int mWidth
 texture width, may be scaled power of 2 (if not in an atlas) More...
 
unsigned int mHeight
 texture width, may be scaled power of 2 (if not in an atlas) More...
 
unsigned int mImageWidth
 width of the original image (may be smaller than texture width) More...
 
unsigned int mImageHeight
 height of the original image (may be smaller than texture height) More...
 

Detailed Description

Compressed Texture class.

If you want to load a file to a CompressedBitmapTexture use TextureManager::GetTexture() Compressed textures differ from ordinary ones in that their in-memory representation cannot be inspected at a pixel level by simple pointer arithmetic and in that they cannot be partially updated.

Definition at line 51 of file compressed-bitmap-texture.h.

Constructor & Destructor Documentation

Dali::Internal::CompressedBitmapTexture::CompressedBitmapTexture ( Internal::BitmapCompressed *const  bitmap,
Context context,
ResourcePolicy::Discardable  discardPolicy 
)

Constructor Creates a new texture object from a Bitmap.

Parameters
[in]bitmapThe Bitmap
[in]contextThe GL context
[in]discardPolicyThe discard policy

Definition at line 33 of file compressed-bitmap-texture.cpp.

References DALI_LOG_GET_OBJECT_STRING, DALI_LOG_SET_OBJECT_STRING, and DALI_LOG_TRACE_METHOD.

Dali::Internal::CompressedBitmapTexture::~CompressedBitmapTexture ( )
virtual

Destructor.

Definition at line 46 of file compressed-bitmap-texture.cpp.

References DALI_LOG_TRACE_METHOD.

Member Function Documentation

void Dali::Internal::CompressedBitmapTexture::AssignBitmap ( bool  generateTexture,
const unsigned char *  pixels,
const size_t  bufferSize 
)
private
bool Dali::Internal::CompressedBitmapTexture::CreateGlTexture ( )
protectedvirtual

Initialize texture for rendering.

Returns
true on success

Implements Dali::Internal::Texture.

Definition at line 144 of file compressed-bitmap-texture.cpp.

References AssignBitmap(), DALI_ASSERT_DEBUG, DALI_LOG_GET_OBJECT_C_STR, DALI_LOG_INFO, DALI_LOG_TRACE_METHOD, mBitmap, and Dali::Internal::Texture::mId.

Here is the call graph for this function:

unsigned int Dali::Internal::CompressedBitmapTexture::GetHeight ( ) const
virtual

Return the height of image in pixels.

Returns
height

Reimplemented from Dali::Internal::Texture.

Definition at line 186 of file compressed-bitmap-texture.cpp.

References height, mBitmap, and Dali::Internal::Texture::mHeight.

unsigned int Dali::Internal::CompressedBitmapTexture::GetWidth ( ) const
virtual

Return the width of image in pixels.

Returns
width

Reimplemented from Dali::Internal::Texture.

Definition at line 176 of file compressed-bitmap-texture.cpp.

References mBitmap, Dali::Internal::Texture::mWidth, and width.

bool Dali::Internal::CompressedBitmapTexture::HasAlphaChannel ( ) const
virtual

Query whether the texture data has an alpha channel.

Returns
True if the texture data has an alpha channel.

Implements Dali::Internal::Texture.

Definition at line 53 of file compressed-bitmap-texture.cpp.

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

Referenced by IsFullyOpaque().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::CompressedBitmapTexture::Init ( )
virtual

Initialization method for Texture.

Might or might not be needed in specific implementations.

Returns
true if successful, false otherwise

Implements Dali::Internal::Texture.

Definition at line 169 of file compressed-bitmap-texture.cpp.

References DALI_LOG_TRACE_METHOD, and mBitmap.

bool Dali::Internal::CompressedBitmapTexture::IsFullyOpaque ( ) const
virtual

Query whether the texture is completely opaque.

Returns
True if all pixels of the texture data are opaque

Implements Dali::Internal::Texture.

Definition at line 58 of file compressed-bitmap-texture.cpp.

References HasAlphaChannel(), and mBitmap.

Here is the call graph for this function:

void Dali::Internal::CompressedBitmapTexture::Update ( Integration::Bitmap bitmap)
virtual

Bitmap has been reloaded - update the texture appropriately.

Parameters
[in]bitmapThe new bitmap

Reimplemented from Dali::Internal::Texture.

Definition at line 96 of file compressed-bitmap-texture.cpp.

References AssignBitmap(), DALI_ASSERT_DEBUG, DALI_LOG_ERROR, DALI_LOG_INFO, mBitmap, Dali::Internal::Texture::mHeight, Dali::Internal::Texture::mId, Dali::Internal::Texture::mImageHeight, Dali::Internal::Texture::mImageWidth, mPixelFormat, and Dali::Internal::Texture::mWidth.

Here is the call graph for this function:

bool Dali::Internal::CompressedBitmapTexture::UpdateOnCreate ( )
virtual
Returns
Return true if the texture should be updated on GL texture creation.

Reimplemented from Dali::Internal::Texture.

Definition at line 139 of file compressed-bitmap-texture.cpp.

Member Data Documentation

Dali::Internal::CompressedBitmapTexture::DALI_LOG_OBJECT_STRING_DECLARATION
private

Definition at line 128 of file compressed-bitmap-texture.h.

Internal::BitmapCompressedPtr Dali::Internal::CompressedBitmapTexture::mBitmap
private

The Bitmap the Texture was created from (may be NULL)

Definition at line 124 of file compressed-bitmap-texture.h.

Referenced by CreateGlTexture(), GetHeight(), GetWidth(), Init(), IsFullyOpaque(), and Update().

Pixel::Format Dali::Internal::CompressedBitmapTexture::mPixelFormat
private

Definition at line 125 of file compressed-bitmap-texture.h.

Referenced by AssignBitmap(), HasAlphaChannel(), and Update().


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