Commit Graph

24488 Commits

Author SHA1 Message Date
Jean-Philippe Andre 388a30950a Evas filters: Add padding info to filter runtime context 2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 8441290767 Evas filters: Add support for displacement map alpha
Not tested yet!
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre e7a67dd13b Evas filters: Remove complicated displacement flags
The displacement effect is way too complicated. Let's keep it
simple and have only one displacement map format (RG + Alpha).

Here's what's missing now:
- Alpha support, to blend in the input with a variable intensity
- Extra padding (see below)

Also, the intensity VS. map values are not perfectly defined yet.

Problems: How to create a complete mirror effect (map needs to go
over boundaries... add extra padding to the buffers).
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre b54eb40006 Evas filters: Optimize Text redraw with filters
Fix case when a proxy source has changed: need to fully render
the effect again.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 7a53d39304 Evas filters: Factorize blend map logic 2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 40fd036d8d Evas filters: Implement fill mode in blend
None, repeat (x,y) and stretch (x,y) are now working for RGBA
blending. The same logic shall be applied to alpha as well.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre df60cd30c0 Evas filters: Start implementing stretch for blend
The fillmode is ignored when blending... for now.
First, implement none and stretch options for RGBA.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 12ddad2867 Evas filters: Reuse output buffer in Text object
This is the first possible optimization: save the rendered
text (since we already have the output buffer anyways), and
reuse it if the text + filter didn't change.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 2da17927da Evas filters: Implement fill with padding
Add parameters l, r, t, b to clip the fill area.
While l=x and t=y, the width and height of the clip are determined
at filter run-time, since we don't know the buffer size before.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre b5b6f6ef3c Evas filters: Fix padding in blur with offset
If ox, oy were set, the padding was wrong in blur.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 82032d494f Evas filters: Implement curve script API
Currently supports interpolation modes "none" and "linear".
Cubic interpolation is not implemented yet.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 7000907cd3 Evas filters: Move scaling to a common file
NOTE: Alpha scaling is NOT supported.
It could be faked in 3 expensive steps:
1. Draw to RGBA
2. Scale RGBA
3. Draw to Alpha.
2014-02-07 17:33:17 +09:00
Jean-Philippe Andre 40bb984b42 Evas filters: Implement mask stretch in RGBA blend
Brutal method for now: allocate YET ANOTHER buffer,
render scaled image to it (smooth scaling, oh yeah),
use this as a new mask.

For now, supports:
Alpha Input, RGBA mask, RGBA output, X,Y,XY stretching
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 9623e1f238 Evas filters: Pass fillmode to the filters
I just need to actually implement them, now :)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre a87ef5735d Evas filters: Introduce "fill" mode in script API
This would mean: repeat (X,Y) or stretch (X,Y), for buffer
operations where it means something (blend, bump, ...)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 37eb6b6233 Evas filters: Change default buffer size to input size
This should make more commands work intuitively.
Now we still need to specify how to repeat or stretch buffers
when running commands.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 78a3eaaecd Evas filters: Change buffer creation API in script
Syntax was: buffer(name=bla,alpha=bool);
Changed to: buffer:bla(alpha);

There's a semicolon between buffer and its name because ALL whitespaces
are discarded. This might prove useful sometime in the future, so let's
keep it this way for now :)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 7fbbf9eabe Evas filters: Use common color parse function 2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 0ad8b02c16 Evas filters: Fix compilation after merge from master
- CRIT becomes CRI
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre f723d8af8f Evas filters: Fix automatic buffers with Evas_Object_Text 2014-02-07 17:33:16 +09:00
Jean-Philippe Andre c0996b0669 Evas filters: Reduce padding to the minimum acceptable
Padding was brutally calculated by suming ALL the filters'
individual paddings. Now we try to be a bit smarter and propagate
the padding between buffers in the filter chain.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 22b8377255 Evas filters: Rename Text's special_effect into filter_chain
For consistency with Textblock.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 9da4789b66 Evas filters: Disable styles when filter_chain is set
Since the default theme includes a dark shadow behind normal
lines text (white on dark grey), we need to skip those when using
a filter program.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 109894bb56 Evas filters: Add fill command
This will simply clear the target buffer with the specified color.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 0a450b3ace Evas filters: Fix blur with small buffers
If the buffer is smaller than the blur kernel, then artifacts appear
and CRASHES happen because we read/write out of the buffer bounds.

Output buffer must be larger than the kernel diameter.
Input buffer's size is used to reduce the blurring effect on the edges.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 91e20084c1 Evas filters: Clear buffers after allocation
malloc() and mmap() don't return empty buffers, so blending on top
will present tons of artifacts.
Visible mostly on very small buffers as they are malloc()'ed from
previously used memory segments.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre aa945c25e0 Evas filters: Use strcasecmp in the parser
We don't care about the case for our language.
EVEN for buffer names, so beware :)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre a5abbf784e Evas filters: Add basic support for clip in blend
Right now, clip is used only when blending RGBA surfaces.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre a0634dc04e Evas filters: Allow empty commands
If an instruction line contains only ';', skip it.
This is a convenience for Textblock and C++ style comments.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 0450e027e7 Evas filters: Add Eo APIs and some comments
The entry points on evas text are there!
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 98f745d140 Evas filters: Add all filters to Makefile
Compile the following evas_filter files:
- evas_filter.c
- blend.c
- blur.c
- bump.c
- curve.c
- displace.c
- mask.c
- parser.c
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 5e78ce5eeb Evas filters: Implement style parser
So, the (font) effects will be described by a string. It's
basically a new language (yeah yeah sorry), VERY simple, based
on function calls a la Python, with sequential and named arguments.

This string is intended to be passed directly to an evas text object
and embedded into the evas textblock's markup tags.

This file implements both the basic parsing functions, the
compilation of instructions into a queue of commands, and the glue
code for the rest of the filter infrastructure.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre d7ed901ffd Evas filters: Implement bump maps
These bump maps implement two light effects at once:
- 3D Shadows
- Specular lights

The specular light is activated by a flag.
Another flag enables compensation for darkening/whitening of
horizontal surfaces.

NOTE: This implementation is VERY SLOW.
It uses double values and divisions all over the place.
It might be possible to optimize by computing two LUTs before
running the algorithm.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 40c7f90bdc Evas filters: Implement displacement maps
Displacement maps are a simple but powerful tool to move pixels
around in a buffer, based on a displacement map (image).

Currently, various modes are implemented:
- X, Y or XY displacement
- Alpha map or RGBA map where R and G only are used

An intensity parameter is given as well.

Some of these might not be useful, we can just strip them off when
the final API is decided.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 6458df7a65 Evas filters: Implement color curves filter
Color curves are a very simple tool to alter the colors of an image,
on a per-pixel basis. This implementation will simply map each pixel
to a 256 bytes buffer, provided by the application.

NOTE: There are no convenience functions yet for easy curve
generation, but this is the plan (give point A, B, B and interpolate
between them to generate the 256 values array).
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 84caa5902e Evas filters: Implement blur functions
Currently supported:
- Box blur for Alpha and RGBA
- Gaussian blur for Alpha and RGBA

Motion blur is not implemented.

These effects are SLOW. Gaussian blur is based on a true gaussian
curve for small radii, or a sine-based approximation.
The true gaussian might need to be removed for consistency, since
it gives slightly different results from the sine one (less blur).

It is not possible to mix Alpha and RGBA surfaces in this filter.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 65d779c7a3 Evas filters: Implement other masking functions
These functions differ from normal blending as they will use
a mask on top of input and output buffers.
So, basically they blend input+mask into a third buffer output.

If output is RGBA then mask or input MUST be RGBA.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 3f0f703f50 Evas filters: Implement blend functions
Currently, blending supports the following:
- Alpha --> Alpha (simple alpha masking)
- Alpha + Color --> RGBA (same as mask)
- RGBA --> RGBA (normal blend)
- RGBA --> Alpha (desaturate using A=(R+G+B)/3)
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre af106ffc81 Evas filters: Import main implementation file
evas_filter.c contains the entry points for the evas filters subsystem,
in particular, the filter API, the (yet very basic) buffer management
system, the command queue and main context handling functions.

Right now, the Evas engine is left untouched, so these implementations
will work ONLY in the software engine.

NOTE: This will not compile on its own (thus, not added to Makefile.am),
as it will require the filter implementations to be linked.
2014-02-07 17:33:16 +09:00
Jean-Philippe Andre 5a06208230 Evas filters: Import main header file
evas_filter.h contains the API declarations for the internal
Evas Filter module: enums, functions and some documentation.
2014-02-07 17:33:16 +09:00
Carsten Haitzler dc9d37de0b ecore-x xpresent - fix build if you DONT have xpresent there. 2014-02-07 17:33:01 +09:00
Doyoun Kang 50b941f907 ecore_x: added @since comment about ecore_x_e_illume_window_state_send
Reviewers: seoz

CC: zmike, cedric, raster

Differential Revision: https://phab.enlightenment.org/D526
2014-02-07 17:06:22 +09:00
Jean-Philippe Andre 9adbbe0bd1 Evas fonts: Pass RGBA_Image instead of DATA32 buffer
Since we want to be able to draw to alpha buffers, it's
easier if we pass the whole image struct instead of just
the data pointer.
2014-02-07 15:38:43 +09:00
Jean-Philippe Andre 160d012559 Evas text utils: Check syntax in color parse
If the color string is not correct (ie. not #RRGGBBAA, #RGBA, #RGB, #RRGGBB),
return an error.
2014-02-07 15:38:42 +09:00
Jean-Philippe Andre 2928a2d2da Evas: Move _format_color_parse to common file
This (simple) code should be shared between Textblock and Filters.
2014-02-07 15:38:42 +09:00
Jean-Philippe Andre d8301fae6e Evas: Add support for Alpha buffers
Evas is an RGBA only engine, BUT we also use some alpha masks,
especially in the font rendering pipeline.
This commit adds basic support for alpha buffer operations
(blend and copy).

RGBA_Image can then point to either alpha-only data, if
its colorspace is grey.
2014-02-07 15:38:42 +09:00
Jaehwan Kim 71c7d0e9ad ecore_x: Add ECORE_X_ATOM_E_ILLUME_ACCESS_ACTION_OVER.
This Atom is for accessibility.
In the touch screen, when the finger moves continuously, it is uesd.
2014-02-07 14:51:28 +09:00
ChunEon Park 5efa4f9305 evas/common - code refactoring.
tiny change for readibility.
2014-02-07 13:39:11 +09:00
Doyoun Kang 541ef547ab ecore_x: Added API - ecore_x_e_illume_window_state_send
Summary:
there exists ecore_x_e_illume_window_state_set and ecore_x_e_illume_window_state_get,
but no ecore_x_e_illume_window_state_send.

Reviewers: raster, seoz, cedric

Reviewed By: seoz

CC: cedric, seoz

Differential Revision: https://phab.enlightenment.org/D512
2014-02-07 13:05:00 +09:00
Vincent Torri b1954cc74d autotools: use libevil libdl implementation.
Signed-off-by: Cedric BAIL <cedric.bail@samsung.com>
2014-02-07 12:56:37 +09:00