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

ImageTicket is essentially the same as a ResourceTicket, except that it contains additional information about the loaded image resource. More...

#include <image-ticket.h>

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

Public Member Functions

 ImageTicket (ResourceTicketLifetimeObserver &observer, unsigned int id, ResourceTypePath &typePath)
 Create an image resource request. More...
 
const ImageAttributesGetAttributes () const
 Get the attributes of an image. More...
 
int GetWidth () const
 Get the width of an image. More...
 
int GetHeight () const
 Get the height of an image. More...
 
- Public Member Functions inherited from Dali::Internal::ResourceTicket
 ResourceTicket (ResourceTicketLifetimeObserver &observer, unsigned int id, ResourceTypePath &typePath)
 Create a resource request. More...
 
unsigned int GetId () const
 Retrieve the unique ID of the resource request. More...
 
const ResourceTypePathGetTypePath () const
 Retrieve the type and path of the resource request. More...
 
Dali::LoadingState GetLoadingState () const
 Query the state of the resource loading request. More...
 
void AddObserver (ResourceTicketObserver &observer)
 Adds an observer. More...
 
void RemoveObserver (ResourceTicketObserver &observer)
 Removes an observer. More...
 
void LoadingSucceeded ()
 Called when a resource loads successfully. More...
 
void LoadingFailed ()
 Called when a resource fails to load. More...
 
void Loading ()
 Reset state to ResourceLoading. More...
 
void Uploaded ()
 Notification when a resource has been uploaded to GL. More...
 
void StopLifetimeObservation ()
 Called when the ResourceTicketLifetimeObserver is being destroyed. 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...
 

Protected Member Functions

virtual ~ImageTicket ()
 A reference counted object may only be deleted by calling Unreference() More...
 
- Protected Member Functions inherited from Dali::Internal::ResourceTicket
virtual ~ResourceTicket ()
 A reference counted object may only be deleted by calling Unreference() 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

 ImageTicket (const ImageTicket &typePath)
 
ImageTicketoperator= (const ImageTicket &rhs)
 

Private Attributes

ImageAttributes mAttributes
 Loaded Image attributes (width, height, pixelformat etc.). More...
 

Friends

class ResourceClient
 

Detailed Description

ImageTicket is essentially the same as a ResourceTicket, except that it contains additional information about the loaded image resource.

The data is the result of the resource loading request.

Multi-threading note: this class should be used in the main thread only i.e. not from within Dali::Integration::Core::Render().

Definition at line 44 of file image-ticket.h.

Constructor & Destructor Documentation

Dali::Internal::ImageTicket::ImageTicket ( ResourceTicketLifetimeObserver observer,
unsigned int  id,
ResourceTypePath typePath 
)

Create an image resource request.

This should only be done by the ResourceTicketRegistry.

Parameters
[in]observerA resource ticket lifetime observer.
[in]idA unique ID for this ticket (loading request).
[in]typePathThe resource Type & Path pair.

Definition at line 27 of file image-ticket.cpp.

virtual Dali::Internal::ImageTicket::~ImageTicket ( )
inlineprotectedvirtual

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

Definition at line 92 of file image-ticket.h.

Dali::Internal::ImageTicket::ImageTicket ( const ImageTicket typePath)
private

Member Function Documentation

const ImageAttributes& Dali::Internal::ImageTicket::GetAttributes ( ) const
inline

Get the attributes of an image.

Only to be used after the image has finished loading. (Ticket's LoadingSucceeded callback was called) Reflects the last cached values after a LoadComplete. If requested width or height was 0, they are replaced by concrete dimensions.

Returns
a copy of the image attributes

Definition at line 65 of file image-ticket.h.

References mAttributes.

int Dali::Internal::ImageTicket::GetHeight ( ) const

Get the height of an image.

Only to be used after the image has finished loading. (Ticket's LoadingSucceeded callback was called) Reflects the last cached values after a LoadComplete. If requested width or height was 0, they are replaced by concrete dimensions.

Returns
the height

Definition at line 37 of file image-ticket.cpp.

References Dali::Internal::ImageAttributes::GetHeight(), and mAttributes.

Here is the call graph for this function:

int Dali::Internal::ImageTicket::GetWidth ( ) const

Get the width of an image.

Only to be used after the image has finished loading. (Ticket's LoadingSucceeded callback was called) Reflects the last cached values after a LoadComplete. If requested width or height was 0, they are replaced by concrete dimensions.

Returns
the width

Definition at line 32 of file image-ticket.cpp.

References Dali::Internal::ImageAttributes::GetWidth(), and mAttributes.

Here is the call graph for this function:

ImageTicket& Dali::Internal::ImageTicket::operator= ( const ImageTicket rhs)
private

Friends And Related Function Documentation

friend class ResourceClient
friend

Definition at line 117 of file image-ticket.h.

Member Data Documentation

ImageAttributes Dali::Internal::ImageTicket::mAttributes
private

Loaded Image attributes (width, height, pixelformat etc.).

Contains actual values only after the image has finished loading. If requested width or height was 0, the natural size is used.

Definition at line 111 of file image-ticket.h.

Referenced by GetAttributes(), GetHeight(), and GetWidth().


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