diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-03-02 20:46:11 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2016-03-15 11:11:59 +0900 |
commit | b458341a13b93b2f963745fae34b3ce14668f99d (patch) | |
tree | d10822600532ce5ea115b7a7e38e112bf196c87d | |
parent | e3de15d72642a61f57dda280befe458cb546c527 (diff) | |
download | efl-b458341a13b93b2f963745fae34b3ce14668f99d.tar.gz |
Efl.Gfx.Buffer: Add interface skeletton
-rw-r--r-- | src/Makefile_Efl.am | 2 | ||||
-rw-r--r-- | src/lib/efl/Efl.h | 4 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_buffer.eo | 165 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_types.eot | 24 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_view.eo | 4 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_image.eo | 124 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_image_load.eo | 203 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_interfaces_main.c | 2 | ||||
-rw-r--r-- | src/lib/emotion/emotion_object.eo | 4 | ||||
-rw-r--r-- | src/lib/emotion/emotion_smart.c | 2 | ||||
-rw-r--r-- | src/lib/evas/Evas_Legacy.h | 324 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_image.eo | 489 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_object_image.c | 306 |
13 files changed, 1172 insertions, 481 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index e3d5974d00..e507a38c5d 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -9,11 +9,13 @@ efl_eolian_files = \ lib/efl/interfaces/efl_control.eo \ lib/efl/interfaces/efl_file.eo \ lib/efl/interfaces/efl_image.eo \ + lib/efl/interfaces/efl_image_load.eo \ lib/efl/interfaces/efl_player.eo \ lib/efl/interfaces/efl_text.eo \ lib/efl/interfaces/efl_text_properties.eo \ lib/efl/interfaces/efl_gfx_stack.eo \ lib/efl/interfaces/efl_gfx_view.eo \ + lib/efl/interfaces/efl_gfx_buffer.eo \ lib/efl/interfaces/efl_gfx_shape.eo \ lib/efl/interfaces/efl_gfx_gradient_base.eo \ lib/efl/interfaces/efl_gfx_gradient_linear.eo \ diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index bb7580a4b3..fccce5df31 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -59,6 +59,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_file.eo.h" #include "interfaces/efl_image.eo.h" #include "interfaces/efl_image_animated.eo.h" +#include "interfaces/efl_image_load.eo.h" #include "interfaces/efl_player.eo.h" #include "interfaces/efl_text.eo.h" #include "interfaces/efl_text_properties.eo.h" @@ -73,6 +74,7 @@ EAPI extern const Eo_Event_Description _EFL_GFX_PATH_CHANGED; #define EFL_GFX_PATH_CHANGED (&(_EFL_GFX_PATH_CHANGED)) #include "interfaces/efl_gfx_base.eo.h" +#include "interfaces/efl_gfx_buffer.eo.h" #include "interfaces/efl_gfx_stack.eo.h" #include "interfaces/efl_gfx_fill.eo.h" #include "interfaces/efl_gfx_view.eo.h" @@ -99,9 +101,9 @@ static inline void efl_gfx_color16_type_set(Efl_Gfx_Color *color, #ifndef EFL_NOLEGACY_API_SUPPORT #include "interfaces/efl_gfx_types.eot.h" -#include "interfaces/efl_image_animated.eo.legacy.h" #include "interfaces/efl_gfx_fill.eo.legacy.h" #include "interfaces/efl_gfx_base.eo.legacy.h" +#include "interfaces/efl_image_animated.eo.legacy.h" #endif typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; diff --git a/src/lib/efl/interfaces/efl_gfx_buffer.eo b/src/lib/efl/interfaces/efl_gfx_buffer.eo new file mode 100644 index 0000000000..f74e8017dd --- /dev/null +++ b/src/lib/efl/interfaces/efl_gfx_buffer.eo @@ -0,0 +1,165 @@ +import efl_gfx_types; + +/* FIXME: this is very very low level. expose to apps? */ +enum Efl.Gfx.Buffer.Access_Mode { + none = 0x0, + read = 0x1, + write = 0x2, + cow = 0x4, [[Forces copy-on-write if already mapped as read-only. Requires write.]] +} + +interface Efl.Gfx.Buffer () +{ + [[Common APIs for all objects representing images and 2D pixel buffers.]] + legacy_prefix: null; + + methods { + @property buffer_size { + [[Rectangular size of the pixel buffer as allocated in memory.]] + set { + [[Potentially not implemented, @.buffer_size may be read-only.]] + } + get {} + values { + w: int; [[Width in pixels.]] + h: int; [[Height in pixels.]] + } + } + @property colorspace { + [[The colorspace defines how pixels are encoded in the image in memory. + + By default, images are encoded in 32-bit BGRA, ie. each pixel takes + 4 bytes in memory, with each channel B,G,R,A encoding the color with + values from 0 to 255. + + All images used in EFL use alpha-premultipied BGRA values, which + means that for each pixel, B <= A, G <= A and R <= A. + ]] + get { + [[Returns the current encoding of this buffer's pixels. + + See @Efl.Gfx.Colorspace for more information on the supported + formats. + ]] + } + values { + cspace: Efl.Gfx.Colorspace; + } + } + + @property buffer_stride { + [[Length in bytes of one row of pixels in memory. + + Usually this will be equal to width * 4, with a plain BGRA image. + This may return 0 if the stride is not applicable. + + When applicable, this will include the @.buffer_borders as well + as potential extra padding. + ]] + get {} + values { + stride: int; + } + } + + buffer_update_region_add { + [[Mark 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. + ]] + params { + @in x: int; [[X-offset of the region to be updated.]] + @in y: int; [[Y-offset of the region to be updated.]] + @in w: int; [[Width of the region to be updated.]] + @in h: int; [[Height of the region to be updated.]] + } + } + + /* FIXME: too low-level? */ + @property buffer_borders { + [[Duplicated pixel borders inside this buffer. + + Internally, EFL may require an image to have its border pixels + duplicated, in particular for GL textures. This property exposes + the internal duplicated borders to allow calling @.buffer_map + with the entire pixel data, including those edge pixels. + ]] + get {} + values { + l: uint(0); [[Left border pixels, usually 0 or 1]] + r: uint(0); [[Right border pixels, usually 0 or 1]] + t: uint(0); [[Top border pixels, usually 0 or 1]] + b: uint(0); [[Bottom border pixels, usually 0 or 1]] + } + } + + /* FIXME: split into read-only and writeable methods? */ + /* FIXME: This was copy pasta from ector generic buffer. changed a bit. */ + buffer_map { + [[Map a region of this buffer for read or write access by the CPU. + + Fetches data from the GPU if needed. This operation may be slow if + cpu_readable_fast or cpu_writeable_fast are not true, or if the + required colorspace is different from the internal one. + + Note that if the buffer has @.buffer_borders, then $x and $y may + be negative. + ]] + params { + @out length: uint @nonull; [[Accessible buffer size in bytes, should not be $null.]] + @in mode: Efl.Gfx.Buffer.Access_Mode; [[Specifies whether to map for read-only, + write-only or read-write access (OR combinaison of flags).]] + @in x: int @optional; [[X position of the top-left pixel to map, defaults to 0.]] + @in y: int @optional; [[Y position of the top-left pixel to map, defaults to 0.]] + @in w: uint @optional; [[If 0, defaults to the buffer width.]] + @in h: uint @optional; [[If 0, defaults to the buffer height.]] + @in cspace: Efl.Gfx.Colorspace @optional; [[Requested colorspace. If differen from the internal cspace, + map should try to convert the data into a new buffer. + argb8888 by default.]] + @out stride: uint @optional; [[Returns the length in bytes of a mapped line]] + } + return: ubyte* @warn_unused; [[Pointer to the top-left pixel data. Returns $null in case of failure]] + } + buffer_unmap { + [[Unmap a region of this buffer, and update the internal data if needed. + + EFL will update the internal image if the map had write access. + ]] + params { + @in data: ubyte*; [[Data pointer returned by a previous call to map]] + @in length: uint; [[Must be the same as returned by map.]] + } + } + buffer_set { + [[Set the pixels for this buffer, or allocate a new memory region. + + EFL will copy the $pixels to an internal buffer, and update the + GPU-side texture if required. This will mark the image as dirty. + + If $pixels is $null, then a new empty buffer will be allocated. + + If the buffer already had pixel data, the previous image data will + be dropped and the internal buffer may be resized to fit the new + pixel data. + + Note: Use @Efl.Gfx.Buffer.buffer_size.set and @.buffer_map to + request EFL to allocate the buffer itself, instead of using this + function. + ]] + params { + @in pixels: ubyte*; [[If $null, allocates an empty buffer]] + @in width: int; + @in height: int; + @in stride: int @optional; [[If 0, automatically guessed from the width.]] + @in cspace: Efl.Gfx.Colorspace @optional; [[argb8888 by default.]] + @in l: uint @optional; [[Left border pixels, usually 0 or 1]] + @in r: uint @optional; [[Right border pixels, usually 0 or 1]] + @in t: uint @optional; [[Top border pixels, usually 0 or 1]] + @in b: uint @optional; [[Bottom border pixels, usually 0 or 1]] + } + return: bool; + } + /* Note: border, span and buffer flags not imported from ector buffer */ + } +} diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 2f98951a5e..782ac9d191 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -133,3 +133,27 @@ struct Efl.Gfx.Shape.Public { stroke: Efl.Gfx.Stroke; } + +enum Efl.Gfx.Border_Fill_Mode +{ + [[How an image's center region (the complement to the border region) should be rendered by EFL]] + none = 0, [[Image's center region is $b not to be rendered]] + default = 1, [[Image's center region is to be $b blended with objects underneath it, if it has transparency. This is the default behavior for image objects]] + solid = 2 [[Image's center region is to be made solid, even if it has transparency on it]] +} + +enum Efl.Gfx.Orientation +{ + [[Orientation options for $Efl.Image.orientation + @since 1.14]] + /* FIXME: legacy: evas_image; */ + orient_none = 0, [[no orientation change]] + orient_0 = 0, [[no orientation change]] + orient_90 = 1, [[orient 90 degrees clockwise]] + orient_180 = 2, [[orient 180 degrees clockwise]] + orient_270 = 3, [[rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise)]] + flip_horizontal = 4, [[flip image horizontally]] + flip_vertical = 5, [[flip image vertically]] + flip_transpose = 6, [[flip image along the y = (width - x) line (bottom-left to top-right)]] + flip_transverse = 7 [[flip image along the y = x line (top-left to bottom-right)]] +} diff --git a/src/lib/efl/interfaces/efl_gfx_view.eo b/src/lib/efl/interfaces/efl_gfx_view.eo index d90f63bf7f..9e658cbe5a 100644 --- a/src/lib/efl/interfaces/efl_gfx_view.eo +++ b/src/lib/efl/interfaces/efl_gfx_view.eo @@ -5,6 +5,10 @@ interface Efl.Gfx.View { @property view_size { [[The dimensions of this object's viewport. + FIXME + WRONG DOC!!! + USELESS API for image files + This property will scale down or crop the image so that it is treated as if it were of the given size. If the given size is smaller than the image, it will be cropped. If it's larger, then diff --git a/src/lib/efl/interfaces/efl_image.eo b/src/lib/efl/interfaces/efl_image.eo index 2d5c01cc99..619d17c302 100644 --- a/src/lib/efl/interfaces/efl_image.eo +++ b/src/lib/efl/interfaces/efl_image.eo @@ -1,22 +1,9 @@ -interface Efl.Image { +interface Efl.Image () +{ + [[Common APIs for all 2D images that can be rendered on the canvas.]] legacy_prefix: null; - methods { - @property load_size { - [[The loading size of an image. - The image will be loaded into memory as if it was the set size - instead of the original size. This can save a lot of memory, - and is important for scalable types like svg. - ]] - set { - [[Requests the canvas to load the image at the given size.]] - } - get {} - values { - w: int; [[Width of the image's load size.]] - h: int; [[Height of the image's load size.]] - } - } + methods { @property smooth_scale { [[Whether to use high-quality image scaling algorithm for this image. @@ -33,6 +20,30 @@ interface Efl.Image { smooth_scale: bool; [[Whether to use smooth scale or not.]] } } + @property alpha { + [[Indicates whether the alpha channel should be used. + + This does not indicate whether the image source file contains + an alpha channel, only whether to respect it or discard it. + ]] + set { + [[Change alpha channel usage for this object. + + This function sets a flag on an image object indicating + whether or not to use alpha channel data. A value of $true + makes it use alpha channel data, and $false makes it ignore + that data. Note that this has nothing to do with an object's + color as manipulated by @Efl.Gfx.Base.color.set. + ]] + } + get { + [[Retrieve whether alpha channel data is used on this object.]] + } + values { + alpha: bool; [[Whether to use alpha channel ($true) data + or not ($false).]] + } + } @property ratio { [[The native width/height ratio of the image.]] get { @@ -42,5 +53,84 @@ interface Efl.Image { ratio: double; [[The image's ratio.]] } } + @property orientation { + [[The image orientation allows rotating and flipping the image + at render time. + + Default is @Efl.Gfx.Orientation.orient_none + + @since 1.14 + ]] + set {} + get {} + values { + orient: Efl.Gfx.Orientation; + } + } + + @property border { + [[Dimensions of this image's border, a region that does not scale + with the center area. + + When EFL renders an image, its source may be scaled to fit + the size of the object. This function sets an area from + the borders of the image inwards which is not to be scaled. + This function is useful for making frames and for widget + theming, where, for example, buttons may be of varying + sizes, but their border size must remain constant. + + The units used for $l, $r, $t and $b are canvas units (pixels). + + Note: The border region itself may be scaled by the + @.border_scale.set function. + + Note: By default, image objects have no borders set, i.e. + $l, $r, $t and $b start as 0. + + Note: Similar to the concepts of 9-patch images or cap insets. + ]] + set {} + get {} + values { + l: int; [[The border's left width.]] + r: int; [[The border's right width.]] + t: int; [[The border's top height.]] + b: int; [[The border's bottom height.]] + } + } + @property border_scale { + [[Scaling factor applied to the image borders. + + This value multiplies the size of the @.border when scaling an + object. + + Default value is 1.0 (no scaling). + ]] + set {} + get {} + values { + scale: double; [[The scale factor.]] + } + } + @property border_center_fill { + [[Specifies how the center part of the object (not the borders) + should be drawn when EFL 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 @Efl.Gfx.Border_Fill_Mode. By center we mean the complementary + part of that defined by @.border.set. This is very useful for + making frames and decorations. You would most probably also be + using a filled image (as in @Efl.Gfx.Fill.filled) to use as a frame. + + The default value is @Efl.Gfx.Border_Fill_Mode.default, ie. render + and scale the center area, respecting its transparency. + ]] + set {} + get {} + values { + fill: Efl.Gfx.Border_Fill_Mode; [[Fill mode of the center region.]] + } + } } } diff --git a/src/lib/efl/interfaces/efl_image_load.eo b/src/lib/efl/interfaces/efl_image_load.eo new file mode 100644 index 0000000000..4a6bd4ec39 --- /dev/null +++ b/src/lib/efl/interfaces/efl_image_load.eo @@ -0,0 +1,203 @@ +/* FIXME: maybe add error code for "currently running" or "pending" ? */ +enum Efl.Image_Load.Error +{ + none = 0, [[No error on load]] + generic = 1, [[A non-specific error occurred]] + does_not_exist = 2, [[File (or file path) does not exist]] + permission_denied = 3, [[Permission denied to an existing file (or path)]] + resource_allocation_failed = 4, [[Allocation of resources failure prevented load]] + corrupt_file = 5, [[File corrupt (but was detected as a known format)]] + unknown_format = 6 [[File is not a known format]] +} + +/* FIXME: state or status??? */ +enum Efl.Image_Load.State +{ + none = 0, [[Not loading any image.]] + loaded = 1, [[Image data is loaded, nothing is pending.]] + pending = 2, [[The image has been queued for load, but actual loading may not have started yet.]] + loading = 3, [[The image is currently loading.]] + error = 4, [[Image load has failed. Call @Efl.Image_Load.load_error.get to know why.]] + cancelled = 5 [[Image load has been cancelled.]] +} + +/* FIXME: Efl.Image.Load */ +interface Efl.Image_Load () +{ + [[Common APIs for all loadable 2D images.]] + legacy_prefix: null; + + methods { + load_async_start { + [[Begin preloading an image object's image data in the background. + + Once the background task is done, the event $load,done will be + emitted. + ]] + } + load_async_cancel { + [[Cancel preloading an image object's image data in the background. + + The event $load,cancelled should be triggered soon after + cancellation happened, and the object should be left in a state + where it has no image data. If cancel is called too late, the image + will be kept in memory. + ]] + } + @property load_state { + get { + [[Queries information on the current state of load of the image. + + While more relevant to asynchronous load, this will also return + meaningful information about the last synchronous load. + ]] + } + values { + state: Efl.Image_Load.State; + } + } + @property load_size { + [[The load size of an image. + + The image will be loaded into memory as if it was the specified + size instead of its original size. This can save a lot of memory, + and is important for scalable types like svg. + + By default, the load size is not specified, so it is 0x0. + ]] + set { + [[Requests the canvas to load the image at the given size. + + EFL will try to load the image at the requested size, but does + not garantee an exact match between the request and the loaded + image dimensions. + ]] + } + get { + [[Returns the requested load size.]] + } + values { + w: int; [[Width of the image's load size.]] + h: int; [[Height of the image's load size.]] + } + } + @property load_dpi { + set { + [[Set the DPI resolution of an image object's source image. + + This function sets the DPI resolution of a given loaded canvas + image. Most useful for the SVG image loader. + ]] + } + get { + [[Get the DPI resolution of a loaded image object in the canvas. + + This function returns the DPI resolution of the given canvas + image. + ]] + } + values { + dpi: double; [[The DPI resolution.]] + } + } + @property load_region_support { + [[Indicates whether the @.load_region property is supported for the + current file. + + @since 1.2 + ]] + get {} + values { + support: bool; + } + } + @property load_region { + set { + [[Inform a given image object to load a selective region of its + source image. + + This function is useful when one is not showing all of an + image's area on its image object. + + Note: The image loader for the image format in question has + to support selective region loading in order to this function + to take effect. + ]] + } + get { + [[Retrieve the coordinates of a given image object's selective + (source image) load region. + + Note: Use $null pointers on the coordinates you're not + interested in: they'll be ignored by the function. + ]] + } + values { + x: int; [[X-offset of the region to be loaded.]] + y: int; [[Y-offset of the region to be loaded.]] + w: int; [[Width of the region to be loaded.]] + h: int; [[Height of the region to be loaded.]] + } + } + @property load_orientation { + [[Defines whether the orientation information in the image file + should be honored. + + The orientation can for instance be set in the EXIF tags of a + JPEG image. If this flag is $false, then the orientation will be + ignored at load time, otherwise the image will be loaded with the + proper orientation. + + @since 1.1 + ]] + set {} + get {} + values { + enable: bool; [[$true means that it should honor the orientation + information.]] + } + } + @property load_scale_down { + [[The scale down factor is a divider on the original image size. + + Setting the scale down factor can reduce load time and memory usage, + at the cost of having a scaled down image in memory. + + This function sets the scale down factor of a given canvas + image. Most useful for the SVG image loader, but also applies + to JPEG, PNG and BMP. + + Powers of two (2, 4, 8) are best supported (especially with JPEG) + ]] + set { + [[Requests the image loader to scale down by $div times. + Call this before starting the actual image load. + ]] + } + get {} + values { + div: int; [[The scale down dividing factor.]] + } + } + /* FIXME: do we want this? or only rely on the events? + * what if preload is currently running? + */ + @property load_error { + get { + [[Retrieves a number representing any error that occurred during + the last loading of the given image object's source image. + ]] + return: Efl.Image_Load.Error @warn_unused; [[ + A value giving the last error that occurred, one of + @Efl.Image_Load.Error values. @Efl.Image_Load.Error.none is + returned if there was no error. + ]] + } + } + } + events { + load,done; + load,error: Efl.Image_Load.Error; + load,cancelled; + } +} diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index b0be0d21e5..2299022c3d 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -8,11 +8,13 @@ #include "interfaces/efl_file.eo.c" #include "interfaces/efl_image.eo.c" #include "interfaces/efl_image_animated.eo.c" +#include "interfaces/efl_image_load.eo.c" #include "interfaces/efl_player.eo.c" #include "interfaces/efl_text.eo.c" #include "interfaces/efl_text_properties.eo.c" #include "interfaces/efl_gfx_base.eo.c" +#include "interfaces/efl_gfx_buffer.eo.c" #include "interfaces/efl_gfx_stack.eo.c" #include "interfaces/efl_gfx_fill.eo.c" #include "interfaces/efl_gfx_view.eo.c" diff --git a/src/lib/emotion/emotion_object.eo b/src/lib/emotion/emotion_object.eo index 3486c5cef3..39ee910564 100644 --- a/src/lib/emotion/emotion_object.eo +++ b/src/lib/emotion/emotion_object.eo @@ -1,4 +1,4 @@ -class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image) { +class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image, Efl.Image_Load) { eo_prefix: emotion_obj; methods { @property option { @@ -74,7 +74,7 @@ class Emotion.Object (Evas.Object_Smart, Efl.File, Efl.Player, Efl.Image) { Efl.Player.audio_mute.get; Efl.Player.length.get; Efl.Player.seekable.get; - Efl.Image.load_size.get; + Efl.Image_Load.load_size.get; Efl.Image.ratio.get; Efl.Image.smooth_scale.set; Efl.Image.smooth_scale.get; diff --git a/src/lib/emotion/emotion_smart.c b/src/lib/emotion/emotion_smart.c index d0b0f327f8..804b865307 100644 --- a/src/lib/emotion/emotion_smart.c +++ b/src/lib/emotion/emotion_smart.c @@ -748,7 +748,7 @@ emotion_object_size_get(const Evas_Object *obj, int *iw, int *ih) } EOLIAN static void -_emotion_object_efl_image_load_size_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, int *iw, int *ih) +_emotion_object_efl_image_load_load_size_get(Eo *obj EINA_UNUSED, Emotion_Object_Data *sd, int *iw, int *ih) { if (iw) *iw = sd->video.w; if (ih) *ih = sd->video.h; diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 668684845a..f5d91a4e4f 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -2853,6 +2853,25 @@ EAPI int evas_object_image_animated_loop_count_get(const Evas_Object *obj); EAPI double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int frame_num); /** + * @brief Set the DPI resolution of an image object's source image. + * + * This function sets the DPI resolution of a given loaded canvas image. Most + * useful for the SVG image loader. + * + * @param[in] dpi The DPI resolution. + */ +EAPI void evas_object_image_load_dpi_set(Evas_Object *obj, double dpi); + +/** + * @brief Get the DPI resolution of a loaded image object in the canvas. + * + * This function returns the DPI resolution of the given canvas image. + * + * @return The DPI resolution. + */ +EAPI double evas_object_image_load_dpi_get(const Evas_Object *obj); + +/** * * Set the load size of a given image object's source image. * @@ -2890,6 +2909,98 @@ EAPI void evas_object_image_load_size_set(Eo *obj, int w, int h); EAPI void evas_object_image_load_size_get(const Eo *obj, int *w, int *h); /** + * @brief Inform a given image object to load a selective region of its source + * image. + * + * This function is useful when one is not showing all of an image's area on + * its image object. + * + * @note The image loader for the image format in question has to support + * selective region loading in order to this function to take effect. + * + * @param[in] x X-offset of the region to be loaded. + * @param[in] y Y-offset of the region to be loaded. + * @param[in] w Width of the region to be loaded. + * @param[in] h Height of the region to be loaded. + */ +EAPI void evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h); + +/** + * @brief Retrieve the coordinates of a given image object's selective (source + * image) load region. + * + * @note Use @c null pointers on the coordinates you're not interested in: + * they'll be ignored by the function. + * + * @param[out] x X-offset of the region to be loaded. + * @param[out] y Y-offset of the region to be loaded. + * @param[out] w Width of the region to be loaded. + * @param[out] h Height of the region to be loaded. + */ +EAPI void evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h); + +/** + * @brief Get the support state of a given image. + * + * @return The region support state. + * + * @since 1.2 + * + * @ingroup Evas_Image + */ +EAPI Eina_Bool evas_object_image_region_support_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Define if the orientation information in the image file should be + * honored. + * + * @param[in] enable @c true means that it should honor the orientation + * information. + * + * @since 1.1 + */ +EAPI void evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable); + +/** + * @brief Get if the orientation information in the image file should be + * honored. + * + * @return @c true means that it should honor the orientation information. + * + * @since 1.1 + */ +EAPI Eina_Bool evas_object_image_load_orientation_get(const Evas_Object *obj); + +/** + * @brief Set 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. Most + * useful for the SVG image loader. + * + * @param[in] scale_down The scale down factor. + */ +EAPI void evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down); + +/** + * @brief Get the scale down factor of a given image object's source image, + * when loading it. + * + * @return The scale down factor. + */ +EAPI int evas_object_image_load_scale_down_get(const Evas_Object *obj); + +/** + * @brief Retrieves a number representing any error that occurred during the + * last loading of the given image object's source image. + * + * @return A value giving the last error that occurred. It should be one of the + * @ref Evas_Load_Error values. #EVAS_LOAD_ERROR_NONE is returned if there was + * no error. + */ +EAPI Evas_Load_Error evas_object_image_load_error_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; + +/** * * Sets whether to use high-quality image scaling algorithm on the * given image object. @@ -3008,8 +3119,6 @@ EAPI void evas_object_image_fill_get(const Evas_Object *obj, Evas_Coord *x, Evas * * @param[in] filled @c true to make the fill property follow object size or * @c false otherwise. - * - * @ingroup Evas_Image */ EAPI void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool filled); @@ -3022,10 +3131,173 @@ EAPI void evas_object_image_filled_set(Evas_Object *obj, Eina_Bool filled); * * @return @c true to make the fill property follow object size or @c false * otherwise. + */ +EAPI Eina_Bool evas_object_image_filled_get(const Evas_Object *obj); + +/** + * @brief Retrieve whether alpha channel data is being used on the given image + * object. + * + * This function returns @c true if the image object's alpha channel is being + * used, or @c false otherwise. + * + * @return Whether to use alpha channel ($true) data or not ($false). * * @ingroup Evas_Image */ -EAPI Eina_Bool evas_object_image_filled_get(const Evas_Object *obj); +EAPI Eina_Bool evas_object_image_alpha_get(const Evas_Object *obj); + +/** + * @brief Enable or disable 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 @c true makes it use alpha channel data, + * and @c false makes it ignore that data. Note that this has nothing to do + * with an object's color as manipulated by @ref evas_object_color_set. + * + * @param[in] alpha Whether to use alpha channel ($true) data or not ($false). + */ +EAPI void evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha); + +/** + * @brief Dimensions of this image's border, a region that does not scale with + * the center area. + * + * When EFL renders an image, its source may be scaled to fit the size of the + * object. This function sets an area from the borders of the image inwards + * which is not to be scaled. This function is useful for making frames and for + * widget theming, where, for example, buttons may be of varying sizes, but + * their border size must remain constant. + * + * The units used for @c l, @c r, @c t and @c b are canvas units (pixels). + * + * @note The border region itself may be scaled by the + * @ref evas_object_image_border_scale_set function. + * + * @note By default, image objects have no borders set, i.e. @c l, @c r, @c t + * and @c b start as 0. + * + * @note Similar to the concepts of 9-patch images or cap insets. + * + * @param[in] l The border's left width. + * @param[in] r The border's right width. + * @param[in] t The border's top height. + * @param[in] b The border's bottom height. + */ +EAPI void evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b); + +/** + * @brief Dimensions of this image's border, a region that does not scale with + * the center area. + * + * When EFL renders an image, its source may be scaled to fit the size of the + * object. This function sets an area from the borders of the image inwards + * which is not to be scaled. This function is useful for making frames and for + * widget theming, where, for example, buttons may be of varying sizes, but + * their border size must remain constant. + * + * The units used for @c l, @c r, @c t and @c b are canvas units (pixels). + * + * @note The border region itself may be scaled by the + * @ref evas_object_image_border_scale_set function. + * + * @note By default, image objects have no borders set, i.e. @c l, @c r, @c t + * and @c b start as 0. + * + * @note Similar to the concepts of 9-patch images or cap insets. + * + * @param[out] l The border's left width. + * @param[out] r The border's right width. + * @param[out] t The border's top height. + * @param[out] b The border's bottom height. + */ +EAPI void evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b); + +/** + * @brief Scaling factor applied to the image borders. + * + * This value multiplies the size of the @ref evas_object_image_border_get when + * scaling an object. + * + * Default value is 1.0 (no scaling). + * + * @param[in] scale The scale factor. + */ +EAPI void evas_object_image_border_scale_set(Evas_Object *obj, double scale); + +/** + * @brief Scaling factor applied to the image borders. + * + * This value multiplies the size of the @ref evas_object_image_border_get when + * scaling an object. + * + * Default value is 1.0 (no scaling). + * + * @return The scale factor. + */ +EAPI double evas_object_image_border_scale_get(const Evas_Object *obj); + +/** + * @brief Specifies how the center part of the object (not the borders) should + * be drawn when EFL 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 @ref Evas_Border_Fill_Mode. + * By center we mean the complementary part of that defined by + * @ref 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 + * @ref Efl.Gfx.Fill.filled) to use as a frame. + * + * The default value is + * + * @param[in] fill Fill mode of the center region of @c obj (a value in + * #Evas_Border_Fill_Mode). + */ +EAPI void evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill); + +/** + * @brief Specifies how the center part of the object (not the borders) should + * be drawn when EFL 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 @ref Evas_Border_Fill_Mode. + * By center we mean the complementary part of that defined by + * @ref 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 + * @ref Efl.Gfx.Fill.filled) to use as a frame. + * + * The default value is + * + * @return Fill mode of the center region of @c obj (a value in + * #Evas_Border_Fill_Mode). + */ +EAPI Evas_Border_Fill_Mode evas_object_image_border_center_fill_get(const Evas_Object *obj); + +/** + * @brief Set the image orientation. + * + * This function allows to rotate or flip the image. + * + * @param[in] orient The image orientation @ref Evas_Image_Orient. Default is + * #EVAS_IMAGE_ORIENT_NONE. + * + * @since 1.14 + * + * @ingroup Evas_Image + */ +EAPI void evas_object_image_orient_set(Evas_Object *obj, Evas_Image_Orient orient); + +/** + * @brief Get the image orientation. + * + * @return The image orientation @ref Evas_Image_Orient. Default is + * #EVAS_IMAGE_ORIENT_NONE. + * + * @since 1.14 + * + * @ingroup Evas_Image + */ +EAPI Evas_Image_Orient evas_object_image_orient_get(const Evas_Object *obj); /** * @@ -3053,6 +3325,52 @@ EAPI void evas_object_image_size_set(Evas_Object *obj, int w, int h); */ EAPI void evas_object_image_size_get(const Evas_Object *obj, int *w, int *h); +/** + * @brief Set the colorspace of a given image of the canvas. + * + * This function sets the colorspace of given canvas image. + * + * @param[in] cspace The new color space. + * + * @ingroup Evas_Image + */ +EAPI void evas_object_image_colorspace_set(Evas_Object *obj, Evas_Colorspace cspace); + +/** + * @brief Get the colorspace of a given image of the canvas. + * + * This function returns the colorspace of given canvas image. + * + * @return The new color space. + * + * @ingroup Evas_Image + */ +EAPI Evas_Colorspace evas_object_image_colorspace_get(const Evas_Object *obj); + +/** + * @brief Retrieves the row stride of the given image object. + * + * The row stride is the number of bytes between the start of a row and the + * start of the next row for image data. + * + * @return The stride of the image (in bytes). + * + * @ingroup Evas_Image + */ +EAPI int evas_object_image_stride_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT; + +/** + * @brief Mark 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. + * + * @param[in] y Y-offset of the region to be updated. + * @param[in] w Width of the region to be updated. + * @param[in] h Height of the region to be updated. + */ +EAPI void evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h); + /* * Converts the raw image data of the given image object to the * specified colorspace. diff --git a/src/lib/evas/canvas/evas_image.eo b/src/lib/evas/canvas/evas_image.eo index 42cfc12652..31acd3a79d 100644 --- a/src/lib/evas/canvas/evas_image.eo +++ b/src/lib/evas/canvas/evas_image.eo @@ -1,30 +1,11 @@ type @extern Evas_Object_Image_Pixels_Get_Cb: __undefined_type; /* FIXME: func pointers are not supported. */ -class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx.Fill, Efl.Gfx.View, Evas.Filter) +class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Load, Efl.Image_Animated, Efl.Gfx.Buffer, Efl.Gfx.Fill, Efl.Gfx.View, Evas.Filter) { legacy_prefix: evas_object_image; eo_prefix: evas_obj_image; methods { - @property load_dpi { - set { - [[Set the DPI resolution of an image object's source image. - - This function sets the DPI resolution of a given loaded canvas - image. Most useful for the SVG image loader. - ]] - } - get { - [[Get the DPI resolution of a loaded image object in the canvas. - - This function returns the DPI resolution of the given canvas - image. - ]] - } - values { - dpi: double; [[The DPI resolution.]] - } - } - + /* PROXY stuff */ @property source_clip { set { [[Clip the proxy object with the source object's clipper. @@ -71,149 +52,115 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. src: Evas.Object *; [[Source object to use for the proxy.]] } } - @property content_hint { + @property source_visible { set { - [[Set the content hint setting of a given image object of the - canvas. + [[Set the source object to be visible or not. - This function sets the content hint value of the given image - of the canvas. For example, if you're on the GL engine and - your driver implementation supports it, setting this hint to - #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies - at texture upload time, which is an "expensive" operation. - ]] - } - get { - [[Get the content hint setting of a given image object of the - canvas. + If $visible is set to $false, the source object of the + proxy ($obj) will be invisible. - This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error. - ]] - } - values { - hint: Evas.Image_Content_Hint; [[The content hint value, one of - the @Evas.Image_Content_Hint ones.]] - } - } - @property load_region { - set { - [[Inform a given image object to load a selective region of its - source image. + This API works differently to \@ref evas_object_show and + \@ref evas_object_hide. Once source object is hidden, the + proxy object will be hidden as well. Actually in this case + both objects are excluded from the Evas internal update circle. + + By this API, instead, one can toggle the visibility of a + proxy's source object remaining the proxy visibility untouched. - This function is useful when one is not showing all of an - image's area on its image object. + Warning: If the all of proxies are deleted, then the source + visibility of the source object will be cancelled. - Note: The image loader for the image format in question has - to support selective region loading in order to this function - to take effect. + @since 1.8 ]] } get { - [[Retrieve the coordinates of a given image object's selective - (source image) load region. + [[Get the state of the source object visibility. - Note: Use $null pointers on the coordinates you're not - interested in: they'll be ignored by the function. + @since 1.8 ]] } values { - x: int; [[X-offset of the region to be loaded.]] - y: int; [[Y-offset of the region to be loaded.]] - w: int; [[Width of the region to be loaded.]] - h: int; [[Height of the region to be loaded.]] + visible: bool; [[$true is source object to be shown, $false + otherwise.]] } } - @property alpha { + @property source_events { set { - [[Enable or disable 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 $true - makes it use alpha channel data, and $false makes it ignore - that data. Note that this has nothing to do with an object's - color as manipulated by \@ref evas_object_color_set. + [[Set whether an Evas object is to source events. + + Set whether an Evas object is to repeat events to source. + + If $source is $true, it will make events on $obj to also be + repeated for the source object (see @.source.set). Even the + $obj and source geometries are different, the event position + will be transformed to the source object's space. + + If $source is $false, events occurring on $obj will be + processed only on it. + + @since 1.8 ]] } get { - [[Retrieve whether alpha channel data is being used on the - given image object. + [[Determine whether an object is set to source events. - This function returns $true if the image object's alpha - channel is being used, or $false otherwise. + @since 1.8 ]] } values { - alpha: bool; [[Whether to use alpha channel ($true) data - or not ($false).]] + source: bool; [[Whether $obj is to pass events ($true) or not + ($false).]] } } - @property border { - set { - [[Set the dimensions for an image object's border, a region - which won't ever be scaled together with its center. - - When Evas is rendering, an image source may be scaled to fit - the size of its image object. This function sets an area from - the borders of the image inwards which is not to be scaled. - This function is useful for making frames and for widget - theming, where, for example, buttons may be of varying - sizes, but their border size must remain constant. - The units used for $l, $r, $t and $b are canvas units. - - Note: The border region itself may be scaled by the - @.border_scale.set function. + /* weird stuff - hints */ + @property content_hint { + set { + [[Set the content hint setting of a given image object of the + canvas. - Note: By default, image objects have no borders set, i. e. - $l, $r, $t and $b start as 0. + This function sets the content hint value of the given image + of the canvas. For example, if you're on the GL engine and + your driver implementation supports it, setting this hint to + #EVAS_IMAGE_CONTENT_HINT_DYNAMIC will make it need zero copies + at texture upload time, which is an "expensive" operation. ]] - /* FIXME-doc - See the following figures for visual explanation:\n - @htmlonly - <img src="image-borders.png" style="max-width: 100%;" /> - <a href="image-borders.png">Full-size</a> - @endhtmlonly - @image rtf image-borders.png - @image latex image-borders.eps width=\textwidth - @htmlonly - <img src="border-effect.png" style="max-width: 100%;" /> - <a href="border-effect.png">Full-size</a> - @endhtmlonly - @image rtf border-effect.png - @image latex border-effect.eps width=\textwidth - */ } get { - [[Retrieve the dimensions for an image object's border, a - region which won't ever be scaled together with its center. + [[Get the content hint setting of a given image object of the + canvas. - Note: Use $null pointers on the border components you're not - interested in: they'll be ignored by the function. + This returns #EVAS_IMAGE_CONTENT_HINT_NONE on error. ]] } values { - l: int; [[The border's left width.]] - r: int; [[The border's right width.]] - t: int; [[The border's top width.]] - b: int; [[The border's bottom width.]] + hint: Evas.Image_Content_Hint; [[The content hint value, one of + the @Evas.Image_Content_Hint ones.]] } } - @property border_scale { + @property scale_hint { set { - [[Sets the scaling factor (multiplier) for the borders of an - image object. + [[Set 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 will affect how Evas is to cache + scaled versions of its original source image. ]] } get { - [[Retrieves the scaling factor (multiplier) for the borders - of an image object. + [[Get 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. ]] } values { - scale: double; [[The scale factor (default is 1.0 - i.e. no scaling).]] + hint: Evas.Image_Scale_Hint; [[The scale hint, a value in + @Evas.Image_Scale_Hint.]] } } + + /* GL View */ @property pixels_dirty { set { [[Mark whether the given image object is dirty and needs to @@ -235,6 +182,21 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. dirty: bool; [[Whether the image is dirty.]] } } + @property pixels_get_callback { + set { + [[Set the callback function to get pixels from a canvas' image. + + This functions sets a function to be the callback function + that get pixels from a image of the canvas. + ]] + } + values { + func: Evas_Object_Image_Pixels_Get_Cb @nonull; [[The callback function.]] + data: void *; [[The data pointer to be passed to $func.]] + } + } + + /* Video */ @property video_surface { set { [[Set the video surface linked to a given image of the canvas. @@ -266,82 +228,8 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. caps: uint; } } - @property load_orientation { - set { - [[Define if the orientation information in the image file - should be honored. - - @since 1.1 - ]] - } - get { - [[Get if the orientation information in the image file should - be honored. - - @since 1.1 - ]] - } - values { - enable: bool; [[$true means that it should honor the orientation - information.]] - } - } - @property border_center_fill { - set { - [[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 @.border.set. This one is very useful - for making frames and decorations. You would most probably - also be using a filled image (as in @Efl.Gfx.Fill.filled) to use - as a frame. - ]] - } - get { - [[Retrieves how the center part of the given image object (not - the borders) is to be drawn when Evas is rendering it. - ]] - } - values { - fill: Evas.Border_Fill_Mode; [[Fill mode of the center region - of $obj (a value in #Evas_Border_Fill_Mode).]] - } - } - @property source_visible { - set { - [[Set the source object to be visible or not. - - If $visible is set to $false, the source object of the - proxy ($obj) will be invisible. - - This API works differently to \@ref evas_object_show and - \@ref evas_object_hide. Once source object is hidden, the - proxy object will be hidden as well. Actually in this case - both objects are excluded from the Evas internal update circle. - - By this API, instead, one can toggle the visibility of a - proxy's source object remaining the proxy visibility untouched. - Warning: If the all of proxies are deleted, then the source - visibility of the source object will be cancelled. - - @since 1.8 - ]] - } - get { - [[Get the state of the source object visibility. - - @since 1.8 - ]] - } - values { - visible: bool; [[$true is source object to be shown, $false - otherwise.]] - } - } + /* native surface */ @property native_surface { set { [[Set the native surface of a given image of the canvas @@ -361,103 +249,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. surf: Evas.Native_Surface* @nonull; [[The native surface.]] } } - @property load_scale_down { - set { - [[Set 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. Most useful for the SVG image loader. - ]] - } - get { - [[Get the scale down factor of a given image object's source - image, when loading it. - ]] - } - values { - scale_down: int; [[The scale down factor.]] - } - } - @property scale_hint { - set { - [[Set 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 will affect how Evas is to cache - scaled versions of its original source image. - ]] - } - get { - [[Get 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. - ]] - } - values { - hint: Evas.Image_Scale_Hint; [[The scale hint, a value in - @Evas.Image_Scale_Hint.]] - } - } - @property source_events { - set { - [[Set whether an Evas object is to source events. - - Set whether an Evas object is to repeat events to source. - - If $source is $true, it will make events on $obj to also be - repeated for the source object (see @.source.set). Even the - $obj and source geometries are different, the event position - will be transformed to the source object's space. - - If $source is $false, events occurring on $obj will be - processed only on it. - - @since 1.8 - ]] - } - get { - [[Determine whether an object is set to source events. - - @since 1.8 - ]] - } - values { - source: bool; [[Whether $obj is to pass events ($true) or not - ($false).]] - } - } - @property colorspace { - set { - [[Set the colorspace of a given image of the canvas. - - This function sets the colorspace of given canvas image. - ]] - } - get { - [[Get the colorspace of a given image of the canvas. - - This function returns the colorspace of given canvas image. - ]] - } - values { - cspace: Evas_Colorspace; [[The new color space.]] - } - } - @property pixels_get_callback { - set { - [[Set the callback function to get pixels from a canvas' image. - - This functions sets a function to be the callback function - that get pixels from a image of the canvas. - ]] - } - values { - func: Evas_Object_Image_Pixels_Get_Cb @nonull; [[The callback function.]] - data: void *; [[The data pointer to be passed to $func.]] - } - } @property data_copy { set { [[Replaces the raw image data of the given image object. @@ -482,38 +273,8 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. data: void *; [[The raw data to replace.]] } } - @property region_support { - get { - [[Get the support state of a given image. - - @since 1.2 - ]] - return: bool @warn_unused; [[The region support state.]] - } - } - @property load_error { - get { - [[Retrieves a number representing any error that occurred during - the last loading of the given image object's source image. - ]] - return: Evas.Load_Error @warn_unused; [[ - A value giving the last error that occurred. It should be - one of the @Evas.Load_Error values. #EVAS_LOAD_ERROR_NONE - is returned if there was no error. - ]] - } - } - @property stride { - get { - [[Retrieves the row stride of the given image object. - - The row stride is the number of bytes between the start of a - row and the start of the next row for image data. - ]] - return: int @warn_unused; [[The stride of the image (in bytes).]] - } - } + /* 3d */ @property scene { set { [[Set the 3D scene of a given image of the canvas. @@ -522,7 +283,7 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. @since 1.10 ]] - legacy: null; + legacy: null; } get { [[Get the 3D scene of a given image of the canvas. @@ -537,26 +298,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. scene: Evas.Canvas3D.Scene *; [[3D scene on an image object.]] } } - @property orient { - set { - [[Set the image orientation. - - This function allows to rotate or flip the image. - - @since 1.14 - ]] - } - get { - [[Get the image orientation. - - @since 1.14 - ]] - } - values { - orient: Evas.Image_Orient; [[The image orientation \@ref Evas_Image_Orient. - Default is #EVAS_IMAGE_ORIENT_NONE.]] - } - } @property snapshot { set { [[The content below the Evas_Object_Image will be rendered @@ -578,29 +319,12 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. the Evas_Object_Image.]] } } - preload_begin { - [[Begin preloading an image object's image data in the background.]] - legacy: null; - } - data_update_add { - [[Mark 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. - ]] - params { - @in x: int; [[X-offset of the region to be updated.]] - @in y: int; [[Y-offset of the region to be updated.]] - @in w: int; [[Width of the region to be updated.]] - @in h: int; [[Height of the region to be updated.]] - } - } data_set { [[Sets the raw image data of the given image object. Note that the raw data must be of the same size (see \@ref evas_object_image_size_set, which has to be called before - this one) and colorspace (see @.colorspace.set) of the image. + this one) and colorspace (see \@.colorspace.set) of the image. If data is $null, the current image data will be freed. Naturally, if one does not set an image object's data manually, it will still have one, allocated by Evas. @@ -627,7 +351,7 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. Note: The contents' format returned by it depend on the color space of the given image object. - Note: You may want to use @.data_update_add to inform data + Note: You may want to use \@.data_update_add to inform data changes, if you did any. ]] return: void * @warn_unused; [[ The raw image data.]] @@ -636,10 +360,6 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. be modified ($true) or not ($false).]] } } - preload_cancel { - [[Cancel preloading an image object's image data in the background.]] - legacy: null; - } } implements { Eo.Base.constructor; @@ -651,6 +371,19 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. Efl.File.mmap.set; Efl.File.mmap.get; Efl.File.save; + Efl.Image.orientation.get; + Efl.Image.orientation.set; + Efl.Image.alpha.get; + Efl.Image.alpha.set; + Efl.Image.smooth_scale.set; + Efl.Image.smooth_scale.get; + Efl.Image.ratio.get; + Efl.Image.border.get; + Efl.Image.border.set; + Efl.Image.border_scale.get; + Efl.Image.border_scale.set; + Efl.Image.border_center_fill.get; + Efl.Image.border_center_fill.set; Efl.Image_Animated.animated.get; Efl.Image_Animated.animated_frame.get; Efl.Image_Animated.animated_frame.set; @@ -658,11 +391,23 @@ class Evas.Image (Evas.Object, Efl.File, Efl.Image, Efl.Image_Animated, Efl.Gfx. Efl.Image_Animated.animated_loop_type.get; Efl.Image_Animated.animated_loop_count.get; Efl.Image_Animated.animated_frame_duration.get; - Efl.Image.load_size.set; - Efl.Image.load_size.get; - Efl.Image.smooth_scale.set; - Efl.Image.smooth_scale.get; - Efl.Image.ratio.get; + Efl.Image_Load.load_error.get; + Efl.Image_Load.load_async_start; + Efl.Image_Load.load_async_cancel; + Efl.Image_Load.load_dpi.get; + Efl.Image_Load.load_dpi.set; + Efl.Image_Load.load_size.set; + Efl.Image_Load.load_size.get; + Efl.Image_Load.load_orientation.get; + Efl.Image_Load.load_orientation.set; + Efl.Image_Load.load_scale_down.get; + Efl.Image_Load.load_scale_down.set; + Efl.Image_Load.load_region.get; + Efl.Image_Load.load_region.set; + Efl.Image_Load.load_region_support.get; + Efl.Gfx.Buffer.buffer_update_region_add; + Efl.Gfx.Buffer.buffer_stride.get; + Efl.Gfx.Buffer.colorspace.get; Efl.Gfx.Fill.fill.set; Efl.Gfx.Fill.fill.get; Efl.Gfx.Fill.filled.get; diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 60802326b1..10fa5e8208 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -17,7 +17,6 @@ #include "../common/evas_convert_colorspace.h" #include "../common/evas_convert_yuv.h" -#include "../efl/interfaces/efl_gfx_filter.eo.h" #include "evas_filter.eo.h" #include "evas_filter.h" @@ -662,9 +661,10 @@ _evas_image_source_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) } EOLIAN static void -_evas_image_orient_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orient orient) +_evas_image_efl_image_orientation_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Orientation _orient) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); + Evas_Image_Orient orient = (Evas_Image_Orient) _orient; int iw, ih; if (o->cur->orient == orient) return; @@ -710,10 +710,10 @@ _evas_image_orient_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Image_Orient orient) evas_object_change(eo_obj, obj); } -EOLIAN static Evas_Image_Orient -_evas_image_orient_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +EOLIAN static Efl_Gfx_Orientation +_evas_image_efl_image_orientation_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { - return o->cur->orient; + return (Efl_Gfx_Orientation) o->cur->orient; } EAPI Eina_Bool @@ -792,7 +792,7 @@ _evas_image_eo_base_dbg_info_get(Eo *eo_obj, Evas_Image_Data *o, Eo_Dbg_Info *ro if (evas_object_image_load_error_get(eo_obj) != EVAS_LOAD_ERROR_NONE) { Evas_Load_Error error = EVAS_LOAD_ERROR_GENERIC; - error = evas_obj_image_load_error_get(eo_obj); + error = (Evas_Load_Error) efl_image_load_error_get(eo_obj); EO_DBG_INFO_APPEND(group, "Load Error", EINA_VALUE_TYPE_STRING, evas_load_error_str(error)); } @@ -862,7 +862,7 @@ _evas_image_scene_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) } EOLIAN static void -_evas_image_border_set(Eo *eo_obj, Evas_Image_Data *o, int l, int r, int t, int b) +_evas_image_efl_image_border_set(Eo *eo_obj, Evas_Image_Data *o, int l, int r, int t, int b) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); @@ -889,7 +889,7 @@ _evas_image_border_set(Eo *eo_obj, Evas_Image_Data *o, int l, int r, int t, int } EOLIAN static void -_evas_image_border_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *l, int *r, int *t, int *b) +_evas_image_efl_image_border_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *l, int *r, int *t, int *b) { if (l) *l = o->cur->border.l; if (r) *r = o->cur->border.r; @@ -898,9 +898,11 @@ _evas_image_border_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *l, int * } EOLIAN static void -_evas_image_border_center_fill_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Border_Fill_Mode fill) +_evas_image_efl_image_border_center_fill_set(Eo *eo_obj, Evas_Image_Data *o, Efl_Gfx_Border_Fill_Mode _fill) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); + Evas_Border_Fill_Mode fill = (Evas_Border_Fill_Mode) _fill; + if (fill == o->cur->border.fill) return; evas_object_async_block(obj); EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, state_write) @@ -911,10 +913,10 @@ _evas_image_border_center_fill_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Border_F evas_object_change(eo_obj, obj); } -EOLIAN static Evas_Border_Fill_Mode -_evas_image_border_center_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +EOLIAN static Efl_Gfx_Border_Fill_Mode +_evas_image_efl_image_border_center_fill_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { - return o->cur->border.fill; + return (Efl_Gfx_Border_Fill_Mode) o->cur->border.fill; } EOLIAN static void @@ -950,7 +952,7 @@ _evas_image_efl_gfx_fill_filled_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) } EOLIAN static void -_evas_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale) +_evas_image_efl_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); @@ -965,19 +967,11 @@ _evas_image_border_scale_set(Eo *eo_obj, Evas_Image_Data *o, double scale) } EOLIAN static double -_evas_image_border_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_image_border_scale_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { return o->cur->border.scale; } -EAPI void -evas_object_image_fill_set(Evas_Image *obj, - Evas_Coord x, Evas_Coord y, - Evas_Coord w, Evas_Coord h) -{ - efl_gfx_fill_set((Evas_Image *)obj, x, y, w, h); -} - EOLIAN static void _evas_image_efl_gfx_fill_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) @@ -1083,12 +1077,6 @@ _evas_image_efl_gfx_view_view_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, in evas_object_change(eo_obj, obj); } -EAPI void -evas_object_image_size_get(const Evas_Image *obj, int *w, int *h) -{ - efl_gfx_view_size_get((Evas_Image *)obj, w, h); -} - EOLIAN static void _evas_image_efl_gfx_view_view_size_get(Eo *eo_obj, Evas_Image_Data *o, int *w, int *h) { @@ -1132,15 +1120,15 @@ _evas_image_efl_gfx_view_view_size_get(Eo *eo_obj, Evas_Image_Data *o, int *w, i } EOLIAN static int -_evas_image_stride_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_gfx_buffer_buffer_stride_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { - return o->cur->image.stride;; + return o->cur->image.stride; } -EOLIAN static Evas_Load_Error -_evas_image_load_error_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +EOLIAN static Efl_Image_Load_Error +_evas_image_efl_image_load_load_error_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { - return o->load_error; + return (Efl_Image_Load_Error) o->load_error; } /* deprecated */ @@ -1311,18 +1299,6 @@ _evas_image_data_get(const Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED, Eina_Bo return data; } -EAPI void -evas_object_image_preload(Evas_Object *eo_obj, Eina_Bool cancel) -{ - MAGIC_CHECK(eo_obj, Evas_Object, MAGIC_OBJ); - return; - MAGIC_CHECK_END(); - if (cancel) - evas_obj_image_preload_cancel(eo_obj); - else - evas_obj_image_preload_begin(eo_obj); -} - static void _image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel) { @@ -1356,7 +1332,7 @@ _image_preload_internal(Eo *eo_obj, void *_pd, Eina_Bool cancel) } EOLIAN static void -_evas_image_preload_begin(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) +_evas_image_efl_image_load_load_async_start(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); evas_object_async_block(obj); @@ -1364,7 +1340,7 @@ _evas_image_preload_begin(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) } EOLIAN static void -_evas_image_preload_cancel(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) +_evas_image_efl_image_load_load_async_cancel(Eo *eo_obj, Evas_Image_Data *_pd EINA_UNUSED) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); evas_object_async_block(obj); @@ -1417,7 +1393,7 @@ _evas_image_data_copy_set(Eo *eo_obj, Evas_Image_Data *o, void *data) } EOLIAN static void -_evas_image_data_update_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) +_evas_image_efl_gfx_buffer_buffer_update_region_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Eina_Rectangle *r; @@ -1460,7 +1436,7 @@ _evas_image_data_update_add(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, } EOLIAN static void -_evas_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha) +_evas_image_efl_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); @@ -1506,7 +1482,7 @@ _evas_image_alpha_set(Eo *eo_obj, Evas_Image_Data *o, Eina_Bool has_alpha) } EOLIAN static Eina_Bool -_evas_image_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_image_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { return o->cur->has_alpha; } @@ -1868,7 +1844,7 @@ _evas_image_pixels_dirty_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) } EOLIAN static void -_evas_image_load_dpi_set(Eo *eo_obj, Evas_Image_Data *o, double dpi) +_evas_image_efl_image_load_load_dpi_set(Eo *eo_obj, Evas_Image_Data *o, double dpi) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if (dpi == o->load_opts->dpi) return; @@ -1888,13 +1864,13 @@ _evas_image_load_dpi_set(Eo *eo_obj, Evas_Image_Data *o, double dpi) } EOLIAN static double -_evas_image_load_dpi_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_image_load_load_dpi_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { return o->load_opts->dpi; } EOLIAN static void -_evas_image_efl_image_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h) +_evas_image_efl_image_load_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if ((o->load_opts->w == w) && (o->load_opts->h == h)) return; @@ -1918,14 +1894,14 @@ _evas_image_efl_image_load_size_set(Eo *eo_obj, Evas_Image_Data *o, int w, int h } EOLIAN static void -_evas_image_efl_image_load_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h) +_evas_image_efl_image_load_load_size_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *w, int *h) { if (w) *w = o->load_opts->w; if (h) *h = o->load_opts->h; } EOLIAN static void -_evas_image_load_scale_down_set(Eo *eo_obj, Evas_Image_Data *o, int scale_down) +_evas_image_efl_image_load_load_scale_down_set(Eo *eo_obj, Evas_Image_Data *o, int scale_down) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if (o->load_opts->scale_down_by == scale_down) return; @@ -1945,13 +1921,13 @@ _evas_image_load_scale_down_set(Eo *eo_obj, Evas_Image_Data *o, int scale_down) } EOLIAN static int -_evas_image_load_scale_down_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_image_load_load_scale_down_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { return o->load_opts->scale_down_by; } EOLIAN static void -_evas_image_load_region_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) +_evas_image_efl_image_load_load_region_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if ((o->load_opts->region.x == x) && (o->load_opts->region.y == y) && @@ -1977,7 +1953,7 @@ _evas_image_load_region_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, } EOLIAN static void -_evas_image_load_region_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *x, int *y, int *w, int *h) +_evas_image_efl_image_load_load_region_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *x, int *y, int *w, int *h) { if (x) *x = o->load_opts->region.x; if (y) *y = o->load_opts->region.y; @@ -1986,7 +1962,7 @@ _evas_image_load_region_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, int *x, } EOLIAN static void -_evas_image_load_orientation_set(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, Eina_Bool enable) +_evas_image_efl_image_load_load_orientation_set(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, Eina_Bool enable) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if (o->load_opts->orientation == !!enable) return; @@ -1998,15 +1974,17 @@ _evas_image_load_orientation_set(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o, Ein } EOLIAN static Eina_Bool -_evas_image_load_orientation_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +_evas_image_efl_image_load_load_orientation_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { return o->load_opts->orientation;; } -EOLIAN static void -_evas_image_colorspace_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace cspace) +/* FIXME: This should be deprecated and a legacy binding for pixel_set should be added */ +EAPI void +evas_object_image_colorspace_set(Evas_Object *eo_obj, Evas_Colorspace cspace) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); + Evas_Image_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); evas_object_async_block(obj); _evas_object_image_cleanup(eo_obj, obj, o); @@ -2019,10 +1997,10 @@ _evas_image_colorspace_set(Eo *eo_obj, Evas_Image_Data *o, Evas_Colorspace cspac ENFN->image_colorspace_set(ENDT, o->engine_data, cspace); } -EOLIAN static Evas_Colorspace -_evas_image_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) +EOLIAN static Efl_Gfx_Colorspace +_evas_image_efl_gfx_buffer_colorspace_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) { - return o->cur->cspace; + return (Efl_Gfx_Colorspace) o->cur->cspace; } EOLIAN static void @@ -2243,14 +2221,11 @@ _evas_image_content_hint_get(Eo *eo_obj EINA_UNUSED, Evas_Image_Data *o) } EOLIAN static Eina_Bool -_evas_image_region_support_get(Eo *eo_obj, Evas_Image_Data *o) +_evas_image_efl_image_load_load_region_support_get(Eo *eo_obj, Evas_Image_Data *o) { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); - Eina_Bool region; - region = ENFN->image_can_region_get(ENDT, o->engine_data); - - return region; + return ENFN->image_can_region_get(ENDT, o->engine_data); } /* animated feature */ @@ -4887,15 +4862,32 @@ evas_object_image_filled_add(Evas *eo_e) } EAPI void -evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value) +evas_object_image_fill_set(Evas_Image *obj, + Evas_Coord x, Evas_Coord y, + Evas_Coord w, Evas_Coord h) { - efl_gfx_fill_filled_set(eo_obj, value); + efl_gfx_fill_set((Evas_Image *)obj, x, y, w, h); +} + +EAPI void +evas_object_image_preload(Evas_Object *eo_obj, Eina_Bool cancel) +{ + if (cancel) + efl_image_load_async_cancel(eo_obj); + else + efl_image_load_async_start(eo_obj); } EAPI Eina_Bool evas_object_image_filled_get(const Evas_Object *eo_obj) { - return efl_gfx_fill_filled_get((Eo *) eo_obj); + return efl_gfx_fill_filled_get(eo_obj); +} + +EAPI void +evas_object_image_filled_set(Evas_Object *eo_obj, Eina_Bool value) +{ + efl_gfx_fill_filled_set(eo_obj, value); } EAPI void @@ -4903,7 +4895,7 @@ evas_object_image_fill_get(const Evas_Image *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { - efl_gfx_fill_get((Evas_Image *)obj, x, y, w, h); + efl_gfx_fill_get(obj, x, y, w, h); } EAPI void @@ -4921,45 +4913,117 @@ evas_object_image_fill_spread_get(const Evas_Image *obj EINA_UNUSED) } EAPI void +evas_object_image_alpha_set(Evas_Object *obj, Eina_Bool alpha) +{ + efl_image_alpha_set(obj, alpha); +} + +EAPI Eina_Bool +evas_object_image_alpha_get(const Evas_Object *obj) +{ + return efl_image_alpha_get(obj); +} + +EAPI void +evas_object_image_border_set(Evas_Object *obj, int l, int r, int t, int b) +{ + efl_image_border_set(obj, l, r, t, b); +} + +EAPI void +evas_object_image_border_get(const Evas_Object *obj, int *l, int *r, int *t, int *b) +{ + efl_image_border_get(obj, l, r, t, b); +} + +EAPI void +evas_object_image_border_scale_set(Evas_Object *obj, double scale) +{ + efl_image_border_scale_set(obj, scale); +} + +EAPI double +evas_object_image_border_scale_get(const Evas_Object *obj) +{ + return efl_image_border_scale_get(obj); +} + +EAPI void +evas_object_image_border_center_fill_set(Evas_Object *obj, Evas_Border_Fill_Mode fill) +{ + efl_image_border_center_fill_set(obj, (Efl_Gfx_Border_Fill_Mode) fill); +} + +EAPI Evas_Border_Fill_Mode +evas_object_image_border_center_fill_get(const Evas_Object *obj) +{ + return (Evas_Border_Fill_Mode) efl_image_border_center_fill_get(obj); +} + +EAPI void +evas_object_image_size_get(const Evas_Image *obj, int *w, int *h) +{ + efl_gfx_view_size_get((Evas_Image *)obj, w, h); +} + +EAPI void evas_object_image_size_set(Evas_Image *obj, int w, int h) { - efl_gfx_view_size_set((Evas_Image *)obj, w, h); + efl_gfx_view_size_set(obj, w, h); +} + +EAPI Evas_Colorspace +evas_object_image_colorspace_get(const Evas_Object *obj) +{ + return (Evas_Colorspace) efl_gfx_buffer_colorspace_get(obj); +} + +EAPI int +evas_object_image_stride_get(const Evas_Object *obj) +{ + return efl_gfx_buffer_stride_get(obj); +} + +EAPI void +evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) +{ + efl_gfx_buffer_update_region_add(obj, x, y, w, h); } EAPI void evas_object_image_file_set(Eo *obj, const char *file, const char *key) { - efl_file_set((Eo *) obj, file, key); + efl_file_set(obj, file, key); } EAPI void evas_object_image_file_get(const Eo *obj, const char **file, const char **key) { - efl_file_get((Eo *) obj, file, key); + efl_file_get(obj, file, key); } EAPI void evas_object_image_mmap_set(Evas_Image *obj, const Eina_File *f, const char *key) { - efl_file_mmap_set((Evas_Image *)obj, f, key); + efl_file_mmap_set(obj, f, key); } EAPI void evas_object_image_mmap_get(const Evas_Image *obj, const Eina_File **f, const char **key) { - efl_file_mmap_get((Evas_Image *)obj, f, key); + efl_file_mmap_get(obj, f, key); } EAPI Eina_Bool evas_object_image_save(const Eo *obj, const char *file, const char *key, const char *flags) { - return efl_file_save((Eo *) obj, file, key, flags); + return efl_file_save(obj, file, key, flags); } EAPI Eina_Bool evas_object_image_animated_get(const Eo *obj) { - return efl_image_animated_get((Eo *) obj); + return efl_image_animated_get(obj); } EAPI void @@ -4995,25 +5059,97 @@ evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_ EAPI void evas_object_image_load_size_set(Eo *obj, int w, int h) { - efl_image_load_size_set((Eo *) obj, w, h); + efl_image_load_size_set(obj, w, h); } EAPI void evas_object_image_load_size_get(const Eo *obj, int *w, int *h) { - efl_image_load_size_get((Eo *) obj, w, h); + efl_image_load_size_get(obj, w, h); +} + +EAPI void +evas_object_image_load_dpi_set(Evas_Object *obj, double dpi) +{ + efl_image_load_dpi_set(obj, dpi); +} + +EAPI double +evas_object_image_load_dpi_get(const Evas_Object *obj) +{ + return efl_image_load_dpi_get(obj); +} + +EAPI void +evas_object_image_load_region_set(Evas_Object *obj, int x, int y, int w, int h) +{ + efl_image_load_region_set(obj, x, y, w, h); +} + +EAPI void +evas_object_image_load_region_get(const Evas_Object *obj, int *x, int *y, int *w, int *h) +{ + efl_image_load_region_get(obj, x, y, w, h); +} + +EAPI Eina_Bool +evas_object_image_region_support_get(const Evas_Image *obj) +{ + return efl_image_load_region_support_get(obj); +} + +EAPI void +evas_object_image_load_orientation_set(Evas_Object *obj, Eina_Bool enable) +{ + efl_image_load_orientation_set(obj, enable); +} + +EAPI Eina_Bool +evas_object_image_load_orientation_get(const Evas_Object *obj) +{ + return efl_image_load_orientation_get(obj); +} + +EAPI void +evas_object_image_load_scale_down_set(Evas_Object *obj, int scale_down) +{ + efl_image_load_scale_down_set(obj, scale_down); +} + +EAPI int +evas_object_image_load_scale_down_get(const Evas_Object *obj) +{ + return efl_image_load_scale_down_get(obj); +} + +EAPI Evas_Load_Error +evas_object_image_load_error_get(const Evas_Object *obj) +{ + return (Evas_Load_Error) efl_image_load_error_get(obj); } EAPI void evas_object_image_smooth_scale_set(Eo *obj, Eina_Bool smooth_scale) { - efl_image_smooth_scale_set((Eo *) obj, smooth_scale); + efl_image_smooth_scale_set(obj, smooth_scale); } EAPI Eina_Bool evas_object_image_smooth_scale_get(const Eo *obj) { - return efl_image_smooth_scale_get((Eo *) obj); + return efl_image_smooth_scale_get(obj); +} + +EAPI void +evas_object_image_orient_set(Evas_Image *obj, Evas_Image_Orient orient) +{ + efl_image_orientation_set(obj, (Efl_Gfx_Orientation) orient); +} + +EAPI Evas_Image_Orient +evas_object_image_orient_get(const Evas_Image *obj) +{ + return (Evas_Image_Orient) efl_image_orientation_get(obj); } #include "canvas/evas_image.eo.c" |