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 started
  • scroll,anim,stop - scrolling animation has stopped
  • scroll,drag,start - dragging the contents around has started
  • scroll,drag,stop - dragging the contents around has stopped
  • download,start - remote url download has started
  • download,progress - url download in progress
  • download,end - remote url download has finished
  • download,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

Photocam zoom modes

efl.elementary.ELM_PHOTOCAM_ZOOM_MODE_MANUAL

Zoom controlled normally by zoom

efl.elementary.ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT

Zoom until photo fits in photocam

efl.elementary.ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL

Zoom until photo fills photocam

efl.elementary.ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN

Zoom in until photo fits in photocam

Inheritance diagram

class efl.elementary.Photocam(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.Object

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

Deprecated since version 1.8: You should combine with Scrollable class instead.

callback_clicked_add

This is called when a user has clicked the photo without dragging around.

callback_clicked_del
callback_clicked_double_add

This is called when a user has double-clicked the photo.

callback_clicked_double_del
callback_download_done_add

This is called when you set a remote url and the download finish

New in version 1.8.

callback_download_done_del
callback_download_error_add

This is called in case a download has errors

New in version 1.8.

callback_download_error_del
callback_download_progress_add

This is called while a remote image download is in progress

New in version 1.8.

callback_download_progress_del
callback_download_start_add

This is called when you set a remote url and the download start

New in version 1.8.

callback_download_start_del
callback_load_add

Photo load begins.

callback_load_del
callback_load_detail_add

Photo detailed data load begins.

callback_load_detail_del
callback_loaded_add

This is called when the image file load is complete for the first view (low resolution blurry version).

callback_loaded_del
callback_loaded_detail_add

This is called when the image file load is complete for the detailed image data (full resolution needed).

callback_loaded_detail_del
callback_longpressed_add

This is called when a user has pressed down on the photo for a long time without dragging around.

callback_longpressed_del
callback_press_add

This is called when a user has pressed down on the photo.

callback_press_del
callback_scroll_add

The content has been scrolled (moved).

callback_scroll_anim_start_add

Scrolling animation has started.

callback_scroll_anim_start_del
callback_scroll_anim_stop_add

Scrolling animation has stopped.

callback_scroll_anim_stop_del
callback_scroll_del
callback_scroll_drag_start_add

Dragging the contents around has started.

callback_scroll_drag_start_del
callback_scroll_drag_stop_add

Dragging the contents around has stopped.

callback_scroll_drag_stop_del
callback_zoom_change_add

Zoom changed when using an auto zoom mode.

callback_zoom_change_del
callback_zoom_start_add

Zoom animation started.

callback_zoom_start_del
callback_zoom_stop_add

Zoom animation stopped.

callback_zoom_stop_del
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
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
image_orient

This allows to rotate or flip the photocam image.

Type:Evas_Image_Orient

New in version 1.14.

image_orient_get
image_orient_set
image_region

Get the region of the image that is currently shown

Type:tuple of ints
image_region_bring_in

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

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 and h 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:efl.evas.Image
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
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

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:Photocam zoom modes
zoom_mode_get
zoom_mode_set
zoom_set