Tizen Native API  3.0

ResourceImage is an image loaded using a URL. More...

Inheritance diagram for Dali::ResourceImage:
Dali::Image Dali::BaseHandle

Public Types

typedef Signal< void(ResourceImage) > ResourceImageSignal
 Type of signal for LoadingFinished and Uploaded.

Public Member Functions

 ResourceImage ()
 Constructor which creates an empty ResourceImage object.
 ~ResourceImage ()
 Destructor.
 ResourceImage (const ResourceImage &handle)
 This copy constructor is required for (smart) pointer semantics.
ResourceImageoperator= (const ResourceImage &rhs)
 This assignment operator is required for (smart) pointer semantics.
LoadingState GetLoadingState () const
 Queries whether the image data has loaded.
std::string GetUrl () const
 Returns the URL of the image.
void Reload ()
 Reloads image from filesystem.
ResourceImageSignalLoadingFinishedSignal ()
 Emitted when the image data loads successfully, or when the loading fails.

Static Public Member Functions

static ImageDimensions GetImageSize (const std::string &url)
 Gets the size of an image from disk.
static ResourceImage DownCast (BaseHandle handle)
 Downcasts a handle to ResourceImage handle.
ResourceImageFactoryFunctions

Creates ResourceImage object instances using these functions.

static ResourceImage New (const std::string &url, bool orientationCorrection=true)
 Creates an initialized ResourceImage object.
static ResourceImage New (const std::string &url, ImageDimensions size, FittingMode::Type fittingMode=FittingMode::DEFAULT, SamplingMode::Type samplingMode=SamplingMode::DEFAULT, bool orientationCorrection=true)
 Creates an initialized ResourceImage object.

Detailed Description

ResourceImage is an image loaded using a URL.

Customizing load requests

Size, scaling mode, filter mode, and orientation compensation can be set when requesting an image.

Reloading images

The same request used on creating the ResourceImage is re-issued when reloading images. If the file changed since the last load operation, this might result in a different resource. Reload only takes effect if the ResourceImage has already finished loading.

Signals | Signal Name | Method | |----------------------|------------------------------| | imageLoadingFinished | LoadingFinishedSignal() |

Since:
2.4, DALi version 1.0.0

Member Typedef Documentation

Type of signal for LoadingFinished and Uploaded.

Since:
2.4, DALi version 1.0.0

Constructor & Destructor Documentation

Constructor which creates an empty ResourceImage object.

Use ResourceImage::New(...) to create an initialised object.

Since:
2.4, DALi version 1.0.0

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since:
2.4, DALi version 1.0.0

This copy constructor is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleA reference to the copied handle

Member Function Documentation

Downcasts a handle to ResourceImage handle.

If handle points to a ResourceImage object, the downcast produces valid handle. If not, the returned handle is left uninitialized.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
Handle to a Image object or an uninitialized handle

Reimplemented from Dali::Image.

static ImageDimensions Dali::ResourceImage::GetImageSize ( const std::string &  url) [static]

Gets the size of an image from disk.

This function will read the header info from file on disk and is synchronous, so it should not be used repeatedly or in tight loops.

Since:
2.4, DALi version 1.0.0
Remarks:
http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
Parameters:
[in]urlThe URL of the image file
Returns:
The width and height in pixels of the image

Queries whether the image data has loaded.

The asynchronous loading begins when the Image object is created. After the Image object is discarded, the image data will be released from memory.

Since:
2.4, DALi version 1.0.0
Returns:
The loading state, either Loading, Success or Failed
std::string Dali::ResourceImage::GetUrl ( ) const

Returns the URL of the image.

Since:
2.4, DALi version 1.0.0
Returns:
The URL of the image file

Emitted when the image data loads successfully, or when the loading fails.

Since:
2.4, DALi version 1.0.0
Returns:
A signal object to Connect() with
static ResourceImage Dali::ResourceImage::New ( const std::string &  url,
bool  orientationCorrection = true 
) [static]

Creates an initialized ResourceImage object.

Uses defaults for all options.

See also:
Dali::FittingMode::Type Dali::SamplingMode::Type
Since:
2.4, DALi version 1.0.0
Remarks:
http://tizen.org/privilege/internet is needed if url is a http or https address.
http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
Parameters:
[in]urlThe URL of the image file to use
[in]orientationCorrectionReorient the image to respect any orientation metadata in its header
Returns:
A handle to a newly allocated object
static ResourceImage Dali::ResourceImage::New ( const std::string &  url,
ImageDimensions  size,
FittingMode::Type  fittingMode = FittingMode::DEFAULT,
SamplingMode::Type  samplingMode = SamplingMode::DEFAULT,
bool  orientationCorrection = true 
) [static]

Creates an initialized ResourceImage object.

Since:
2.4, DALi version 1.0.0
Remarks:
http://tizen.org/privilege/internet is needed if url is a http or https address.
http://tizen.org/privilege/mediastorage is needed if url is relevant to media storage.
http://tizen.org/privilege/externalstorage is needed if url is relevant to external storage.
Parameters:
[in]urlThe URL of the image file to use
[in]sizeThe width and height to fit the loaded image to
[in]fittingModeThe method used to fit the shape of the image before loading to the shape defined by the size parameter
[in]samplingModeThe filtering method used when sampling pixels from the input image while fitting it to desired size
[in]orientationCorrectionReorient the image to respect any orientation metadata in its header
Returns:
A handle to a newly allocated object
ResourceImage& Dali::ResourceImage::operator= ( const ResourceImage rhs)

This assignment operator is required for (smart) pointer semantics.

Since:
2.4, DALi version 1.0.0
Parameters:
[in]rhsA reference to the copied handle
Returns:
A reference to this

Reloads image from filesystem.

The original set of image loading attributes (requested dimensions, scaling mode and filter mode) are used when requesting the image again.

Since:
2.4, DALi version 1.0.0
Note:
If image is offstage and OnDemand policy is set, the reload request is ignored.