Tizen Native API
|
Functions | |
Evas_Object * | evas_object_image_add (Evas *e) |
Creates a new image object on the given Evas e canvas. | |
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. | |
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. | |
void | evas_object_image_file_set (Evas_Object *obj, const char *file, const char *key) |
Sets the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones). | |
void | evas_object_image_file_get (const Evas_Object *obj, const char **file, const char **key) |
Gets 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). | |
void | evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b) |
Sets the dimensions for an image object's border, a region which is not scaled together with its center ever. | |
void | evas_object_image_border_get (const Evas_Object *obj, int *l, int *r, int *t, int *b) |
Gets the dimensions for an image object's border, a region which is not scaled together with its center ever. | |
void | evas_object_image_border_center_fill_set (Evas_Object *obj, Evas_Border_Fill_Mode fill) |
Sets how the center part of the given image object (not the borders) should be drawn when Evas is rendering it. | |
Evas_Border_Fill_Mode | evas_object_image_border_center_fill_get (const Evas_Object *obj) |
Gets how the center part of the given image object (not the borders) is to be drawn when Evas is rendering it. | |
void | evas_object_image_filled_set (Evas_Object *obj, Eina_Bool setting) |
Sets whether the image object's fill property should track the object's size. | |
Eina_Bool | evas_object_image_filled_get (const Evas_Object *obj) |
Checks whether the image object's fill property should track the object's size. | |
void | evas_object_image_border_scale_set (Evas_Object *obj, double scale) |
Sets the scaling factor (multiplier) for the borders of an image object. | |
double | evas_object_image_border_scale_get (const Evas_Object *obj) |
Gets the scaling factor (multiplier) for the borders of an image object. | |
void | evas_object_image_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) |
Sets how to fill an image object's drawing rectangle given the (real) image bound to it. | |
void | evas_object_image_fill_get (const Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) |
Sets how an image object is to fill its drawing rectangle, given the (real) image bound to it. | |
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_Fill_Spread | evas_object_image_fill_spread_get (const Evas_Object *obj) |
Gets the spread (tiling mode) for the given image object's fill. | |
void | evas_object_image_size_set (Evas_Object *obj, int w, int h) |
Sets the size of the given image object. | |
void | evas_object_image_size_get (const Evas_Object *obj, int *w, int *h) |
Gets the size of the given image object. | |
int | evas_object_image_stride_get (const Evas_Object *obj) |
Gets the row stride of the given image object. | |
Evas_Load_Error | evas_object_image_load_error_get (const Evas_Object *obj) |
Gets a number representing any error that occurred during the last loading of the given image object's source image. | |
void | evas_object_image_data_set (Evas_Object *obj, void *data) |
Sets the raw image data of the given image object. | |
void * | evas_object_image_data_get (const Evas_Object *obj, Eina_Bool for_writing) |
Gets a pointer to the raw image data of the given image object. | |
void * | evas_object_image_data_convert (Evas_Object *obj, Evas_Colorspace to_cspace) |
Converts the raw image data of the given image object to the specified colorspace. | |
void | evas_object_image_data_copy_set (Evas_Object *obj, void *data) |
Replaces the raw image data of the given image object. | |
void | evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h) |
Marks a sub-region of the given image object to be redrawn. | |
void | evas_object_image_alpha_set (Evas_Object *obj, Eina_Bool has_alpha) |
Enables or disables alpha channel usage on the given image object. | |
Eina_Bool | evas_object_image_alpha_get (const Evas_Object *obj) |
Checks whether alpha channel data is being used on the given image object. | |
void | evas_object_image_smooth_scale_set (Evas_Object *obj, Eina_Bool smooth_scale) |
Sets whether to use high-quality image scaling algorithm on the given image object. | |
Eina_Bool | evas_object_image_smooth_scale_get (const Evas_Object *obj) |
Checks whether the given image object is using high-quality image scaling algorithm. | |
void | evas_object_image_preload (Evas_Object *obj, Eina_Bool cancel) |
Preloads an image object's image data in the background. | |
void | evas_object_image_reload (Evas_Object *obj) |
Reloads an image object's image data. | |
Eina_Bool | evas_object_image_save (const Evas_Object *obj, const char *file, const char *key, const char *flags) |
Saves the given image object's contents to an (image) file. | |
Eina_Bool | evas_object_image_pixels_import (Evas_Object *obj, Evas_Pixel_Import_Source *pixels) |
Imports pixels from given source to a given canvas image object. | |
void | evas_object_image_pixels_get_callback_set (Evas_Object *obj, Evas_Object_Image_Pixels_Get_Cb func, void *data) |
Sets the callback function to get pixels from a canvas' image. | |
void | evas_object_image_pixels_dirty_set (Evas_Object *obj, Eina_Bool dirty) |
Sets whether the given image object is dirty and needs to request its pixels. | |
Eina_Bool | evas_object_image_pixels_dirty_get (const Evas_Object *obj) |
Checks whether the given image object is dirty (needs to be redrawn). | |
void | evas_object_image_load_dpi_set (Evas_Object *obj, double dpi) |
Sets the DPI resolution of an image object's source image. | |
double | evas_object_image_load_dpi_get (const Evas_Object *obj) |
Gets the DPI resolution of a loaded image object in the canvas. | |
void | evas_object_image_load_size_set (Evas_Object *obj, int w, int h) |
Sets the load size of a given image object's source image. | |
void | evas_object_image_load_size_get (const Evas_Object *obj, int *w, int *h) |
Gets the load size of a given image object's source image. | |
void | evas_object_image_load_scale_down_set (Evas_Object *obj, int scale_down) |
Sets the scale down factor of a given image object's source image, when loading it. | |
int | evas_object_image_load_scale_down_get (const Evas_Object *obj) |
Gets the scale down factor of a given image object's source image, when loading it. | |
void | evas_object_image_load_region_set (Evas_Object *obj, int x, int y, int w, int h) |
Sets a selective region of the source image to load for the given image object. | |
void | evas_object_image_load_region_get (const Evas_Object *obj, int *x, int *y, int *w, int *h) |
Gets the coordinates of a given image object's selective (source image) load region. | |
void | evas_object_image_load_orientation_set (Evas_Object *obj, Eina_Bool enable) |
Sets whether the orientation information in the image file should be honored. | |
Eina_Bool | evas_object_image_load_orientation_get (const Evas_Object *obj) |
Checks whether the orientation information in the image file should be honored. | |
void | evas_object_image_colorspace_set (Evas_Object *obj, Evas_Colorspace cspace) |
Sets the colorspace of a given image of the canvas. | |
Evas_Colorspace | evas_object_image_colorspace_get (const Evas_Object *obj) |
Gets the colorspace of a given image of the canvas. | |
Eina_Bool | evas_object_image_region_support_get (const Evas_Object *obj) |
Gets the support state of a given image. | |
void | evas_object_image_native_surface_set (Evas_Object *obj, Evas_Native_Surface *surf) |
Sets the native surface of a given image of the canvas. | |
Evas_Native_Surface * | evas_object_image_native_surface_get (const Evas_Object *obj) |
Gets the native surface of a given image of the canvas. | |
void | evas_object_image_video_surface_set (Evas_Object *obj, Evas_Video_Surface *surf) |
Sets the video surface linked to a given image of the canvas. | |
const Evas_Video_Surface * | evas_object_image_video_surface_get (const Evas_Object *obj) |
Gets the video surface linked to a given image of the canvas. | |
void | evas_object_image_scale_hint_set (Evas_Object *obj, Evas_Image_Scale_Hint hint) |
Sets the scale hint of a given image of the canvas. | |
Evas_Image_Scale_Hint | evas_object_image_scale_hint_get (const Evas_Object *obj) |
Gets the scale hint of a given image of the canvas. | |
void | evas_object_image_content_hint_set (Evas_Object *obj, Evas_Image_Content_Hint hint) |
Sets the content hint setting of a given image object of the canvas. | |
Evas_Image_Content_Hint | evas_object_image_content_hint_get (const Evas_Object *obj) |
Gets the content hint setting of a given image object of the canvas. | |
void | evas_object_image_alpha_mask_set (Evas_Object *obj, Eina_Bool ismask) |
Enables an image to be used as an alpha mask. | |
Eina_Bool | evas_object_image_source_set (Evas_Object *obj, Evas_Object *src) |
Sets the source object on an image object to used as a proxy. | |
Evas_Object * | evas_object_image_source_get (const Evas_Object *obj) |
Gets the current source object of an image object. | |
Eina_Bool | evas_object_image_source_unset (Evas_Object *obj) |
Clears the source object on a proxy image object. | |
void | evas_object_image_source_visible_set (Evas_Object *obj, Eina_Bool visible) |
Sets the source object to be visible. | |
Eina_Bool | evas_object_image_source_visible_get (const Evas_Object *obj) |
Gets the state of the source object visibility. | |
void | evas_object_image_source_clip_set (Evas_Object *obj, Eina_Bool source_clip) |
Clips the proxy object with the source object's clipper. | |
Eina_Bool | evas_object_image_source_clip_get (const Evas_Object *obj) |
Checks whether an object is clipped by source object's clipper. | |
Eina_Bool | evas_object_image_extension_can_load_get (const char *file) |
Checks whether a file extension is supported by Image Object Functions. | |
Eina_Bool | evas_object_image_extension_can_load_fast_get (const char *file) |
Checks whether a file extension is supported by Image Object Functions. | |
Eina_Bool | evas_object_image_animated_get (const Evas_Object *obj) |
Checks whether an image object can be animated (have multiple frames). | |
int | evas_object_image_animated_frame_count_get (const Evas_Object *obj) |
Gets the total number of frames of the image object. | |
Evas_Image_Animated_Loop_Hint | evas_object_image_animated_loop_type_get (const Evas_Object *obj) |
Gets the kind of looping the image object does. | |
int | evas_object_image_animated_loop_count_get (const Evas_Object *obj) |
Gets the number of times the animation of the object loops. | |
double | evas_object_image_animated_frame_duration_get (const Evas_Object *obj, int start_frame, int fram_num) |
Gets the duration of a sequence of frames. | |
void | evas_object_image_animated_frame_set (Evas_Object *obj, int frame_num) |
Sets the frame to the current frame of an image object. | |
Typedefs | |
typedef enum _Evas_Colorspace | Evas_Colorspace |
Enumeration for pixel data of colorspaces supported by Evas. | |
typedef void(* | Evas_Object_Image_Pixels_Get_Cb )(void *data, Evas_Object *o) |
Callback of Evas Object Image Pixels. |
This group provides functions for image objects.
The functions used to create and manipulate image objects are grouped together. 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 supports whichever image file types it is compiled with support to (its image loaders) -- check your software packager for that information and see evas_object_image_extension_can_load_get().
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 a 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 the 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 is also a function helper, to be used instead of evas_object_image_fill_set():
See those functions' documentation for more details.
Resizing of image objects scales their respective source images to their areas, if they are set to "fill" the object's area (evas_object_image_filled_set()). If you want any control on the aspect ratio of an image for different sizes, you have to take care of that yourself. There are functions to make images to get loaded scaled (up or down) in memory, already, if you are going to use them at pre-determined sizes and want to save computations.
Evas has even a scale cache, which takes care of caching scaled versions of images with most usage/hits. Finally, you can have images being rescaled smoothly by Evas (more computationally expensive) or not.
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.
In image viewer applications, for example, the user is looking at a given image, at full size, and desires 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 are loading images which are too big, consider setting its loading size to something smaller, in case you do not 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 is //the size you are displaying anyway evas_object_image_load_scale_down_set(img, zoom); //optional: if you know you are going to show 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.
If you want to animate image objects on a UI (what you would 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 would better turn off smooth scaling on it during the animation, turning it back on afterwards, for less computations. Also, in this case you would 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.
Evas provides facilities for one to specify an image's region to be treated specially -- as "borders". This makes those regions to 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:
Evas image objects can be used to manipulate raw pixels in many ways. The meaning of the data in the pixel arrays depends 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 or altering, convert images between different color spaces and even advanced operations like setting a native surface as image objects' data.
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:
0
to 255
, indicating full or no signal in that plane respectively.0
to 255
, only values 0
through to 32
are used, 32
being solid and 0 being transparent. 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: typedef enum _Evas_Colorspace Evas_Colorspace |
Enumeration for pixel data of colorspaces supported by Evas.
Colorspaces for pixel data supported by Evas
typedef void(* Evas_Object_Image_Pixels_Get_Cb)(void *data, Evas_Object *o) |
Callback of Evas Object Image Pixels.
enum _Evas_Colorspace |
Enumeration for pixel data of colorspaces supported by Evas.
Evas_Object* evas_object_image_add | ( | Evas * | e | ) |
Creates a new image object on the given Evas e canvas.
img = evas_object_image_add(canvas); evas_object_image_file_set(img, "/path/to/img", NULL);
[in] | e | The given canvas |
Eina_Bool evas_object_image_alpha_get | ( | const Evas_Object * | obj | ) |
Checks whether alpha channel data is being used on the given image object.
This function returns EINA_TRUE if the image object's alpha channel is being used, or EINA_FALSE otherwise.
[in] | obj | The given image object |
void evas_object_image_alpha_mask_set | ( | Evas_Object * | obj, |
Eina_Bool | ismask | ||
) |
Enables an image to be used as an alpha mask.
This function sets flags, and discard any excess image data not used as an alpha mask.
[in] | obj | The object to use as an alpha mask |
[in] | ismask | Set EINA_TRUE to use image as alphamask, otherwise EINA_FALSE to not use image as alphamask |
void evas_object_image_alpha_set | ( | Evas_Object * | obj, |
Eina_Bool | has_alpha | ||
) |
Enables or disables alpha channel usage on the given image object.
This function sets a flag on an image object indicating whether or not to use alpha channel data. A value of EINA_TRUE makes it use alpha channel data, and EINA_FALSE makes it ignore that data. Note that this has nothing to do with an object's color as manipulated by evas_object_color_set().
[in] | obj | The given image object |
[in] | has_alpha | Set EINA_TRUE to use alpha channel () data, otherwise set EINA_FALSE to not use it |
int evas_object_image_animated_frame_count_get | ( | const Evas_Object * | obj | ) |
Gets the total number of frames of the image object.
This returns the total number of frames the image object supports (if animated).
[in] | obj | The Image object |
double evas_object_image_animated_frame_duration_get | ( | const Evas_Object * | obj, |
int | start_frame, | ||
int | fram_num | ||
) |
Gets the duration of a sequence of frames.
This function returns the total duration that the specified sequence of frames should take in seconds.
[in] | obj | The Image object |
[in] | start_frame | The first frame |
[in] | fram_num | The number of frames in the sequence |
void evas_object_image_animated_frame_set | ( | Evas_Object * | obj, |
int | frame_num | ||
) |
Sets the frame to the current frame of an image object.
This function sets the image object's current frame to frame_num with 1 being the first frame.
[in] | obj | The given image object |
[in] | frame_num | The index of current frame |
Eina_Bool evas_object_image_animated_get | ( | const Evas_Object * | obj | ) |
Checks whether an image object can be animated (have multiple frames).
This function 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.
extern Evas_Object *obj; if (evas_object_image_animated_get(obj)) { int frame_count; int loop_count; Evas_Image_Animated_Loop_Hint loop_type; double duration; frame_count = evas_object_image_animated_frame_count_get(obj); printf("This image has %d frames\n",frame_count); duration = evas_object_image_animated_frame_duration_get(obj,1,0); printf("Frame 1's duration is %f. You had better set object's frame to 2 after this duration using timer\n"); loop_count = evas_object_image_animated_loop_count_get(obj); printf("loop count is %d. You had better run loop %d times\n",loop_count,loop_count); loop_type = evas_object_image_animated_loop_type_get(obj); if (loop_type == EVAS_IMAGE_ANIMATED_HINT_LOOP) printf("You had better set frame like 1->2->3->1->2->3...\n"); else if (loop_type == EVAS_IMAGE_ANIMATED_HINT_PINGPONG) printf("You had better set frame like 1->2->3->2->1->2...\n"); else printf("Unknown loop type\n"); evas_object_image_animated_frame_set(obj,1); printf("You set image object's frame to 1. You can see frame 1\n"); }
[in] | obj | The Image object |
int evas_object_image_animated_loop_count_get | ( | const Evas_Object * | obj | ) |
Gets the number of times the animation of the object loops.
This function returns loop count of image. The loop count is the number of times the animation plays fully from first to last frame until the animation should stop (at the final frame).
0
is returned, then looping should happen indefinitely (no limit to the number of times it loops).[in] | obj | The Image object |
Gets the kind of looping the image object does.
This function returns the kind of looping the image object wants to do.
EVAS_IMAGE_ANIMATED_HINT_LOOP
, you should display frames in a sequence like: 1->2->3->1->2->3->1... If it returns EVAS_IMAGE_ANIMATED_HINT_PINGPONG
, it is better to display frames in a sequence like: 1->2->3->2->1->2->3->1... The default type is EVAS_IMAGE_ANIMATED_HINT_LOOP.[in] | obj | The Image object |
Gets how the center part of the given image object (not the borders) is to be drawn when Evas is rendering it.
[in] | obj | The given image object |
void evas_object_image_border_center_fill_set | ( | Evas_Object * | obj, |
Evas_Border_Fill_Mode | fill | ||
) |
Sets how the center part of the given image object (not the borders) should be drawn when Evas is rendering it.
This function sets how the center part of the image object's source image is to be drawn, which must be one of the values in Evas_Border_Fill_Mode. By center we mean the complementary part of that defined by evas_object_image_border_set(). This one is very useful for making frames and decorations. You would most probably also be using a filled image (as in evas_object_image_filled_set()) to use as a frame.
[in] | obj | The given image object |
[in] | fill | The fill mode of the center region of obj (a value in Evas_Border_Fill_Mode) |
void evas_object_image_border_get | ( | const Evas_Object * | obj, |
int * | l, | ||
int * | r, | ||
int * | t, | ||
int * | b | ||
) |
Gets the dimensions for an image object's border, a region which is not scaled together with its center ever.
NULL
pointers on the border components that you are not interested in: they are ignored by the function.[in] | obj | The given image object |
[out] | l | The location to store the border's left width in |
[out] | r | The location to store the border's right width in |
[out] | t | The location to store the border's top width in |
[out] | b | The location to store the border's bottom width in |
double evas_object_image_border_scale_get | ( | const Evas_Object * | obj | ) |
Gets the scaling factor (multiplier) for the borders of an image object.
[in] | obj | The given image object |
void evas_object_image_border_scale_set | ( | Evas_Object * | obj, |
double | scale | ||
) |
Sets the scaling factor (multiplier) for the borders of an image object.
[in] | obj | The given image object |
[in] | scale | The scale factor (default is 1.0 - i.e. no scaling) |
void evas_object_image_border_set | ( | Evas_Object * | obj, |
int | l, | ||
int | r, | ||
int | t, | ||
int | b | ||
) |
Sets the dimensions for an image object's border, a region which is not scaled together with its center ever.
l
, r
, t
and b
start as 0
.[in] | obj | The given image object |
[in] | l | The border's left width |
[in] | r | The border's right width |
[in] | t | The border's top width |
[in] | b | The border's bottom width |
Evas_Colorspace evas_object_image_colorspace_get | ( | const Evas_Object * | obj | ) |
Gets the colorspace of a given image of the canvas.
This function returns the colorspace of given canvas image.
[in] | obj | The given image object pointer |
void evas_object_image_colorspace_set | ( | Evas_Object * | obj, |
Evas_Colorspace | cspace | ||
) |
Sets the colorspace of a given image of the canvas.
This function sets the colorspace of given canvas image.
[in] | obj | The given image object pointer |
[in] | cspace | The new color space |
Evas_Image_Content_Hint evas_object_image_content_hint_get | ( | const Evas_Object * | obj | ) |
Gets the content hint setting of a given image object of the canvas.
This function returns the content hint value of the given image of the canvas.
[in] | obj | The given canvas pointer |
void evas_object_image_content_hint_set | ( | Evas_Object * | obj, |
Evas_Image_Content_Hint | hint | ||
) |
Sets the content hint setting of a given image object of the canvas.
This function sets the content hint value of the given image of the canvas. For example, if you are on the GL engine and your driver implementation supports it, setting this hint to EVAS_IMAGE_CONTENT_HINT_DYNAMIC makes it need zero copies at texture upload time, which is an "expensive" operation.
[in] | obj | The given canvas pointer |
[in] | hint | The content hint value Valid values are defined in Evas_Image_Content_Hint. |
void* evas_object_image_data_convert | ( | Evas_Object * | obj, |
Evas_Colorspace | to_cspace | ||
) |
Converts the raw image data of the given image object to the specified colorspace.
NULL
is returned. You should use evas_object_image_colorspace_get() to check the current image colorspace.[in] | obj | The given image object |
[in] | to_cspace | The colorspace to which the image raw data is converted |
void evas_object_image_data_copy_set | ( | Evas_Object * | obj, |
void * | data | ||
) |
Replaces the raw image data of the given image object.
This function lets the application replace an image object's internal pixel buffer with an user-allocated one. For best results, you should generally first call evas_object_image_size_set() with the width and height for the new buffer.
[in] | obj | The given image object |
[in] | data | The raw data to replace |
void* evas_object_image_data_get | ( | const Evas_Object * | obj, |
Eina_Bool | for_writing | ||
) |
Gets a pointer to the raw image data of the given image object.
This function returns a pointer to an image object's internal pixel buffer, for reading only or read/write. If you request it for writing, the image is marked as dirty so that it gets redrawn at the next update.
[in] | obj | The given image object |
[in] | for_writing | Set EINA_TRUE to set retrieved data as modifiable, otherwise EINA_FALSE to not set it as modifiable |
void evas_object_image_data_set | ( | Evas_Object * | obj, |
void * | data | ||
) |
Sets the raw image data of the given image object.
NULL
, the current image data is freed. Naturally, if one does not set an image object's data manually, it still has one, allocated by Evas.[in] | obj | The given image object |
[in] | data | The raw data, or NULL |
void evas_object_image_data_update_add | ( | Evas_Object * | obj, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Marks a sub-region of the given image object to be redrawn.
This function schedules a particular rectangular region of an image object to be updated (redrawn) at the next rendering cycle.
[in] | obj | The given image object |
[in] | x | The X-offset of the region to be updated |
[in] | y | The Y-offset of the region to be updated |
[in] | w | The width of the region to be updated |
[in] | h | The height of the region to be updated |
Eina_Bool evas_object_image_extension_can_load_fast_get | ( | const char * | file | ) |
Checks whether a file extension is supported by Image Object Functions.
[in] | file | The file to check It should be Eina_Stringshare. |
Eina_Bool evas_object_image_extension_can_load_get | ( | const char * | file | ) |
Checks whether a file extension is supported by Image Object Functions.
[in] | file | The file to check |
void evas_object_image_file_get | ( | const Evas_Object * | obj, |
const char ** | file, | ||
const char ** | key | ||
) |
Gets 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).
NULL
pointers on the file components that you are not interested in: they are ignored by the function.[in] | obj | The given image object |
[out] | file | The location to store the image file path |
[out] | key | The location to store the image key (if file is an Eet one) |
void evas_object_image_file_set | ( | Evas_Object * | obj, |
const char * | file, | ||
const char * | key | ||
) |
Sets the source file from where an image object must fetch the real image data (it may be an Eet file, besides pure image ones).
img = evas_object_image_add(canvas); evas_object_image_file_set(img, "/path/to/img", NULL); err = evas_object_image_load_error_get(img); if (err != EVAS_LOAD_ERROR_NONE) { fprintf(stderr, "could not load image '%s'. error string is \"%s\"\n", valid_path, evas_load_error_str(err)); } else { evas_object_image_fill_set(img, 0, 0, w, h); evas_object_resize(img, w, h); evas_object_show(img); }
[in] | obj | The given image object |
[in] | file | The image file path |
[in] | key | The image key in file (if its an Eet one), otherwise set NULL |
void evas_object_image_fill_get | ( | const Evas_Object * | obj, |
Evas_Coord * | x, | ||
Evas_Coord * | y, | ||
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Sets how an image object is to fill its drawing rectangle, given the (real) image bound to it.
NULL
pointers on the fill components that you are not interested in: they are ignored by the function.[in] | obj | The given image object |
[out] | x | The location to store the x coordinate (from the top left corner of the bound image) to start drawing from |
[out] | y | The location to store the y coordinate (from the top left corner of the bound image) to start drawing from |
[out] | w | The location to store the width the bound image is to be displayed at |
[out] | h | The location to store the height the bound image is to be displayed at |
See evas_object_image_fill_set() for more details.
void evas_object_image_fill_set | ( | Evas_Object * | obj, |
Evas_Coord | x, | ||
Evas_Coord | y, | ||
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets how to fill an image object's drawing rectangle given the (real) image bound to it.
0
and w and h need to be the exact width and height of the image object itself, respectively.a
x a
dimensions and the image itself is a circle, with empty space around it:[in] | obj | The given image object to operate on |
[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 is displayed at |
[in] | h | The height the bound image is displayed at |
Evas_Fill_Spread evas_object_image_fill_spread_get | ( | const Evas_Object * | obj | ) |
Gets the spread (tiling mode) for the given image object's fill.
[in] | obj | The given evas image object |
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.
[in] | obj | The given evas image object |
[in] | spread | One of EVAS_TEXTURE_REFLECT, EVAS_TEXTURE_REPEAT, EVAS_TEXTURE_RESTRICT, or EVAS_TEXTURE_PAD. |
Creates a new image object that automatically scales its bound image to the object's area, on both axis.
[in] | e | The given canvas |
Eina_Bool evas_object_image_filled_get | ( | const Evas_Object * | obj | ) |
Checks whether the image object's fill property should track the object's size.
[in] | obj | The given image object |
void evas_object_image_filled_set | ( | Evas_Object * | obj, |
Eina_Bool | setting | ||
) |
Sets whether the image object's fill property should track the object's size.
0
, 0
as source image's origin), so the bound image fills the whole object's area.[in] | obj | The given image object |
[in] | setting | Set EINA_TRUE to make the fill property follow object size, otherwise set EINA_FALSE |
double evas_object_image_load_dpi_get | ( | const Evas_Object * | obj | ) |
Gets the DPI resolution of a loaded image object in the canvas.
This function returns the DPI resolution of the given canvas image.
[in] | obj | The given canvas pointer |
void evas_object_image_load_dpi_set | ( | Evas_Object * | obj, |
double | dpi | ||
) |
Sets the DPI resolution of an image object's source image.
This function sets the DPI resolution of a given loaded canvas image. This is useful for the SVG image loader.
[in] | obj | The given canvas pointer |
[in] | dpi | The new DPI resolution |
Evas_Load_Error evas_object_image_load_error_get | ( | const Evas_Object * | obj | ) |
Gets a number representing any error that occurred during the last loading of the given image object's source image.
[in] | obj | The given image object |
Eina_Bool evas_object_image_load_orientation_get | ( | const Evas_Object * | obj | ) |
Checks whether the orientation information in the image file should be honored.
[in] | obj | The given image object pointer |
void evas_object_image_load_orientation_set | ( | Evas_Object * | obj, |
Eina_Bool | enable | ||
) |
Sets whether the orientation information in the image file should be honored.
[in] | obj | The given image object pointer |
[in] | enable | Set EINA_TRUE to honor the orientation information, otherwise EINA_FALSE to not honor the orientation information |
void evas_object_image_load_region_get | ( | const Evas_Object * | obj, |
int * | x, | ||
int * | y, | ||
int * | w, | ||
int * | h | ||
) |
Gets the coordinates of a given image object's selective (source image) load region.
NULL
pointers on the coordinates that you are not interested in: they are ignored by the function.[in] | obj | The given image object pointer |
[out] | x | The X-offset of the region to be loaded |
[out] | y | The Y-offset of the region to be loaded |
[out] | w | The width of the region to be loaded |
[out] | h | The height of the region to be loaded |
void evas_object_image_load_region_set | ( | Evas_Object * | obj, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h | ||
) |
Sets a selective region of the source image to load for the given image object.
This function is useful when you are not showing all of an image's area on its image object.
[in] | obj | The given image object pointer |
[in] | x | The X-offset of the region to be loaded |
[in] | y | The Y-offset of the region to be loaded |
[in] | w | The width of the region to be loaded |
[in] | h | The height of the region to be loaded |
int evas_object_image_load_scale_down_get | ( | const Evas_Object * | obj | ) |
Gets the scale down factor of a given image object's source image, when loading it.
[in] | obj | The given image object pointer |
void evas_object_image_load_scale_down_set | ( | Evas_Object * | obj, |
int | scale_down | ||
) |
Sets the scale down factor of a given image object's source image, when loading it.
This function sets the scale down factor of a given canvas image. This is useful for the SVG image loader.
[in] | obj | The given image object pointer |
[in] | scale_down | The scale down factor |
void evas_object_image_load_size_get | ( | const Evas_Object * | obj, |
int * | w, | ||
int * | h | ||
) |
Gets the load size of a given image object's source image.
This function gets the geometry size set manually for the given canvas image.
NULL
pointers on the size components that you are not interested in: they are 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.[in] | obj | The given image object |
[out] | w | The new width of the image's load size that is returned |
[out] | h | The new height of the image's load size that is returned |
void evas_object_image_load_size_set | ( | Evas_Object * | obj, |
int | w, | ||
int | h | ||
) |
Sets 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.
w
and h
.[in] | obj | The given canvas object |
[in] | w | The new width of the image's load size |
[in] | h | The new height of the image's load size |
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 function 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 is 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().
NULL
if you do not 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", "png", and "gif".[in] | obj | The given image object |
[in] | data | The image file data address |
[in] | size | The size of the image file data in bytes |
[in] | format | The format of the file (optional), otherwise set NULL |
[in] | key | The image key in file, otherwise set NULL |
Evas_Native_Surface* evas_object_image_native_surface_get | ( | const Evas_Object * | obj | ) |
Gets the native surface of a given image of the canvas.
This function returns the native surface of a given canvas image.
[in] | obj | The given canvas pointer |
void evas_object_image_native_surface_set | ( | Evas_Object * | obj, |
Evas_Native_Surface * | surf | ||
) |
Sets the native surface of a given image of the canvas.
This function sets a native surface of a given canvas image.
[in] | obj | The given canvas pointer |
[in] | surf | The new native surface |
Eina_Bool evas_object_image_pixels_dirty_get | ( | const Evas_Object * | obj | ) |
Checks whether the given image object is dirty (needs to be redrawn).
[in] | obj | The given image object |
void evas_object_image_pixels_dirty_set | ( | Evas_Object * | obj, |
Eina_Bool | dirty | ||
) |
Sets whether the given image object is dirty and needs to request its pixels.
This function only works properly if a callback for getting pixels has been set.
[in] | obj | The given image object |
[in] | dirty | Set EINA_TRUE to mark the image object as dirty, otherwise set EINA_FALSE to mark the image object as not dirty |
void evas_object_image_pixels_get_callback_set | ( | Evas_Object * | obj, |
Evas_Object_Image_Pixels_Get_Cb | func, | ||
void * | data | ||
) |
Sets the callback function to get pixels from a canvas' image.
This sets a function to be the callback function that gets pixels from an image of the canvas.
[in] | obj | The given canvas pointer |
[in] | func | The callback function |
[in] | data | The data pointer to be passed to func |
Eina_Bool evas_object_image_pixels_import | ( | Evas_Object * | obj, |
Evas_Pixel_Import_Source * | pixels | ||
) |
Imports pixels from given source to a given canvas image object.
This function imports pixels from a given source to a given canvas image.
[in] | obj | The given canvas object |
[in] | pixels | The pixel's source to be imported |
void evas_object_image_preload | ( | Evas_Object * | obj, |
Eina_Bool | cancel | ||
) |
Preloads an image object's image data in the background.
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).
[in] | obj | The given image object |
[in] | cancel | Set EINA_FALSE to add to the preloading work queue, otherwise set EINA_TRUE to remove it (if it is issued before) |
Eina_Bool evas_object_image_region_support_get | ( | const Evas_Object * | obj | ) |
Gets the support state of a given image.
This function returns the state of the region support of given image
[in] | obj | The given image object pointer |
void evas_object_image_reload | ( | Evas_Object * | obj | ) |
Reloads an image object's image data.
This function reloads the image data bound to image object obj.
[in] | obj | The given image object pointer |
Eina_Bool evas_object_image_save | ( | const Evas_Object * | obj, |
const char * | file, | ||
const char * | key, | ||
const char * | flags | ||
) |
Saves the given image object's contents to an (image) file.
quality
and compress
. Eg.: "quality=100 compress=9"
[in] | obj | The given image object |
[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), otherwise NULL |
[in] | flags | String containing the flags to be used (NULL for none) |
Evas_Image_Scale_Hint evas_object_image_scale_hint_get | ( | const Evas_Object * | obj | ) |
Gets the scale hint of a given image of the canvas.
This function returns the scale hint value of the given image object of the canvas.
[in] | obj | The given image object pointer |
void evas_object_image_scale_hint_set | ( | Evas_Object * | obj, |
Evas_Image_Scale_Hint | hint | ||
) |
Sets the scale hint of a given image of the canvas.
This function sets the scale hint value of the given image object in the canvas, which affects how Evas is to cache scaled versions of its original source image.
[in] | obj | The given image object pointer |
[in] | hint | The scale hint A Evas_Image_Scale_Hint value. |
void evas_object_image_size_get | ( | const Evas_Object * | obj, |
int * | w, | ||
int * | h | ||
) |
Gets the size of the given image object.
[in] | obj | The given image object |
[out] | w | The location to store the width of the image in, or NULL |
[out] | h | The location to store the height of the image in, or NULL |
See evas_object_image_size_set() for more details.
void evas_object_image_size_set | ( | Evas_Object * | obj, |
int | w, | ||
int | h | ||
) |
Sets the size of the given image object.
This function scales down or crops 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 is cropped. If the size given is larger, then the image is treated as if it were in the upper left hand corner of a larger image that is otherwise transparent.
[in] | obj | The given image object |
[in] | w | The new width of the image |
[in] | h | The new height of the image |
Eina_Bool evas_object_image_smooth_scale_get | ( | const Evas_Object * | obj | ) |
Checks whether the given image object is using high-quality image scaling algorithm.
[in] | obj | The given image object |
void evas_object_image_smooth_scale_set | ( | Evas_Object * | obj, |
Eina_Bool | smooth_scale | ||
) |
Sets whether to use high-quality image scaling algorithm on the given image object.
[in] | obj | The given image object |
[in] | smooth_scale | Set EINA_TRUE to use smooth scale, otherwise set EINA_FALSE to not use it |
Eina_Bool evas_object_image_source_clip_get | ( | const Evas_Object * | obj | ) |
Checks whether an object is clipped by source object's clipper.
[in] | obj | The proxy (image) object |
void evas_object_image_source_clip_set | ( | Evas_Object * | obj, |
Eina_Bool | source_clip | ||
) |
Clips the proxy object with the source object's clipper.
[in] | obj | The proxy (image) object |
[in] | source_clip | Set EINA_TRUE if obj must be clipped by the source clipper, otherwise set EINA_FALSE |
Evas_Object* evas_object_image_source_get | ( | const Evas_Object * | obj | ) |
Gets the current source object of an image object.
[in] | obj | The Image object |
NULL
if not in "proxy mode" or on errorsEina_Bool evas_object_image_source_set | ( | Evas_Object * | obj, |
Evas_Object * | src | ||
) |
Sets the source object on an image object to used as a proxy.
NULL
clears the proxy object (not in "proxy state" anymore).[in] | obj | The proxy (image) object |
[in] | src | The source object to use for the proxy |
Clears the source object on a proxy image object.
This function is equivalent to calling evas_object_image_source_set() with a NULL
source.
[in] | obj | The Image object to clear source of |
Eina_Bool evas_object_image_source_visible_get | ( | const Evas_Object * | obj | ) |
Gets the state of the source object visibility.
[in] | obj | The proxy (image) object |
void evas_object_image_source_visible_set | ( | Evas_Object * | obj, |
Eina_Bool | visible | ||
) |
Sets the source object to be visible.
[in] | obj | The proxy (image) object |
[in] | visible | Set EINA_TRUE to show the source object, otherwise set EINA_FALSE to not show it |
int evas_object_image_stride_get | ( | const Evas_Object * | obj | ) |
Gets the row stride of the given image object.
[in] | obj | The given image object |
const Evas_Video_Surface* evas_object_image_video_surface_get | ( | const Evas_Object * | obj | ) |
Gets the video surface linked to a given image of the canvas.
This function returns the video surface linked to a given canvas image.
[in] | obj | The given canvas pointer |
void evas_object_image_video_surface_set | ( | Evas_Object * | obj, |
Evas_Video_Surface * | surf | ||
) |
Sets the video surface linked to a given image of the canvas.
This function links a video surface to a given canvas image.
[in] | obj | The given canvas pointer |
[in] | surf | The new video surface |