Part of elisa.plugins.base.models.image View In Hierarchy
Known subclasses: elisa.plugins.coherence.models.UpnpImageModel, elisa.plugins.rss.models.RssImageModel
An image model contains a list of references to image files that are in fact one image in various dimensions. This list is ordered by increasing size of image. This allows to easily retrieve the largest or the smallest representation of an image.
'A simple example': the image is used as the cover art of an elisa.plugins.base.models.audio.AlbumModel
.
A resource provider fills this image model with a thumbnail and a huge high
contrast image. Now the UI can decide that it does not want to show such a
high quality image because it is going to be used as an icon in a list. It
uses model.cover.references[0]
(the first one, the smallest
image) and the amount of data to load is minimal. Later the user decides to
play a track of the album and the UI wants to show it in fullscreen, it
always uses the last image in the list because it is the largest one (and
very probably the one with the best quality for a huge picture):
model.cover.references[-1]
.
Instance Variables | references | images ordered by increasing size of raw data
(type: list of elisa.core.media_uri.MediaUri
) |
orientation | orientation of the image, its meaning is the same as the orienation EXIF
field
(type: one of the keys of IMAGE_ORIENTATIONS
) | |
can_rotate | can the image represented by the model be rotated?
(type: bool
) |
Line # | Kind | Name | Docs |
---|---|---|---|
107 | Method | __init__ | Constructor. Initialize all the fields. |
116 | Method | get_cached_data_path | Undocumented |
129 | Method | _compute_cached_path | Undocumented |
134 | Method | _cache_raw_data | Undocumented |
144 | Method | _retrieve_raw_data_model | Undocumented |
Inherited from Bindable (via Model):
Line # | Kind | Name | Docs |
---|---|---|---|
34 | Method | bind | Bind a local attribute to
destination_attribute of |
73 | Method | unbind | Remove the binding of attribute to
destination_attribute of |
104 | Method | unbind_object | Remove all the bindings you have for a certain
destination_object . |
118 | Method | __setattr__ | Undocumented |
136 | Method | __delattr__ | Undocumented |