Photocam¶
Widget description¶
This is a widget specifically for displaying high-resolution digital camera photos giving speedy feedback (fast load), low memory footprint and zooming and panning as well as fitting logic. It is entirely focused on jpeg images, and takes advantage of properties of the jpeg format (via evas loader features in the jpeg loader).
Emitted signals¶
clicked
- This is called when a user has clicked the photo without dragging around.press
- This is called when a user has pressed down on the photo.longpressed
- This is called when a user has pressed down on the photo for a long time without dragging around.clicked,double
- This is called when a user has double-clicked the photo.load
- Photo load begins.loaded
- This is called when the image file load is complete for the first view (low resolution blurry version).load,detail
- Photo detailed data load begins.loaded,detail
- This is called when the image file load is complete for the detailed image data (full resolution needed).zoom,start
- Zoom animation started.zoom,stop
- Zoom animation stopped.zoom,change
- Zoom changed when using an auto zoom mode.scroll
- the content has been scrolled (moved)scroll,anim,start
- scrolling animation has startedscroll,anim,stop
- scrolling animation has stoppedscroll,drag,start
- dragging the contents around has startedscroll,drag,stop
- dragging the contents around has stoppeddownload,start
- remote url download has starteddownload,progress
- url download in progressdownload,end
- remote url download has finisheddownload,error
- remote url download has finished with errors
Scrollable Interface¶
This widget supports the scrollable interface.
If you wish to control the scrolling behaviour using these functions,
inherit both the widget class and the
Scrollable
class
using multiple inheritance, for example:
class ScrollableGenlist(Genlist, Scrollable):
def __init__(self, canvas, *args, **kwargs):
Genlist.__init__(self, canvas)
Enumerations¶
Inheritance diagram¶
- class efl.elementary.Photocam(Object parent, *args, **kwargs)¶
Bases:
efl.elementary.__init__.Object
This is the class that actually implements the widget.
- Parameters
parent (
efl.evas.Object
) – The parent object**kwargs – All the remaining keyword arguments are interpreted as properties of the instance
- bounce¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- bounce_get()¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- bounce_set(h, v)¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- callback_clicked_add(func, *args, **kwargs)¶
This is called when a user has clicked the photo without dragging around.
- callback_clicked_del(func)¶
- callback_clicked_double_add(func, *args, **kwargs)¶
This is called when a user has double-clicked the photo.
- callback_clicked_double_del(func)¶
- callback_download_done_add(func, *args, **kwargs)¶
This is called when you set a remote url and the download finish
New in version 1.8.
- callback_download_done_del(func)¶
- callback_download_error_add(func, *args, **kwargs)¶
This is called in case a download has errors
New in version 1.8.
- callback_download_error_del(func)¶
- callback_download_progress_add(func, *args, **kwargs)¶
This is called while a remote image download is in progress
New in version 1.8.
- callback_download_progress_del(func)¶
- callback_download_start_add(func, *args, **kwargs)¶
This is called when you set a remote url and the download start
New in version 1.8.
- callback_download_start_del(func)¶
- callback_load_add(func, *args, **kwargs)¶
Photo load begins.
- callback_load_del(func)¶
- callback_load_detail_add(func, *args, **kwargs)¶
Photo detailed data load begins.
- callback_load_detail_del(func)¶
- callback_loaded_add(func, *args, **kwargs)¶
This is called when the image file load is complete for the first view (low resolution blurry version).
- callback_loaded_del(func)¶
- callback_loaded_detail_add(func, *args, **kwargs)¶
This is called when the image file load is complete for the detailed image data (full resolution needed).
- callback_loaded_detail_del(func)¶
- callback_longpressed_add(func, *args, **kwargs)¶
This is called when a user has pressed down on the photo for a long time without dragging around.
- callback_longpressed_del(func)¶
- callback_press_add(func, *args, **kwargs)¶
This is called when a user has pressed down on the photo.
- callback_press_del(func)¶
- callback_scroll_add(func, *args, **kwargs)¶
The content has been scrolled (moved).
- callback_scroll_anim_start_add(func, *args, **kwargs)¶
Scrolling animation has started.
- callback_scroll_anim_start_del(func)¶
- callback_scroll_anim_stop_add(func, *args, **kwargs)¶
Scrolling animation has stopped.
- callback_scroll_anim_stop_del(func)¶
- callback_scroll_del(func)¶
- callback_scroll_drag_start_add(func, *args, **kwargs)¶
Dragging the contents around has started.
- callback_scroll_drag_start_del(func)¶
- callback_scroll_drag_stop_add(func, *args, **kwargs)¶
Dragging the contents around has stopped.
- callback_scroll_drag_stop_del(func)¶
- callback_zoom_change_add(func, *args, **kwargs)¶
Zoom changed when using an auto zoom mode.
- callback_zoom_change_del(func)¶
- callback_zoom_start_add(func, *args, **kwargs)¶
Zoom animation started.
- callback_zoom_start_del(func)¶
- callback_zoom_stop_add(func, *args, **kwargs)¶
Zoom animation stopped.
- callback_zoom_stop_del(func)¶
- file¶
The photo file to be shown
This sets (and shows) the specified file (with a relative or absolute path) and will return a load error (same error that evas_object_image_load_error_get() will return). The image will change and adjust its size at this point and begin a background load process for this photo that at some time in the future will be displayed at the full quality needed.
- Type
string
- Raises
RuntimeError – when setting the file fails
- file_get()¶
- file_set(filename)¶
- gesture_enabled¶
Set the gesture state for photocam.
This sets the gesture state to on (True) or off (False) for photocam. The default is off. This will start multi touch zooming.
- Type
bool
- gesture_enabled_get()¶
- gesture_enabled_set(gesture)¶
- image_orient¶
This allows to rotate or flip the photocam image.
- Type
New in version 1.14.
- image_orient_get()¶
- image_orient_set(orient)¶
- image_region¶
Get the region of the image that is currently shown
See also
See also
- Type
tuple of ints
- image_region_bring_in(x, y, w, h)¶
Bring in the viewed portion of the image
This shows the region of the image using animation.
- Parameters
x (int) – X-coordinate of region in image original pixels
y (int) – Y-coordinate of region in image original pixels
w (int) – Width of region in image original pixels
h (int) – Height of region in image original pixels
- image_region_get()¶
- image_region_show(x, y, w, h)¶
Set the viewed region of the image
This shows the region of the image without using animation.
- Parameters
x (int) – X-coordinate of region in image original pixels
y (int) – Y-coordinate of region in image original pixels
w (int) – Width of region in image original pixels
h (int) – Height of region in image original pixels
- image_size¶
Get the current image pixel width and height
This gets the current photo pixel width and height (for the original). The size will be returned in the integers
w
andh
that are pointed to.- Type
tuple of ints
- image_size_get()¶
- internal_image¶
Get the internal low-res image used for photocam
This gets the internal image object inside photocam. Do not modify it. It is for inspection only, and hooking callbacks to. Nothing else. It may be deleted at any time as well.
- Type
- internal_image_get()¶
- paused¶
Set the paused state for photocam
This sets the paused state to on (True) or off (False) for photocam. The default is off. This will stop zooming using animation on zoom level changes and change instantly. This will stop any existing animations that are running.
- Type
bool
- paused_get()¶
- paused_set(paused)¶
- scroller_policy¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- scroller_policy_get()¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- scroller_policy_set(policy_h, policy_v)¶
Deprecated since version 1.8: You should combine with Scrollable class instead.
- zoom¶
The zoom level of the photo
This sets the zoom level. 1 will be 1:1 pixel for pixel. 2 will be 2:1 (that is 2x2 photo pixels will display as 1 on-screen pixel). 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The parameter must be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8, 16, 32, etc.).
- Type
float
- zoom_get()¶
- zoom_mode¶
Set the zoom mode
This sets the zoom mode to manual or one of several automatic levels. Manual (ELM_PHOTOCAM_ZOOM_MODE_MANUAL) means that zoom is set manually by
zoom
and will stay at that level until changed by code or until zoom mode is changed. This is the default mode. The Automatic modes will allow the photocam object to automatically adjust zoom mode based on properties. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT will adjust zoom so the photo fits EXACTLY inside the scroll frame with no pixels outside this region. ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL will be similar but ensure no pixels within the frame are left unfilled.- Type
- zoom_mode_get()¶
- zoom_mode_set(mode)¶
- zoom_set(zoom)¶