Commit Graph

9 Commits

Author SHA1 Message Date
Jean-Philippe Andre ac8140ccd1 Evas filters: Rename RGBA_Image::mask.data into image.data8
The structure should not be changed, despite the union modification.

I am renaming for consistency with older branches that had a mask
field in RGBA_Image. Also, the mask.data or data8 is really just
a way to avoid casting between DATA8 and DATA32 (and it shows
clearly what kind of data you are dealing with).
2014-03-04 12:10:29 +09:00
Jean-Philippe Andre 3819bc7abb Evas filters: Implement "fillmode" for displace
The fillmode (stretch or repeat map) was present and documented
for displace, but not implemented. Easy copy & paste from the
mask filter.
2014-02-18 10:22:50 +09:00
Jean-Philippe Andre d70b805e6d Evas filters: Fix crash in displace filter
Simplify and fix map traversal code
2014-02-18 10:22:49 +09:00
Jean-Philippe Andre 7cc7af14b8 Evas filters: Fix alpha in displacement filter
If the displacement map has some alpha values (not 0xFF),
then the blending should take this alpha into account. This
part is fine.

BUT, since Evas relies on premultiplied colors... we have a
problem: R (dx) and G (dy) have already been scaled down.

Actually we would need to load the map in non premultiplied RGBA,
otherwise we'll lose precision on dx,dy as soon as A != 0xFF.
Well... I guess this will be a limitation of this filter, for now
at least. Most displacement maps shouldn't even have any alpha
anyways.
2014-02-17 10:14:11 +09:00
Jean-Philippe Andre 9472e03546 Evas filters: Fix RGBA displacement filter
Well... it was just broken: typo, lack of normalization on alpha,
invalid formula for blending. Duh!
2014-02-17 10:02:19 +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 0ad8b02c16 Evas filters: Fix compilation after merge from master
- CRIT becomes CRI
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