Tizen Native API
3.0
|
ResourceImage is an image loaded using a URL. More...
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. | |
ResourceImage & | operator= (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. | |
ResourceImageSignal & | LoadingFinishedSignal () |
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:
- 3.0, DALi version 1.0.0
Member Typedef Documentation
typedef Signal< void (ResourceImage) > Dali::ResourceImage::ResourceImageSignal |
Type of signal for LoadingFinished and Uploaded.
- Since:
- 3.0, DALi version 1.0.0
Constructor & Destructor Documentation
Constructor which creates an empty ResourceImage object.
Use ResourceImage::New(...) to create an initialised object.
- Since:
- 3.0, DALi version 1.0.0
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
- Since:
- 3.0, DALi version 1.0.0
Dali::ResourceImage::ResourceImage | ( | const ResourceImage & | handle | ) |
This copy constructor is required for (smart) pointer semantics.
- Since:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] handle A reference to the copied handle
Member Function Documentation
static ResourceImage Dali::ResourceImage::DownCast | ( | BaseHandle | handle | ) | [static] |
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:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] handle Handle to an object
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:
- 3.0, 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] url The URL of the image file
- Returns:
- The width and height in pixels of the image
std::string Dali::ResourceImage::GetUrl | ( | ) | const |
Returns the URL of the image.
- Since:
- 3.0, 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:
- 3.0, 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.
- Since:
- 3.0, 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] url The URL of the image file to use [in] orientationCorrection Reorient 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:
- 3.0, 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] url The URL of the image file to use [in] size The width and height to fit the loaded image to [in] fittingMode The method used to fit the shape of the image before loading to the shape defined by the size parameter [in] samplingMode The filtering method used when sampling pixels from the input image while fitting it to desired size [in] orientationCorrection Reorient 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:
- 3.0, DALi version 1.0.0
- Parameters:
-
[in] rhs A reference to the copied handle
- Returns:
- A reference to this
void Dali::ResourceImage::Reload | ( | ) |
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:
- 3.0, DALi version 1.0.0
- Note:
- If image is offstage and OnDemand policy is set, the reload request is ignored.