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

NativeImage represents a platform specific image resource. More...

#include <native-image-impl.h>

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

Public Member Functions

void CreateGlTexture ()
 Trigger asynchronous creation of backing GL texture immediately. More...
 
const char * GetCustomFragmentPreFix ()
 Forward declare future extension interface. More...
 
const char * GetCustomSamplerTypename ()
 Get custom sampler type name for rendering native image. More...
 
- Public Member Functions inherited from Dali::Internal::Image
ReleasePolicy GetReleasePolicy () const
 .3 More...
 
Dali::Image::ImageSignalTypeUploadedSignal ()
 This signal is emitted when the image data gets uploaded to GL. More...
 
ResourceId GetResourceId () const
 returns the Id used for lookups More...
 
virtual unsigned int GetWidth () const
 Get the width of the image. More...
 
virtual unsigned int GetHeight () const
 Get the height of the image. More...
 
virtual Vector2 GetNaturalSize () const
 Return the natural size of the image. More...
 
virtual void ResourceLoadingFailed (const ResourceTicket &ticket)
 Called when a resource fails to load. More...
 
virtual void ResourceLoadingSucceeded (const ResourceTicket &ticket)
 Called when a resource loads successfully. More...
 
virtual void ResourceUploaded (const ResourceTicket &ticket)
 Called when a resource is uploaded to graphics memory. More...
 
virtual void Connect ()
 Indicates that the image is used. More...
 
virtual void Disconnect ()
 Indicates that the image is not used anymore. More...
 
- Public Member Functions inherited from Dali::BaseObject
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
bool DoConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, FunctorDelegate *functorDelegate)
 Not intended for application developers. 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 NativeImagePtr New (NativeImageInterface &nativeImageInterface)
 Creates object by using native resources the maximum size of the image is limited by GL_MAX_TEXTURE_SIZE. More...
 
- Static Public Member Functions inherited from Dali::Internal::Image
static bool DoConnectSignal (BaseObject *object, ConnectionTrackerInterface *tracker, const std::string &signalName, FunctorDelegate *functor)
 Connects a callback function with the object's signals. More...
 

Protected Member Functions

 NativeImage (NativeImageInterface &nativeImageInterface)
 Constructor. More...
 
virtual ~NativeImage ()
 A reference counted object may only be deleted by calling Unreference() More...
 
- Protected Member Functions inherited from Dali::Internal::Image
virtual ~Image ()
 A reference counted object may only be deleted by calling Unreference() More...
 
 Image (ReleasePolicy releasePol=IMAGE_RELEASE_POLICY_DEFAULT)
 Constructor, with default parameters. More...
 
void Initialize ()
 Second stage initialization. More...
 
- Protected Member Functions inherited from Dali::BaseObject
 BaseObject ()
 Default constructor. More...
 
virtual ~BaseObject ()
 A reference counted object may only be deleted by calling Unreference(). More...
 
void RegisterObject ()
 Registers the object as created with the Object registry. More...
 
void UnregisterObject ()
 Unregisters the object from Object registry. 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 Attributes

std::string mCustomFragmentPreFix
 
std::string mCustomSamplerTypename
 

Additional Inherited Members

- Protected Attributes inherited from Dali::Internal::Image
ResourceTicketPtr mTicket
 smart pointer to the ticket object that gets completed when load finishes More...
 
unsigned int mWidth
 natural width of the image, needs to be mutable for lazy resolving and as the API for GetWidth is const More...
 
unsigned int mHeight
 natural height of the image, needs to be mutable for lazy resolving and as the API for GetHeight is const More...
 
unsigned int mConnectionCount
 number of on-stage objects using this image More...
 
ReleasePolicy mReleasePolicy: 2
 2 bits is enough space More...
 

Detailed Description

NativeImage represents a platform specific image resource.

Its data is provided by native resources, such as shared bitmap memory or pixmap. .0

Definition at line 40 of file native-image-impl.h.

Constructor & Destructor Documentation

Dali::Internal::NativeImage::NativeImage ( NativeImageInterface nativeImageInterface)
protected

Constructor.

Definition at line 44 of file native-image-impl.cpp.

References Dali::NativeImageInterface::Extension::GetCustomFragmentPreFix(), Dali::NativeImageInterface::Extension::GetCustomSamplerTypename(), Dali::NativeImageInterface::GetExtension(), mCustomFragmentPreFix, and mCustomSamplerTypename.

Referenced by New().

Here is the call graph for this function:

Here is the caller graph for this function:

Dali::Internal::NativeImage::~NativeImage ( )
protectedvirtual

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

Definition at line 73 of file native-image-impl.cpp.

Member Function Documentation

void Dali::Internal::NativeImage::CreateGlTexture ( )

Trigger asynchronous creation of backing GL texture immediately.

The normal policy is for a GL texture to created lazily when needed. This function forces the allocation of a texture to happen at the earliest opportunity.

.0

Note
If the application loses its GL context, native images may lose their GL textures. This function can be called again after context regain to force the creation of the GL texture if still needed.

Definition at line 77 of file native-image-impl.cpp.

References Dali::Internal::ResourceClient::CreateGlTexture(), Dali::Internal::ThreadLocalStorage::Get(), Dali::Internal::ThreadLocalStorage::GetResourceClient(), and Dali::Internal::Image::GetResourceId().

Here is the call graph for this function:

const char * Dali::Internal::NativeImage::GetCustomFragmentPreFix ( )

Forward declare future extension interface.

Get custom fragment prefix for rendering native image.

Returns
Custom fragment prefix code as string.

Definition at line 83 of file native-image-impl.cpp.

References mCustomFragmentPreFix.

const char * Dali::Internal::NativeImage::GetCustomSamplerTypename ( )

Get custom sampler type name for rendering native image.

Returns
Custom sampler type name.

Definition at line 93 of file native-image-impl.cpp.

References mCustomSamplerTypename.

NativeImagePtr Dali::Internal::NativeImage::New ( NativeImageInterface nativeImageInterface)
static

Creates object by using native resources the maximum size of the image is limited by GL_MAX_TEXTURE_SIZE.

Parameters
[in]nativeImageInterfaceAn reference to the object of the interface implementation.
Returns
a pointer to a newly created object.

Definition at line 55 of file native-image-impl.cpp.

References Dali::Internal::ResourceClient::AddNativeImage(), DALI_ASSERT_DEBUG, Dali::Internal::ThreadLocalStorage::Get(), Dali::IntrusivePtr< T >::Get(), Dali::NativeImageInterface::GetHeight(), Dali::Internal::ThreadLocalStorage::GetResourceClient(), Dali::NativeImageInterface::GetWidth(), and NativeImage().

Referenced by Dali::NativeImage::New().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::string Dali::Internal::NativeImage::mCustomFragmentPreFix
private

Definition at line 82 of file native-image-impl.h.

Referenced by GetCustomFragmentPreFix(), and NativeImage().

std::string Dali::Internal::NativeImage::mCustomSamplerTypename
private

Definition at line 83 of file native-image-impl.h.

Referenced by GetCustomSamplerTypename(), and NativeImage().


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