Image Object Functions

- Main Page
- Related Pages
- Modules
- Namespaces
- Data Structures
- Files
- Examples

Typedefs | Functions
Image Object Functions
Evas » Specific Object Functions

Here are grouped together functions used to create and manipulate image objects. More...

## Typedefs
typedef void(* | Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o)
| Function signature for the evas object pixels get callback function. More...
typedef Emile_Colorspace | Evas_Colorspace
| Colorspaces for pixel data supported by Evas. More...

## Functions
Eina_Bool | evas_object_image_extension_can_load_get (const char *file)
| Check if a file extension may be supported by Image Object Functions. More...
Eina_Bool | evas_object_image_extension_can_load_fast_get (const char *file)
| Check if a file extension may be supported by Image Object Functions. More...
Evas_Object * | evas_object_image_add (Evas *e)
| Creates a new image object on the given Evas `e` canvas. More...
Evas_Object * | evas_object_image_filled_add (Evas *e)
| Creates a new image object that automatically scales its bound image to the object's area, on both axis. More...
void | evas_object_image_memfile_set (Evas_Object *obj, void *data, int size, char *format, char *key)
| Sets the data for an image from memory to be loaded. More...
void | evas_object_image_native_surface_set (Evas_Object *obj, Evas_Native_Surface *surf)
| Set the native surface of a given image of the canvas. More...
void | evas_object_image_preload (Evas_Object *obj, Eina_Bool cancel)
| Preload an image object's image data in the background. More...
Eina_Bool | evas_object_image_source_unset (Evas_Object *obj)
| Clear the source object on a proxy image object. More...
void | evas_object_image_alpha_mask_set (Evas_Object *obj, Eina_Bool ismask)
| Enable an image to be used as an alpha mask. More...
void | evas_object_image_file_set (Eo *obj, const char *file, const char *key)
| Set the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones). More...
void | evas_object_image_file_get (const Eo *obj, const char **file, const char **key)
| Retrieve the source file from where an image object is to fetch the real image data (it may be an Eet file, besides pure image ones). More...
void | evas_object_image_mmap_set (Eo *obj, const Eina_File *f, const char *key)
| Set the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File). More...
void | evas_object_image_mmap_get (const Eo *obj, const Eina_File **f, const char **key)
| Get the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File). More...
Eina_Bool | evas_object_image_save (const Eo *obj, const char *file, const char *key, const char *flags)
| Save the given image object's contents to an (image) file. More...
Eina_Bool | evas_object_image_animated_get (const Eo *obj)
| Check if an image object can be animated (have multiple frames) More...
void | evas_object_image_load_size_set (Eo *obj, int w, int h)
| Set the load size of a given image object's source image. More...
void | evas_object_image_load_size_get (const Eo *obj, int *w, int *h)
| Get the load size of a given image object's source image. More...
void | evas_object_image_smooth_scale_set (Eo *obj, Eina_Bool smooth_scale)
| Sets whether to use high-quality image scaling algorithm on the given image object. More...
Eina_Bool | evas_object_image_smooth_scale_get (const Eo *obj)
| Retrieves whether the given image object is using high-quality image scaling algorithm. More...
void | evas_object_image_fill_spread_set (Evas_Object *obj, Evas_Fill_Spread spread)
| Sets the tiling mode for the given evas image object's fill. More...
Evas_Fill_Spread | evas_object_image_fill_spread_get (const Evas_Object *obj)
| Retrieves the spread (tiling mode) for the given image object's fill. More...
void | evas_object_image_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
| Set how to fill an image object's drawing rectangle given the (real) image bound to it. More...
void | evas_object_image_fill_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
| Retrieve how an image object is to fill its drawing rectangle, given the (real) image bound to it. More...
void | evas_object_image_size_set (Evas_Object *obj, int w, int h)
| Sets the size of the given image object. More...
void | evas_object_image_size_get (const Evas_Object *obj, int *w, int *h)
| Retrieves the size of the given image object. More...
void * | evas_object_image_data_convert (Evas_Object *obj, Evas_Colorspace to_cspace) EINA_DEPRECATED
Eina_Bool | evas_object_image_pixels_import (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) EINA_DEPRECATED
void | evas_object_image_reload (Evas_Object *obj) EINA_DEPRECATED

## Detailed Description

Here are grouped together functions used to create and manipulate image objects.

They are available to whichever occasion one needs complex imagery on a GUI that could not be achieved by the other Evas' primitive object types, or to make image manipulations.

Evas will support whichever image file types it was compiled with support to (its image loaders) – check your software packager for that information and see evas_object_image_extension_can_load_get().

# Image object basics

The most common use of image objects – to display an image on the canvas – is achieved by a common function triplet:

img = evas_object_image_add(canvas);
evas_object_image_file_set(img, "path/to/img", NULL);
evas_object_image_fill_set(img, 0, 0, w, h);

The first function, naturally, is creating the image object. Then, one must set an source file on it, so that it knows where to fetch image data from. Next, one must set how to fill the image object's area with that given pixel data. One could use just a sub-region of the original image or even have it tiled repeatedly on the image object. For the common case of having the whole source image to be displayed on the image object, stretched to the destination's size, there's also a function helper, to be used instead of evas_object_image_fill_set():

evas_object_image_filled_set(img, EINA_TRUE);

See those functions' documentation for more details.

# Scale and resizing

Resizing of image objects will scale their respective source images to their areas, if they are set to "fill" the object's area (evas_object_image_filled_set()). If the user wants any control on the aspect ratio of an image for different sizes, he/she has to take care of that themselves. There are functions to make images to get loaded scaled (up or down) in memory, already, if the user is going to use them at pre-determined sizes and wants to save computations.

Evas has even a scale cache, which will take care of caching scaled versions of images with more often usage/hits. Finally, one can have images being rescaled smoothly by Evas (more computationally expensive) or not.

# Performance hints

When dealing with image objects, there are some tricks to boost the performance of your application, if it does intense image loading and/or manipulations, as in animations on a UI.

## Load hints

In image viewer applications, for example, the user will be looking at a given image, at full size, and will desire that the navigation to the adjacent images on his/her album be fluid and fast. Thus, while displaying a given image, the program can be on the background loading the next and previous images already, so that displaying them on the sequence is just a matter of repainting the screen (and not decoding image data).

Evas addresses this issue with image pre-loading. The code for the situation above would be something like the following:

prev = evas_object_image_filled_add(canvas);
evas_object_image_file_set(prev, "/path/to/prev", NULL);
evas_object_image_preload(prev, EINA_TRUE);
next = evas_object_image_filled_add(canvas);
evas_object_image_file_set(next, "/path/to/next", NULL);
evas_object_image_preload(next, EINA_TRUE);

If you're loading images which are too big, consider setting previously it's loading size to something smaller, in case you won't expose them in real size. It may speed up the loading considerably:

//to load a scaled down version of the image in memory, if that's
//the size you'll be displaying it anyway
evas_object_image_load_scale_down_set(img, zoom);
//optional: if you know you'll be showing a sub-set of the image's
//pixels, you can avoid loading the complementary data
evas_object_image_load_region_set(img, x, y, w, h);

Refer to Elementary's Photocam widget for a high level (smart) object which does lots of loading speed-ups for you.

## Animation hints

If you want to animate image objects on a UI (what you'd get by concomitant usage of other libraries, like Ecore and Edje), there are also some tips on how to boost the performance of your application. If the animation involves resizing of an image (thus, re-scaling), you'd better turn off smooth scaling on it during the animation, turning it back on afterwards, for less computations. Also, in this case you'd better flag the image object in question not to cache scaled versions of it:

evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_DYNAMIC);
// resizing takes place in between
evas_object_image_scale_hint_set(wd->img, EVAS_IMAGE_SCALE_HINT_STATIC);

Finally, movement of opaque images through the canvas is less expensive than of translucid ones, because of blending computations.

# Borders

Evas provides facilities for one to specify an image's region to be treated specially – as "borders". This will make those regions be treated specially on resizing scales, by keeping their aspect. This makes setting frames around other objects on UIs easy. See the following figures for a visual explanation:
Full-size Full-size

# Manipulating pixels

Evas image objects can be used to manipulate raw pixels in many ways. The meaning of the data in the pixel arrays will depend on the image's color space, be warned (see next section). You can set your own data as an image's pixel data, fetch an image's pixel data for saving/altering, convert images between different color spaces and even advanced operations like setting a native surface as image objects' data.

# Color spaces

Image objects may return or accept "image data" in multiple formats. This is based on the color space of an object. Here is a rundown on formats:

- #EVAS_COLORSPACE_ARGB8888: This pixel format is a linear block of pixels, starting at the top-left row by row until the bottom right of the image or pixel region. All pixels are 32-bit unsigned int's with the high-byte being alpha and the low byte being blue in the format ARGB. Alpha may or may not be used by evas depending on the alpha flag of the image, but if not used, should be set to 0xff anyway.
  This colorspace uses premultiplied alpha. That means that R, G and B cannot exceed A in value. The conversion from non-premultiplied colorspace is:
  R = (r * a) / 255; G = (g * a) / 255; B = (b * a) / 255;
  So 50% transparent blue will be: 0x80000080. This will not be "dark" - just 50% transparent. Values are 0 == black, 255 == solid or full red, green or blue.

- #EVAS_COLORSPACE_YCBCR422P601_PL: This is a pointer-list indirected set of YUV (YCbCr) pixel data. This means that the data returned or set is not actual pixel data, but pointers TO lines of pixel data. The list of pointers will first be N rows of pointers to the Y plane - pointing to the first pixel at the start of each row in the Y plane. N is the height of the image data in pixels. Each pixel in the Y, U and V planes is 1 byte exactly, packed. The next N / 2 pointers will point to rows in the U plane, and the next N / 2 pointers will point to the V plane rows. U and V planes are half the horizontal and vertical resolution of the Y plane.
  Row order is top to bottom and row pixels are stored left to right.
  There is a limitation that these images MUST be a multiple of 2 pixels in size horizontally or vertically. This is due to the U and V planes being half resolution. Also note that this assumes the itu601 YUV colorspace specification. This is defined for standard television and mpeg streams. HDTV may use the itu709 specification.
  Values are 0 to 255, indicating full or no signal in that plane respectively.

- #EVAS_COLORSPACE_YCBCR422P709_PL: Not implemented yet.

- #EVAS_COLORSPACE_RGB565_A5P: In the process of being implemented in 1 engine only. This may change.
  This is a pointer to image data for 16-bit half-word pixel data in 16bpp RGB 565 format (5 bits red, 6 bits green, 5 bits blue), with the high-byte containing red and the low byte containing blue, per pixel. This data is packed row by row from the top-left to the bottom right.
  If the image has an alpha channel enabled there will be an extra alpha plane after the color pixel plane. If not, then this data will not exist and should not be accessed in any way. This plane is a set of pixels with 1 byte per pixel defining the alpha values of all pixels in the image from the top-left to the bottom right of the image, row by row. Even though the values of the alpha pixels can be 0 to 255, only values 0 through to 32 are used, 32 being solid and 0 being transparent.
  RGB values can be 0 to 31 for red and blue and 0 to 63 for green, with 0 being black and 31 or 63 being full red, green or blue respectively. This colorspace is also pre-multiplied like EVAS_COLORSPACE_ARGB8888 so:
  R = (r * a) / 32; G = (g * a) / 32; B = (b * a) / 32;

- #EVAS_COLORSPACE_GRY8: The image is just a alpha mask (8 bit's per pixel). This is used for alpha masking.

Warning
  We don't guarantee any proper results if you create a Image object without setting the evas engine.

Some examples on this group of functions can be found here.

## Typedef Documentation

typedef void(* Evas_Object_Image_Pixels_Get_Cb) (void *data, Evas_Object *o)

Function signature for the evas object pixels get callback function.

See also
  evas_object_image_pixels_get()

By data it will be passed the private data. By o it will be passed the Evas_Object image on which the pixels are requested.

typedef Emile_Colorspace Evas_Colorspace

Colorspaces for pixel data supported by Evas.

Colorspaces for pixel data supported by Evas

## Function Documentation

Eina_Bool evas_object_image_extension_can_load_get | ( | const char * | file | ) |

Check if a file extension may be supported by Image Object Functions.

Parameters

  file | The file to check

Returns
  `EINA_TRUE` if we may be able to open it, `EINA_FALSE` if it's unlikely.

Since
  1.1

If file is a Eina_Stringshare, use directly evas_object_image_extension_can_load_fast_get.

This functions is threadsafe.

References eina_stringshare_add(), and eina_stringshare_del().

Eina_Bool evas_object_image_extension_can_load_fast_get | ( | const char * | file | ) |

Check if a file extension may be supported by Image Object Functions.

Parameters

  file | The file to check, it should be an Eina_Stringshare.

Returns
  `EINA_TRUE` if we may be able to open it, `EINA_FALSE` if it's unlikely.

Since
  1.1

This functions is threadsafe.

References EINA_UNUSED, EVAS_CALLBACK_CANVAS_FOCUS_IN, EVAS_CALLBACK_CANVAS_FOCUS_OUT, and evas_free().

Evas_Object* evas_object_image_add | ( | Evas * | e | ) |

Creates a new image object on the given Evas `e` canvas.

Parameters

  e | The given canvas.

Returns
  The created image object handle.

Note
  If you intend to display an image somehow in a GUI, besides binding it to a real image file/source (with evas_object_image_file_set(), for example), you'll have to tell this image object how to fill its space with the pixels it can get from the source. See evas_object_image_filled_add(), for a helper on the common case of scaling up an image source to the whole area of the image object.

See also
  evas_object_image_fill_set()

Example:

1 img = evas_object_image_add(canvas);
2 evas_object_image_file_set(img, "/path/to/img", NULL);

References eo_add, and eo_data_scope_get().

Referenced by ecore_evas_cursor_set(), ecore_evas_ews_new(), ecore_evas_object_image_new(), edje_edit_object_add(), edje_edit_part_name_set(), edje_file_data_get(), emotion_object_suspend_get(), ethumb_dup(), ethumb_file_free(), ethumb_new(), and evas_object_image_filled_add().

Evas_Object* evas_object_image_filled_add | ( | Evas * | e | ) |

Creates a new image object that automatically scales its bound image to the object's area, on both axis.

Parameters

  e | The given canvas.

Returns
  The created image object handle.

This is a helper function around evas_object_image_add() and evas_object_image_filled_set(). It has the same effect of applying those functions in sequence, which is a very common use case.

Note
  Whenever this object gets resized, the bound image will be rescaled, too.

See also
  evas_object_image_add()
  evas_object_image_filled_set()
  evas_object_image_fill_set()

Examples:
  ecore_evas_buffer_example_02.c, edje-basic.c, edje-signals-messages.c, ephysics_logo.c, evas-aspect-hints.c, evas-box.c, evas-events.c, evas-hints.c, evas-images.c, evas-images2.c, evas-map-utils.c, evas-object-manipulation.c, evas-smart-interface.c, evas-smart-object.c, and evas-text.c.

References evas_object_image_add().

Referenced by edje_file_data_get().

void evas_object_image_memfile_set | ( | Evas_Object * | obj,
|  | void * | data,
|  | int | size,
|  | char * | format,
|  | char * | key
| ) |  |

Sets the data for an image from memory to be loaded.

This is the same as evas_object_image_file_set() but the file to be loaded may exist at an address in memory (the data for the file, not the filename itself). The `data` at the address is copied and stored for future use, so no `data` needs to be kept after this call is made. It will be managed and freed for you when no longer needed. The `size` is limited to 2 gigabytes in size, and must be greater than 0. A `NULL` `data` pointer is also invalid. Set the filename to `NULL` to reset to empty state and have the image file data freed from memory using evas_object_image_file_set().

The `format` is optional (pass `NULL` if you don't need/use it). It is used to help Evas guess better which loader to use for the data. It may simply be the "extension" of the file as it would normally be on disk such as "jpg" or "png" or "gif" etc.

Parameters

  obj | The given image object.
  data | The image file data address
  size | The size of the image file data in bytes
  format | The format of the file (optional), or `NULL` if not needed
  key | The image key in file, or `NULL`.

References EINA_COW_WRITE_BEGIN, EINA_COW_WRITE_END, EINA_FALSE, eina_file_close(), eina_file_dup(), eina_file_filename_get(), eina_file_virtualize(), eina_stringshare_add(), eina_stringshare_del(), EINA_TRUE, EINA_UNUSED, eo_data_scope_get(), evas_object_image_file_set(), _Eina_Rectangle::h, _Eina_Rectangle::w, WRN, _Eina_Rectangle::x, and _Eina_Rectangle::y.

void evas_object_image_native_surface_set | ( | Evas_Object * | obj,
|  | Evas_Native_Surface * | surf
| ) |  |

Set the native surface of a given image of the canvas.

Parameters

  obj | The given canvas pointer.
  surf | The new native surface.

This function sets a native surface of a given canvas image.

References eo_data_scope_get(), EVAS_CALLBACK_DEL, EVAS_NATIVE_SURFACE_VERSION, evas_object_event_callback_add(), evas_object_event_callback_del_full(), and _Evas_Native_Surface::version.

Referenced by evas_object_image_pixels_import().

void evas_object_image_preload | ( | Evas_Object * | obj,
|  | Eina_Bool | cancel
| ) |  |

Preload an image object's image data in the background.

Parameters

  obj | The given image object.
  cancel | `EINA_FALSE` will add it the preloading work queue, `EINA_TRUE` will remove it (if it was issued before).

This function requests the preload of the data image in the background. The work is queued before being processed (because there might be other pending requests of this type).

Whenever the image data gets loaded, Evas will call EVAS_CALLBACK_IMAGE_PRELOADED registered callbacks on `obj` (what may be immediately, if the data was already preloaded before).

Use `EINA_TRUE` for `cancel` on scenarios where you don't need the image data preloaded anymore.

Note
  Any evas_object_show() call after evas_object_image_preload() will make the latter to be cancelled, with the loading process now taking place synchronously (and, thus, blocking the return of the former until the image is loaded). It is highly advisable, then, that the user preload an image with it being hidden, just to be shown on the EVAS_CALLBACK_IMAGE_PRELOADED event's callback.

Examples:
  evas-images2.c.

References EINA_FALSE, eina_list_append(), eina_list_count(), EINA_LIST_FREE, eina_rectangle_free(), EINA_TRUE, eo_data_scope_get(), _Eina_Rectangle::h, _Eina_Rectangle::w, _Eina_Rectangle::x, and _Eina_Rectangle::y.

Referenced by edje_evas_global_perspective_get().

Eina_Bool evas_object_image_source_unset | ( | Evas_Object * | obj | ) |

Clear the source object on a proxy image object.

Parameters

  obj | Image object to clear source of.

Returns
  `EINA_TRUE` on success, `EINA_FALSE` on error.

This is equivalent to calling evas_object_image_source_set() with a `NULL` source.

References EINA_COW_WRITE_BEGIN, EINA_COW_WRITE_END, EINA_FALSE, eina_file_filename_get(), EINA_TRUE, EINA_VALUE_TYPE_STRING, EINA_VALUE_TYPE_UINT64, eo_data_scope_get(), EO_DBG_INFO_APPEND, EO_DBG_INFO_LIST_APPEND(), EVAS_CALLBACK_RESIZE, evas_load_error_str(), evas_object_event_callback_add(), evas_object_event_callback_del(), evas_object_geometry_get(), and evas_object_image_fill_set().

Referenced by evas_object_del().

void evas_object_image_alpha_mask_set | ( | Evas_Object * | obj,
|  | Eina_Bool | ismask
| ) |  |

Enable an image to be used as an alpha mask.

This will set any flags, and discard any excess image data not used as an alpha mask.

Note there is little point in using a image as alpha mask unless it has an alpha channel.

Parameters

  obj | Object to use as an alpha mask.
  ismask | Use image as alphamask, must be true.

References eina_cow_free(), eina_cow_memcpy(), EINA_COW_WRITE_BEGIN, EINA_COW_WRITE_END, EINA_FALSE, eina_file_close(), EINA_INLIST_FOREACH, eina_list_append(), eina_list_count(), eina_list_data_find(), EINA_LIST_FREE, eina_list_remove(), eina_rectangle_free(), eina_stringshare_del(), EINA_TRUE, eo_data_ref, eo_data_scope_get(), eo_isa(), eo_ref(), eo_unref(), ERR, EVAS_BORDER_FILL_NONE, EVAS_BORDER_FILL_SOLID, evas_canvas3d_object_dirty_get(), evas_canvas3d_object_update(), evas_image_cache_flush(), evas_map_free(), EVAS_NATIVE_SURFACE_EVASGL, EVAS_NATIVE_SURFACE_X11, evas_object_geometry_get(), evas_object_image_animated_get(), evas_object_image_file_set(), evas_object_image_fill_set(), EVAS_RENDER_COPY, _Eina_Rectangle::h, _Evas_Native_Surface::type, _Eina_Rectangle::w, WRN, _Eina_Rectangle::x, and _Eina_Rectangle::y.

void evas_object_image_file_set | ( | Eo * | obj,
|  | const char * | file,
|  | const char * | key
| ) |  |

Set the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones).

If the file supports multiple data stored in it (as Eet files do), you can specify the key to be used as the index of the image in this file.

Example:

1 img = evas_object_image_add(canvas);
2 evas_object_image_file_set(img, "/path/to/img", NULL);
3 err = evas_object_image_load_error_get(img);
4 if (err != EVAS_LOAD_ERROR_NONE)
5 {
6 fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n",
7 valid_path, evas_load_error_str(err));
8 }
9 else
10 {
11 evas_object_image_fill_set(img, 0, 0, w, h);
12 evas_object_resize(img, w, h);
13 evas_object_show(img);
14 }

Parameters

  [in] | file | The image file path.
  [in] | key | The image key in `file` (if its an Eet one), or `NULL`, otherwise.

Examples:
  ecore_evas_buffer_example_02.c, edje-basic.c, edje-signals-messages.c, ephysics_logo.c, evas-aspect-hints.c, evas-box.c, evas-events.c, evas-hints.c, evas-images.c, evas-images2.c, evas-map-utils.c, evas-object-manipulation.c, evas-smart-interface.c, evas-smart-object.c, and evas-text.c.

Referenced by ecore_evas_cursor_set(), edje_edit_object_add(), ethumb_file_free(), evas_object_image_alpha_mask_set(), and evas_object_image_memfile_set().

void evas_object_image_file_get | ( | const Eo * | obj,
|  | const char ** | file,
|  | const char ** | key
| ) |  |

Retrieve the source file from where an image object is to fetch the real image data (it may be an Eet file, besides pure image ones).

You must not modify the strings on the returned pointers.

Note
  Use `NULL` pointers on the file components you're not interested in: they'll be ignored by the function.

Parameters

  [out] | file | The image file path.
  [out] | key | The image key in `file` (if its an Eet one), or `NULL`, otherwise.

Referenced by edje_evas_global_perspective_get(), and ethumb_file_free().

void evas_object_image_mmap_set | ( | Eo * | obj,
|  | const Eina_File * | f,
|  | const char * | key
| ) |  |

Set the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File).

If the file supports multiple data stored in it (as Eet files do), you can specify the key to be used as the index of the image in this file.

Since
  1.8

Parameters

  [in] | f | The mmaped file
  [in] | key | The image key in `file` (if its an Eet one), or `NULL`, otherwise.

void evas_object_image_mmap_get | ( | const Eo * | obj,
|  | const Eina_File ** | f,
|  | const char ** | key
| ) |  |

Get the source mmaped file from where an image object must fetch the real image data (it must be an Eina_File).

If the file supports multiple data stored in it (as Eet files do), you can get the key to be used as the index of the image in this file.

Since
  1.10

Parameters

  [out] | f | The mmaped file
  [out] | key | The image key in `file` (if its an Eet one), or `NULL`, otherwise.

Eina_Bool evas_object_image_save | ( | const Eo * | obj,
|  | const char * | file,
|  | const char * | key,
|  | const char * | flags
| ) |  |

Save the given image object's contents to an (image) file.

Proxy object is image object, but it doesn't have contents. So you can't use this function for proxy objects.

The extension suffix on `file` will determine which saver module Evas is to use when saving, thus the final file's format. If the file supports multiple data stored in it (Eet ones), you can specify the key to be used as the index of the image in it.

You can specify some flags when saving the image. Currently acceptable flags are `quality` and `compress`. Eg.: `"quality=100 compress=9"`

quality is hint for the quality of image,0-100. 0 means low quality and saved image size is small. 100 means high quality and saved image size is big.

compress is hint for the compression modes (Eet ones) or for the compression flags (Png one) (1 == compress, 0 = don't compress).

Parameters

  [in] | file | The filename to be used to save the image (extension obligatory).
  [in] | key | The image key in the file (if an Eet one), or `NULL`, otherwise.
  [in] | flags | String containing the flags to be used (`NULL` for none).

Examples:
  evas-images2.c.

Referenced by ethumb_file_free().

Eina_Bool evas_object_image_animated_get | ( | const Eo * | obj | ) |

Check if an image object can be animated (have multiple frames)

Returns
  whether obj support animation

This returns if the image file of an image object is capable of animation such as an animated gif file might. This is only useful to be called once the image object file has been set.

Example:

1 extern Evas_Object *obj;
2
3 if (evas_object_image_animated_get(obj))
4 {
5 int frame_count;
6 int loop_count;
7 Evas_Image_Animated_Loop_Hint loop_type;
8 double duration;
9
10 frame_count = evas_object_image_animated_frame_count_get(obj);
11 printf("This image has %d frames\n",frame_count);
12
13 duration = evas_object_image_animated_frame_duration_get(obj,1,0);
14 printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n");
15
16 loop_count = evas_object_image_animated_loop_count_get(obj);
17 printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count);
18
19 loop_type = evas_object_image_animated_loop_type_get(obj);
20 if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP)
21 printf("You had better set frame like 1->2->3->1->2->3...\n");
22 else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG)
23 printf("You had better set frame like 1->2->3->2->1->2...\n");
24 else
25 printf("Unknown loop type\n");
26
27 evas_object_image_animated_frame_set(obj,1);
28 printf("You set image object's frame to 1. You can see frame 1\n");
29 }

See also
  evas_object_image_animated_get()
  evas_object_image_animated_frame_count_get()
  evas_object_image_animated_loop_type_get()
  evas_object_image_animated_loop_count_get()
  evas_object_image_animated_frame_duration_get()
  evas_object_image_animated_frame_set()

Since
  1.1

Referenced by evas_object_image_alpha_mask_set().

void evas_object_image_load_size_set | ( | Eo * | obj,
|  | int | w,
|  | int | h
| ) |  |

Set the load size of a given image object's source image.

This function sets a new geometry size for the given canvas image. The image will be loaded into memory as if it was the set size instead of the original size.

Note
  The size of a given image object's source image will be less than or equal to the size of `w` and `h`.

See also
  evas_object_image_load_size_get()

Parameters

  [in] | w | The new width of the image's load size.
  [in] | h | The new height of the image's load size.

Referenced by ethumb_file_free().

void evas_object_image_load_size_get | ( | const Eo * | obj,
|  | int * | w,
|  | int * | h
| ) |  |

Get the load size of a given image object's source image.

This function gets the geometry size set manually for the given canvas image.

Note
  Use `NULL` pointers on the size components you're not interested in: they'll be ignored by the function.
  `w` and `h` will be set with the image's loading size only if the image's load size is set manually: if evas_object_image_load_size_set() has not been called, `w` and `h` will be set with 0.

See also
  evas_object_image_load_size_set() for more details

Parameters

  [out] | w | The new width of the image's load size.
  [out] | h | The new height of the image's load size.

Referenced by ethumb_file_free().

void evas_object_image_smooth_scale_set | ( | Eo * | obj,
|  | Eina_Bool | smooth_scale
| ) |  |

Sets whether to use high-quality image scaling algorithm on the given image object.

When enabled, a higher quality image scaling algorithm is used when scaling images to sizes other than the source image's original one. This gives better results but is more computationally expensive.

Note
  Image objects get created originally with smooth scaling on.

See also
  evas_object_image_smooth_scale_get()

Parameters

  [in] | smooth_scale | Whether to use smooth scale or not.

Examples:
  evas-images.c.

Referenced by emotion_object_smooth_scale_set().

Eina_Bool evas_object_image_smooth_scale_get | ( | const Eo * | obj | ) |

Retrieves whether the given image object is using high-quality image scaling algorithm.

Returns
  Whether smooth scale is being used.

See evas_object_image_smooth_scale_set() for more details.

Examples:
  evas-images.c.

Referenced by emotion_object_smooth_scale_get().

void evas_object_image_fill_spread_set | ( | Evas_Object * | obj,
|  | Evas_Fill_Spread | spread
| ) |  |

Sets the tiling mode for the given evas image object's fill.

EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD.

Parameters

  [in] | spread | One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT,

References EINA_TRUE, and eo_data_scope_get().

Evas_Fill_Spread evas_object_image_fill_spread_get | ( | const Evas_Object * | obj | ) |

Retrieves the spread (tiling mode) for the given image object's fill.

Returns
  The current spread mode of the image object.

void evas_object_image_fill_set | ( | Evas_Object * | obj,
|  | Evas_Coord | x,
|  | Evas_Coord | y,
|  | Evas_Coord | w,
|  | Evas_Coord | h
| ) |  |

Set how to fill an image object's drawing rectangle given the (real) image bound to it.

Note that if `w` or `h` are smaller than the dimensions of `obj`, the displayed image will be tiled around the object's area. To have only one copy of the bound image drawn, `x` and `y` must be 0 and `w` and `h` need to be the exact width and height of the image object itself, respectively.

See the following image to better understand the effects of this call. On this diagram, both image object and original image source have `a` x `a` dimensions and the image itself is a circle, with empty space around it:

Warning
  The default values for the fill parameters are `x` = 0, `y` = 0, `w` = 0 and `h` = 0. Thus, if you're not using the evas_object_image_filled_add() helper and want your image displayed, you'll have to set valid values with this function on your object.

Note
  evas_object_image_filled_set() is a helper function which will override the values set here automatically, for you, in a given way.

Parameters

  [in] | x | The x coordinate (from the top left corner of the bound image) to start drawing from.
  [in] | y | The y coordinate (from the top left corner of the bound image) to start drawing from.
  [in] | w | The width the bound image will be displayed at.
  [in] | h | The height the bound image will be displayed at.

Examples:
  evas-images.c.

References EINA_TRUE, and eo_data_scope_get().

Referenced by ecore_evas_cursor_set(), ecore_evas_ews_new(), emotion_object_suspend_get(), ethumb_file_free(), evas_object_image_alpha_mask_set(), and evas_object_image_source_unset().

void evas_object_image_fill_get | ( | const Evas_Object * | obj,
|  | Evas_Coord * | x,
|  | Evas_Coord * | y,
|  | Evas_Coord * | w,
|  | Evas_Coord * | h
| ) |  |

Retrieve how an image object is to fill its drawing rectangle, given the (real) image bound to it.

Note
  Use `NULL` pointers on the fill components you're not interested in: they'll be ignored by the function.

See evas_object_image_fill_set() for more details.

Parameters

  [out] | x | The x coordinate (from the top left corner of the bound image) to start drawing from.
  [out] | y | The y coordinate (from the top left corner of the bound image) to start drawing from.
  [out] | w | The width the bound image will be displayed at.
  [out] | h | The height the bound image will be displayed at.

Examples:
  evas-images.c.

void evas_object_image_size_set | ( | Evas_Object * | obj,
|  | int | w,
|  | int | h
| ) |  |

Sets the size of the given image object.

This function will scale down or crop the image so that it is treated as if it were at the given size. If the size given is smaller than the image, it will be cropped. If the size given is larger, then the image will be treated as if it were in the upper left hand corner of a larger image that is otherwise transparent.

Parameters

  [in] | w | The new width of the image.
  [in] | h | The new height of the image.

Examples:
  ecore_evas_buffer_example_02.c, and evas-images2.c.

References EINA_COW_WRITE_BEGIN, EINA_COW_WRITE_END, EINA_TRUE, and eo_data_scope_get().

Referenced by ecore_evas_ews_new(), ecore_evas_object_image_new(), emotion_object_file_set(), emotion_object_suspend_get(), and ethumb_file_free().

void evas_object_image_size_get | ( | const Evas_Object * | obj,
|  | int * | w,
|  | int * | h
| ) |  |

Retrieves the size of the given image object.

See evas_object_image_size_set() for more details.

Parameters

  [out] | w | The new width of the image.
  [out] | h | The new height of the image.

Examples:
  ephysics_logo.c, and evas-map-utils.c.

References eo_data_scope_get().

Referenced by ecore_evas_cursor_set(), edje_edit_object_add(), edje_evas_global_perspective_get(), emotion_object_suspend_get(), and ethumb_file_free().

void* evas_object_image_data_convert | ( | Evas_Object * | obj,
|  | Evas_Colorspace | to_cspace
| ) |  |

Deprecated:
  evas_object_image_data_convert

References EINA_FALSE, EINA_TRUE, eo_class_name_get(), eo_data_scope_get(), and eo_isa().

Eina_Bool evas_object_image_pixels_import | ( | Evas_Object * | obj,
|  | Evas_Pixel_Import_Source * | pixels
| ) |  |

Deprecated:
  evas_object_image_pixels_import

References EINA_FALSE, eina_list_append(), eina_list_remove(), EINA_TRUE, EINA_UNUSED, eo_class_name_get(), eo_data_scope_get(), eo_isa(), evas_object_image_native_surface_set(), EVAS_PIXEL_FORMAT_ARGB32, EVAS_PIXEL_FORMAT_YUV420P_601, EVAS_VIDEO_SURFACE_VERSION, _Evas_Pixel_Import_Source::format, _Evas_Pixel_Import_Source::h, _Evas_Video_Surface::hide, _Evas_Video_Surface::move, _Evas_Video_Surface::resize, _Evas_Pixel_Import_Source::rows, _Evas_Video_Surface::show, _Evas_Video_Surface::update_pixels, and _Evas_Video_Surface::version.

void evas_object_image_reload | ( | Evas_Object * | obj | ) |

Deprecated:
  evas_object_image_reload

References alloca(), DBG, EINA_COW_WRITE_BEGIN, EINA_COW_WRITE_END, EINA_FALSE, EINA_TRUE, eo_class_name_get(), eo_data_scope_get(), eo_isa(), and WRN.