Typedefs | Enumerations | Functions
Photocam

Typedefs

typedef struct _Elm_Photocam_Progress Elm_Photocam_Progress
 Structure associated with smart callback 'download,progress'. More...
 
typedef struct _Elm_Photocam_Error Elm_Photocam_Error
 Structre associated with smart callback 'download,error'. More...
 

Enumerations

enum  Elm_Photocam_Zoom_Mode {
  ELM_PHOTOCAM_ZOOM_MODE_MANUAL = 0,
  ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT,
  ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL,
  ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN
}
 Types of zoom available. More...
 

Functions

EINA_DEPRECATED void elm_photocam_bounce_set (Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
 Set the photocam scrolling bouncing. More...
 
EINA_DEPRECATED void elm_photocam_bounce_get (const Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
 Get the photocam scrolling bouncing. More...
 
EOAPI void elm_obj_photocam_paused_set (Eina_Bool paused)
 Set the paused state for photocam. More...
 
EOAPI Eina_Bool elm_obj_photocam_paused_get (void)
 Get the paused state for photocam. More...
 
EOAPI void elm_obj_photocam_gesture_enabled_set (Eina_Bool gesture)
 Set the gesture state for photocam. More...
 
EOAPI Eina_Bool elm_obj_photocam_gesture_enabled_get (void)
 Get the gesture state for photocam. More...
 
EOAPI void elm_obj_photocam_zoom_set (double zoom)
 Set the zoom level of the photo. More...
 
EOAPI double elm_obj_photocam_zoom_get (void)
 Get the zoom level of the photo. More...
 
EOAPI void elm_obj_photocam_zoom_mode_set (Elm_Photocam_Zoom_Mode mode)
 Set the zoom mode. More...
 
EOAPI Elm_Photocam_Zoom_Mode elm_obj_photocam_zoom_mode_get (void)
 Get the zoom mode. More...
 
EOAPI void elm_obj_photocam_image_region_get (int *x, int *y, int *w, int *h)
 Get the region of the image that is currently shown. More...
 
EOAPI Evas_Object * elm_obj_photocam_internal_image_get (void)
 Get the internal low-res image used for photocam. More...
 
EOAPI void elm_obj_photocam_image_size_get (int *w, int *h)
 Get the current image pixel width and height. More...
 
EOAPI void elm_obj_photocam_image_orient_set (Evas_Image_Orient orient)
 Set the photocam image orientation. More...
 
EOAPI Evas_Image_Orient elm_obj_photocam_image_orient_get (void)
 Get the photocam image orientation. More...
 
EOAPI void elm_obj_photocam_image_region_show (int x, int y, int w, int h)
 Set the viewed region of the image. More...
 
void elm_photocam_paused_set (Elm_Photocam *obj, Eina_Bool paused)
 Set the paused state for photocam. More...
 
Eina_Bool elm_photocam_paused_get (const Elm_Photocam *obj)
 Get the paused state for photocam. More...
 
void elm_photocam_gesture_enabled_set (Elm_Photocam *obj, Eina_Bool gesture)
 Set the gesture state for photocam. More...
 
Eina_Bool elm_photocam_gesture_enabled_get (const Elm_Photocam *obj)
 Get the gesture state for photocam. More...
 
void elm_photocam_zoom_set (Elm_Photocam *obj, double zoom)
 Set the zoom level of the photo. More...
 
double elm_photocam_zoom_get (const Elm_Photocam *obj)
 Get the zoom level of the photo. More...
 
void elm_photocam_zoom_mode_set (Elm_Photocam *obj, Elm_Photocam_Zoom_Mode mode)
 Set the zoom mode. More...
 
Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get (const Elm_Photocam *obj)
 Get the zoom mode. More...
 
void elm_photocam_image_region_get (const Elm_Photocam *obj, int *x, int *y, int *w, int *h)
 Get the region of the image that is currently shown. More...
 
Evas_Object * elm_photocam_internal_image_get (const Elm_Photocam *obj)
 Get the internal low-res image used for photocam. More...
 
void elm_photocam_image_size_get (const Elm_Photocam *obj, int *w, int *h)
 Get the current image pixel width and height. More...
 
void elm_photocam_image_orient_set (Elm_Photocam *obj, Evas_Image_Orient orient)
 Set the photocam image orientation. More...
 
Evas_Image_Orient elm_photocam_image_orient_get (const Elm_Photocam *obj)
 Get the photocam image orientation. More...
 
void elm_photocam_image_region_show (Elm_Photocam *obj, int x, int y, int w, int h)
 Set the viewed region of the image. More...
 
Evas_Object * elm_photocam_add (Evas_Object *parent)
 Add a new Photocam object. More...
 
void elm_photocam_image_region_bring_in (Evas_Object *obj, int x, int y, int w, int h)
 Bring in the viewed portion of the image. More...
 
Evas_Load_Error elm_photocam_file_set (Evas_Object *obj, const char *file)
 Set the photo file to be shown. More...
 
const char * elm_photocam_file_get (const Evas_Object *obj)
 Returns the path of the current image file. More...
 

Detailed Description

photocam_inheritance_tree.png
preview-00.png

Photocam is a widget meant specifically for displaying high-resolution digital camera photos, giving speedy feedback (fast load), zooming and panning as well as fitting logic, all with low memory footprint. It is entirely focused on jpeg images, and takes advantage of properties of the jpeg format (via Evas loader features in the jpeg loader).

Signals that you can add callbacks for are:

This widget implements the elm-scrollable-interface interface, so that all (non-deprecated) functions for the base Scroller widget also work for photocam objects.

Some calls on the photocam's API are marked as deprecated, as they just wrap the scrollable widgets counterpart functions. Use the ones we point you to, for each case of deprecation here, instead – eventually the deprecated ones will be discarded (next major release).

Photocam example shows the API in action.

Typedef Documentation

typedef struct _Elm_Photocam_Error Elm_Photocam_Error

Structre associated with smart callback 'download,error'.

Since
1.8
typedef struct _Elm_Photocam_Progress Elm_Photocam_Progress

Structure associated with smart callback 'download,progress'.

Since
1.8

Enumeration Type Documentation

Types of zoom available.

Enumerator
ELM_PHOTOCAM_ZOOM_MODE_MANUAL 

Zoom controlled normally by elm_photocam_zoom_set.

ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT 

Zoom until photo fits in photocam.

ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL 

Zoom until photo fills photocam.

ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN 

Zoom in until photo fits in photocam.

Function Documentation

EOAPI Eina_Bool elm_obj_photocam_gesture_enabled_get ( void  )

Get the gesture state for photocam.

This gets the current gesture state for the photocam object.

Returns
The gesture state.

Referenced by elm_photocam_gesture_enabled_get().

EOAPI void elm_obj_photocam_gesture_enabled_set ( Eina_Bool  gesture)

Set the gesture state for photocam.

This sets the gesture state to on or off for photocam. The default is off. This will start multi touch zooming.

Parameters
[in]gestureThe gesture state.

Referenced by elm_photocam_gesture_enabled_set().

EOAPI Evas_Image_Orient elm_obj_photocam_image_orient_get ( void  )

Get the photocam image orientation.

Returns
The photocam image orientation Evas_Image_Orient. Default is #EVAS_IMAGE_ORIENT_NONE.
Since
1.14

Referenced by elm_photocam_image_orient_get().

EOAPI void elm_obj_photocam_image_orient_set ( Evas_Image_Orient  orient)

Set the photocam image orientation.

This function allows to rotate or flip the photocam image.

Parameters
[in]orientThe photocam image orientation Evas_Image_Orient. Default is #EVAS_IMAGE_ORIENT_NONE.
Since
1.14

Referenced by elm_photocam_image_orient_set().

EOAPI void elm_obj_photocam_image_region_get ( int *  x,
int *  y,
int *  w,
int *  h 
)

Get the region of the image that is currently shown.

See also elm_obj_photocam_image_region_show.

Parameters
[out]xA pointer to the X-coordinate of region
[out]yA pointer to the Y-coordinate of region
[out]wA pointer to the width
[out]hA pointer to the height

Referenced by elm_photocam_image_region_get().

EOAPI void elm_obj_photocam_image_region_show ( int  x,
int  y,
int  w,
int  h 
)

Set the viewed region of the image.

This shows the region of the image without using animation.

Parameters
[in]yY-coordinate of region in image original pixels
[in]wWidth of region in image original pixels
[in]hHeight of region in image original pixels

Referenced by elm_photocam_image_region_show().

EOAPI void elm_obj_photocam_image_size_get ( int *  w,
int *  h 
)

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.

Parameters
[out]wA pointer to the width return
[out]hA pointer to the height return

Referenced by elm_photocam_image_size_get().

EOAPI Evas_Object* elm_obj_photocam_internal_image_get ( void  )

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.

Returns
The internal image object handle or null

Referenced by elm_photocam_internal_image_get().

EOAPI Eina_Bool elm_obj_photocam_paused_get ( void  )

Get the paused state for photocam.

This gets the current paused state for the photocam object.

Returns
The pause state.

Referenced by elm_photocam_paused_get().

EOAPI void elm_obj_photocam_paused_set ( Eina_Bool  paused)

Set the paused state for photocam.

This sets the paused state to on or off 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.

Parameters
[in]pausedThe pause state.

Referenced by elm_photocam_paused_set().

EOAPI double elm_obj_photocam_zoom_get ( void  )

Get the zoom level of the photo.

This returns the current zoom level of the photocam object. Note that if you set the fill mode to other than ELM_PHOTOCAM_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the photocam object itself to account for photo size and photocam viewport size.

Returns
The zoom level to set

Referenced by elm_photocam_zoom_get().

EOAPI Elm_Photocam_Zoom_Mode elm_obj_photocam_zoom_mode_get ( void  )

Get the zoom mode.

This gets the current zoom mode of the photocam object.

Returns
The zoom mode.

Referenced by elm_photocam_zoom_mode_get().

EOAPI void elm_obj_photocam_zoom_mode_set ( Elm_Photocam_Zoom_Mode  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 elm_obj_photocam_zoom_set 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.

Parameters
[in]modeThe zoom mode.

Referenced by elm_photocam_zoom_mode_set().

EOAPI void elm_obj_photocam_zoom_set ( double  zoom)

Set the zoom level of the photo.

This sets the zoom level. If zoom is 1, it means no zoom. If it's smaller than 1, it means zoom in. If it's bigger than 1, it means zoom out. For example, zoom 1 will be 1:1 pixel for pixel. zoom 2 will be 2:1 (that is 2x2 photo pixels will display as 1 on-screen pixel) which is a zoom out. 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The zoom parameter must be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8, 16, 32, etc.).

Parameters
[in]zoomThe zoom level to set

Referenced by elm_photocam_zoom_set().

Evas_Object* elm_photocam_add ( Evas_Object *  parent)

Add a new Photocam object.

Parameters
parentThe parent object
Returns
The new object or NULL if it cannot be created
EINA_DEPRECATED void elm_photocam_bounce_get ( const Evas_Object *  obj,
Eina_Bool *  h_bounce,
Eina_Bool *  v_bounce 
)

Get the photocam scrolling bouncing.

Parameters
objThe photocam object
h_bouncehorizontal bouncing
v_bouncevertical bouncing
See also
elm_photocam_bounce_set()
Deprecated:
Use elm_scroller_bounce_get() instead.
EINA_DEPRECATED void elm_photocam_bounce_set ( Evas_Object *  obj,
Eina_Bool  h_bounce,
Eina_Bool  v_bounce 
)

Set the photocam scrolling bouncing.

Parameters
objThe photocam object
h_bounceset this to EINA_TRUE for horizontal bouncing
v_bounceset this to EINA_TRUE for vertical bouncing
Deprecated:
Use elm_scroller_bounce_set() instead.
const char* elm_photocam_file_get ( const Evas_Object *  obj)

Returns the path of the current image file.

Returns
Returns the path
See also
elm_photocam_file_set()
Evas_Load_Error elm_photocam_file_set ( Evas_Object *  obj,
const char *  file 
)

Set the photo file to be shown.

Returns
The return error (see EVAS_LOAD_ERROR_NONE, EVAS_LOAD_ERROR_GENERIC etc.)

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.

Parameters
[in]fileThe photo file
Examples:
photocam_example_01.c.
Eina_Bool elm_photocam_gesture_enabled_get ( const Elm_Photocam *  obj)

Get the gesture state for photocam.

This gets the current gesture state for the photocam object.

Returns
The gesture state.

References elm_obj_photocam_gesture_enabled_get().

void elm_photocam_gesture_enabled_set ( Elm_Photocam *  obj,
Eina_Bool  gesture 
)

Set the gesture state for photocam.

This sets the gesture state to on or off for photocam. The default is off. This will start multi touch zooming.

Parameters
[in]gestureThe gesture state.

References elm_obj_photocam_gesture_enabled_set().

Evas_Image_Orient elm_photocam_image_orient_get ( const Elm_Photocam *  obj)

Get the photocam image orientation.

Returns
The photocam image orientation Evas_Image_Orient. Default is #EVAS_IMAGE_ORIENT_NONE.
Since
1.14

References elm_obj_photocam_image_orient_get().

void elm_photocam_image_orient_set ( Elm_Photocam *  obj,
Evas_Image_Orient  orient 
)

Set the photocam image orientation.

This function allows to rotate or flip the photocam image.

Parameters
[in]orientThe photocam image orientation Evas_Image_Orient. Default is #EVAS_IMAGE_ORIENT_NONE.
Since
1.14

References elm_obj_photocam_image_orient_set().

void elm_photocam_image_region_bring_in ( Evas_Object *  obj,
int  x,
int  y,
int  w,
int  h 
)

Bring in the viewed portion of the image.

Parameters
objThe photocam object
xX-coordinate of region in image original pixels
yY-coordinate of region in image original pixels
wWidth of region in image original pixels
hHeight of region in image original pixels

This shows the region of the image using animation.

void elm_photocam_image_region_get ( const Elm_Photocam *  obj,
int *  x,
int *  y,
int *  w,
int *  h 
)

Get the region of the image that is currently shown.

See also elm_photocam_image_region_show.

Parameters
[out]xA pointer to the X-coordinate of region
[out]yA pointer to the Y-coordinate of region
[out]wA pointer to the width
[out]hA pointer to the height

References elm_obj_photocam_image_region_get().

void elm_photocam_image_region_show ( Elm_Photocam *  obj,
int  x,
int  y,
int  w,
int  h 
)

Set the viewed region of the image.

This shows the region of the image without using animation.

Parameters
[in]yY-coordinate of region in image original pixels
[in]wWidth of region in image original pixels
[in]hHeight of region in image original pixels

References elm_obj_photocam_image_region_show().

void elm_photocam_image_size_get ( const Elm_Photocam *  obj,
int *  w,
int *  h 
)

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.

Parameters
[out]wA pointer to the width return
[out]hA pointer to the height return

References elm_obj_photocam_image_size_get().

Evas_Object* elm_photocam_internal_image_get ( const Elm_Photocam *  obj)

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.

Returns
The internal image object handle or null

References elm_obj_photocam_internal_image_get().

Eina_Bool elm_photocam_paused_get ( const Elm_Photocam *  obj)

Get the paused state for photocam.

This gets the current paused state for the photocam object.

Returns
The pause state.

References elm_obj_photocam_paused_get().

void elm_photocam_paused_set ( Elm_Photocam *  obj,
Eina_Bool  paused 
)

Set the paused state for photocam.

This sets the paused state to on or off 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.

Parameters
[in]pausedThe pause state.

References elm_obj_photocam_paused_set().

double elm_photocam_zoom_get ( const Elm_Photocam *  obj)

Get the zoom level of the photo.

This returns the current zoom level of the photocam object. Note that if you set the fill mode to other than ELM_PHOTOCAM_ZOOM_MODE_MANUAL (which is the default), the zoom level may be changed at any time by the photocam object itself to account for photo size and photocam viewport size.

Returns
The zoom level to set

References elm_obj_photocam_zoom_get().

Elm_Photocam_Zoom_Mode elm_photocam_zoom_mode_get ( const Elm_Photocam *  obj)

Get the zoom mode.

This gets the current zoom mode of the photocam object.

Returns
The zoom mode.

References elm_obj_photocam_zoom_mode_get().

void elm_photocam_zoom_mode_set ( Elm_Photocam *  obj,
Elm_Photocam_Zoom_Mode  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 elm_photocam_zoom_set 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.

Parameters
[in]modeThe zoom mode.

References elm_obj_photocam_zoom_mode_set().

void elm_photocam_zoom_set ( Elm_Photocam *  obj,
double  zoom 
)

Set the zoom level of the photo.

This sets the zoom level. If zoom is 1, it means no zoom. If it's smaller than 1, it means zoom in. If it's bigger than 1, it means zoom out. For example, zoom 1 will be 1:1 pixel for pixel. zoom 2 will be 2:1 (that is 2x2 photo pixels will display as 1 on-screen pixel) which is a zoom out. 4:1 will be 4x4 photo pixels as 1 screen pixel, and so on. The zoom parameter must be greater than 0. It is suggested to stick to powers of 2. (1, 2, 4, 8, 16, 32, etc.).

Parameters
[in]zoomThe zoom level to set

References elm_obj_photocam_zoom_set().