Dali 3D User Interface Engine
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Dali::Integration::Bitmap Class Referenceabstract

Bitmap class. More...

#include <bitmap.h>

Inheritance diagram for Dali::Integration::Bitmap:
Inheritance graph
[legend]
Collaboration diagram for Dali::Integration::Bitmap:
Collaboration graph
[legend]

Classes

class  CompressedProfile
 
class  PackedPixelsProfile
 

Public Types

enum  Profile { BITMAP_2D_PACKED_PIXELS, BITMAP_COMPRESSED }
 Defines the characteristics of the Bitmap returned from the factory function. More...
 

Public Member Functions

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

Features that are generic between profiles.

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...
 
virtual size_t GetBufferSize () const =0
 Get the pixel buffer size in bytes. 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...
 
PackedPixelsProfile

< End of generic features

Features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile.

virtual const PackedPixelsProfileGetPackedPixelsProfile () const
 Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile. More...
 
virtual PackedPixelsProfileGetPackedPixelsProfile ()
 Get interface to features that are active only if the Bitmap was created with a BITMAP_2D_PACKED_PIXELS profile. More...
 
CompressedProfile

< End of packed pixel features.

Features that only apply to opaque/compressed formats.

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

Static Public Member Functions

static BitmapNew (Profile profile, ResourcePolicy::Discardable discardable)
 Create a new instance of a Bitmap with the required profile. More...
 

Protected Member Functions

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

 Bitmap (const Bitmap &other)
 defined private to prevent use More...
 
Bitmapoperator= (const Bitmap &other)
 defined private to prevent use More...
 

Private Attributes

ResourcePolicy::Discardable mDiscardable
 Should delete the buffer when discard buffer is called. More...
 
 DALI_LOG_OBJECT_STRING_DECLARATION
 

Detailed Description

Bitmap class.

An abstract container for image data.

Definition at line 52 of file bitmap.h.

Member Enumeration Documentation

Defines the characteristics of the Bitmap returned from the factory function.

Enumerator
BITMAP_2D_PACKED_PIXELS 

A 2D array of pixels where each pixel is a whole number of bytes and each scanline of the backing memory buffer may have additional bytes off the right edge if requested, and there may be additional scanlines past the bottom of the image in the buffer if requested.

BITMAP_COMPRESSED 

The data for the bitmap is buffered in an opaque form.

Definition at line 78 of file bitmap.h.

Constructor & Destructor Documentation

Dali::Integration::Bitmap::Bitmap ( ResourcePolicy::Discardable  discardable = ResourcePolicy::OWNED_RETAIN,
Dali::Integration::PixelBuffer pixBuf = 0 
)
protected

Constructor Use the static function Bitmap::New() to create instances.

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

Definition at line 447 of file bitmap.cpp.

Dali::Integration::Bitmap::~Bitmap ( )
virtual

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

Definition at line 473 of file bitmap.cpp.

References DALI_LOG_TRACE_METHOD, and DeletePixelBuffer().

Here is the call graph for this function:

Dali::Integration::Bitmap::Bitmap ( const Bitmap other)
private

defined private to prevent use

Member Function Documentation

void Dali::Integration::Bitmap::DeletePixelBuffer ( )

Delete the pixel buffer data.

Definition at line 481 of file bitmap.cpp.

References mData.

Referenced by Dali::Internal::BitmapPackedPixel::AssignBuffer(), DiscardBuffer(), Dali::Internal::BitmapPackedPixel::ReserveBuffer(), Dali::Internal::BitmapCompressed::ReserveBufferOfSize(), and ~Bitmap().

Here is the caller graph for this function:

void Dali::Integration::Bitmap::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.

Definition at line 465 of file bitmap.cpp.

References DeletePixelBuffer(), mDiscardable, and Dali::ResourcePolicy::OWNED_DISCARD.

Here is the call graph for this function:

virtual PixelBuffer* Dali::Integration::Bitmap::GetBuffer ( )
inlinevirtual
PixelBuffer * Dali::Integration::Bitmap::GetBufferOwnership ( )

Get the pixel buffer if it's present and take over the ownership.

Note
With this function called, the bitmap loses the ownership and is no longer responsible for the release of pixel buffer.
Returns
The raw pointer pointing to the pixel buffer

Definition at line 458 of file bitmap.cpp.

References mData.

Referenced by Dali::Internal::BitmapLoader::Load().

Here is the caller graph for this function:

virtual size_t Dali::Integration::Bitmap::GetBufferSize ( ) const
pure virtual

Get the pixel buffer size in bytes.

Returns
The buffer size in bytes.
See Also
ReserveBuffer GetBuffer

Implemented in Dali::Internal::BitmapPackedPixel, and Dali::Internal::BitmapCompressed.

Referenced by Dali::Internal::BufferImage::CreateHostBitmap(), DumpImageBufferToTempFile(), and Dali::Internal::BufferImage::UploadArea().

Here is the caller graph for this function:

virtual const CompressedProfile* Dali::Integration::Bitmap::GetCompressedProfile ( ) const
inlinevirtual

Reimplemented in Dali::Internal::BitmapCompressed.

Definition at line 297 of file bitmap.h.

Referenced by Dali::TizenPlatform::LoadBitmapFromAstc(), and Dali::TizenPlatform::LoadBitmapFromKtx().

Here is the caller graph for this function:

virtual CompressedProfile* Dali::Integration::Bitmap::GetCompressedProfile ( )
inlinevirtual

Reimplemented in Dali::Internal::BitmapCompressed.

Definition at line 298 of file bitmap.h.

unsigned int Dali::Integration::Bitmap::GetImageHeight ( ) const
inline
unsigned int Dali::Integration::Bitmap::GetImageWidth ( ) const
inline
virtual const PackedPixelsProfile* Dali::Integration::Bitmap::GetPackedPixelsProfile ( ) const
inlinevirtual

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

Reimplemented in Dali::Internal::BitmapPackedPixel.

Definition at line 263 of file bitmap.h.

Referenced by anonymous_namespace{utc-Dali-NinePatchImages.cpp}::AddChildRegionsToImage(), anonymous_namespace{utc-Dali-RendererFactory.cpp}::AddChildRegionsToImage(), anonymous_namespace{utc-Dali-Internal-ResourceClient.cpp}::CheckLoadBitmap(), anonymous_namespace{utc-Dali-RenderTask.cpp}::CompleteImageLoad(), anonymous_namespace{utc-Dali-NinePatchImages.cpp}::CreateBitmap(), anonymous_namespace{utc-Dali-RendererFactory.cpp}::CreateBitmap(), anonymous_namespace{utc-Dali-ShaderEffect.cpp}::CreateBitmap(), Dali::Internal::BufferImage::CreateHostBitmap(), Dali::Internal::Platform::CropAndPadForFittingMode(), Dali::Internal::Platform::DownscaleBitmap(), anonymous_namespace{utc-Dali-Internal-ImageFactory.cpp}::EmulateImageLoaded(), Dali::TizenPlatform::LoadBitmapFromBmp(), Dali::TizenPlatform::LoadBitmapFromIco(), Dali::TizenPlatform::LoadBitmapFromJpeg(), Dali::TizenPlatform::LoadBitmapFromPng(), Dali::TizenPlatform::LoadBitmapFromWbmp(), anonymous_namespace{utc-Dali-ResourceImage.cpp}::LoadBitmapResource(), anonymous_namespace{utc-Dali-Image.cpp}::LoadBitmapResource(), anonymous_namespace{utc-Dali-Internal-ResourceClient.cpp}::LoadImage(), Dali::Internal::ResourceManager::LoadResponse(), Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::MakeEmptyBitmap(), Dali::Internal::TextureFactory::NewBitmapTexture(), anonymous_namespace{utc-Dali-Atlas.cpp}::PrepareResourceImage(), Dali::Internal::BitmapTexture::Update(), Dali::Internal::BufferImage::UploadArea(), UtcDaliImageActorGetCurrentSize02(), UtcDaliImageActorGetCurrentSize03(), UtcDaliImageActorGetCurrentSize04(), UtcDaliImageActorGetCurrentSize05(), UtcDaliImageActorNaturalPixelAreaSize01(), UtcDaliImageActorNaturalPixelAreaSize02(), UtcDaliImageActorNinePatch01(), UtcDaliImageActorNinePatch03(), UtcDaliImageSignalUploaded(), UtcDaliInternalAddBitmapImage01(), UtcDaliInternalRequestReloadBitmapRequests01(), UtcDaliInternalRequestReloadBitmapRequests02(), UtcDaliInternalRequestReloadBitmapRequests03(), and UtcDaliInternalRequestResourceBitmapRequests01().

Here is the caller graph for this function:

virtual PackedPixelsProfile* Dali::Integration::Bitmap::GetPackedPixelsProfile ( )
inlinevirtual

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

Reimplemented in Dali::Internal::BitmapPackedPixel.

Definition at line 267 of file bitmap.h.

Pixel::Format Dali::Integration::Bitmap::GetPixelFormat ( ) const
inline
bool Dali::Integration::Bitmap::HasAlphaChannel ( ) const
inline

Queries if the bitmap has an alpha channel.

Returns
true if there is an alpha channel

Definition at line 162 of file bitmap.h.

Referenced by Dali::Internal::BitmapPackedPixel::TestForTransparency().

Here is the caller graph for this function:

void Dali::Integration::Bitmap::Initialize ( Pixel::Format  pixelFormat,
unsigned int  width,
unsigned int  height 
)
protected

Initializes internal class members.

Parameters
[in]pixelFormatpixel format
[in]widthImage width in pixels
[in]heightImage height in pixels

Definition at line 492 of file bitmap.cpp.

References DALI_ASSERT_DEBUG, Dali::Pixel::HasAlpha(), height, mHasAlphaChannel, mImageHeight, mImageWidth, mPixelFormat, and width.

Referenced by Dali::Internal::BitmapCompressed::Initialize(), and Dali::Internal::BitmapPackedPixel::Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Integration::Bitmap::IsDiscardable ( ) const
inline

Check if the pixel buffer can be discarded.

Returns
true if the pixel buffer can be discarded

Definition at line 312 of file bitmap.h.

References Dali::ResourcePolicy::OWNED_DISCARD.

bool Dali::Integration::Bitmap::IsFullyOpaque ( ) const
inline

Queries if the bitmap has any transparent data.

Returns
true if the bitmap has alpha data

Definition at line 171 of file bitmap.h.

Referenced by Dali::Internal::TextureMetadata::New(), and Dali::Internal::TextureMetadata::Update().

Here is the caller graph for this function:

Bitmap * Dali::Integration::Bitmap::New ( Profile  profile = BITMAP_2D_PACKED_PIXELS,
ResourcePolicy::Discardable  discardable = ResourcePolicy::OWNED_DISCARD 
)
static

Create a new instance of a Bitmap with the required profile.

Returns
Pointer to created Bitmap subclass. Clients should immediately wrap this in a reference-counting smart pointer or store it in a similarly automatic owning collection.
Parameters
[in]profileDefines required features of the bitmap (
See Also
Profile).
Parameters
[in]discardableOWNED_DISCARD means that the data is owned by bitmap, and may released away after uploading to GPU. OWNED_RETAIN means that the data is owned and must be kept in CPU memory e.g. for an image that cannot be reloaded from disk.

A 2D array of pixels where each pixel is a whole number of bytes and each scanline of the backing memory buffer may have additional bytes off the right edge if requested, and there may be additional scanlines past the bottom of the image in the buffer if requested.

The data for the bitmap is buffered in an opaque form.

Definition at line 420 of file bitmap.cpp.

References DALI_ASSERT_DEBUG.

Referenced by anonymous_namespace{utc-Dali-Internal-ResourceClient.cpp}::CheckLoadBitmap(), CompareLoadedImageData(), anonymous_namespace{utc-Dali-RenderTask.cpp}::CompleteImageLoad(), Dali::TizenPlatform::ImageLoader::ConvertStreamToBitmap(), anonymous_namespace{utc-Dali-NinePatchImages.cpp}::CreateBitmap(), anonymous_namespace{utc-Dali-RendererFactory.cpp}::CreateBitmap(), anonymous_namespace{utc-Dali-ShaderEffect.cpp}::CreateBitmap(), Dali::Internal::BufferImage::CreateHostBitmap(), Dali::Internal::Platform::CropAndPadForFittingMode(), DumpImageBufferToTempFile(), anonymous_namespace{utc-Dali-Internal-ImageFactory.cpp}::EmulateImageLoaded(), anonymous_namespace{utc-Dali-ResourceImage.cpp}::LoadBitmapResource(), anonymous_namespace{utc-Dali-Image.cpp}::LoadBitmapResource(), anonymous_namespace{utc-Dali-Internal-ResourceClient.cpp}::LoadImage(), Dali::Internal::Platform::anonymous_namespace{image-operations.cpp}::MakeEmptyBitmap(), anonymous_namespace{utc-Dali-Atlas.cpp}::PrepareResourceImage(), TestDownscaledBitmapHasRightDimensionsAndFormat(), TestImageLoading(), Dali::Internal::BufferImage::UploadArea(), UtcDaliImageActorGetCurrentSize02(), UtcDaliImageActorGetCurrentSize03(), UtcDaliImageActorGetCurrentSize04(), UtcDaliImageActorGetCurrentSize05(), UtcDaliImageActorNaturalPixelAreaSize01(), UtcDaliImageActorNaturalPixelAreaSize02(), UtcDaliImageActorNinePatch01(), UtcDaliImageActorNinePatch03(), UtcDaliImageSignalUploaded(), UtcDaliInternalAddBitmapImage01(), UtcDaliInternalAddBitmapImage02(), UtcDaliInternalRequestReloadBitmapRequests01(), UtcDaliInternalRequestReloadBitmapRequests02(), UtcDaliInternalRequestReloadBitmapRequests03(), UtcDaliInternalRequestResourceBitmapRequests01(), UtcDaliRendererFactoryGetImageRenderer1(), UtcDaliRendererFactoryGetImageRenderer2(), UtcDaliRendererFactoryGetNPatchRendererN1(), UtcDaliRendererFactoryGetNPatchRendererN2(), and UtcDaliResourceImageSignalLoadingFinished().

Here is the caller graph for this function:

Bitmap& Dali::Integration::Bitmap::operator= ( const Bitmap other)
private

defined private to prevent use

Member Data Documentation

Dali::Integration::Bitmap::DALI_LOG_OBJECT_STRING_DECLARATION
private

Definition at line 344 of file bitmap.h.

bool Dali::Integration::Bitmap::mAlphaChannelUsed
protected

Whether the alpha channel is used in case the image owns one.

Definition at line 333 of file bitmap.h.

Referenced by Dali::Internal::BitmapCompressed::Initialize(), and Dali::Internal::BitmapPackedPixel::TestForTransparency().

PixelBuffer* Dali::Integration::Bitmap::mData
protected
ResourcePolicy::Discardable Dali::Integration::Bitmap::mDiscardable
private

Should delete the buffer when discard buffer is called.

Definition at line 338 of file bitmap.h.

Referenced by DiscardBuffer().

bool Dali::Integration::Bitmap::mHasAlphaChannel
protected

Whether the image has an alpha channel.

Definition at line 332 of file bitmap.h.

Referenced by Initialize().

unsigned int Dali::Integration::Bitmap::mImageHeight
protected
unsigned int Dali::Integration::Bitmap::mImageWidth
protected
Pixel::Format Dali::Integration::Bitmap::mPixelFormat
protected

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