summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c')
-rw-r--r--src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c b/src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c
new file mode 100644
index 0000000000..aa726b41a7
--- /dev/null
+++ b/src/lib/evas/common/evas_op_mask/op_mask_pixel_color_.c
@@ -0,0 +1,96 @@
1/* mask pixel x color --> dst */
2
3static void
4_op_mask_p_c_dp(DATA32 *s, DATA8 *m EINA_UNUSED, DATA32 c, DATA32 *d, int l) {
5 DATA32 *e = d + l;
6 l = 1 + (c >> 24);
7 while (d < e) {
8 c = 1 + ((l * (*s >> 24)) >> 8);
9 *d = MUL_256(c, *d);
10 s++; d++;
11 }
12}
13
14#define _op_mask_pas_c_dp _op_mask_p_c_dp
15#define _op_mask_pan_c_dp _op_mask_p_c_dp
16#define _op_mask_p_can_dp _op_mask_p_c_dp
17#define _op_mask_pas_can_dp _op_mask_p_c_dp
18#define _op_mask_p_caa_dp _op_mask_p_c_dp
19#define _op_mask_pas_caa_dp _op_mask_p_c_dp
20#define _op_mask_pan_caa_dp _op_mask_p_c_dp
21
22#define _op_mask_p_c_dpan _op_mask_p_c_dp
23#define _op_mask_pas_c_dpan _op_mask_p_c_dp
24#define _op_mask_pan_c_dpan _op_mask_p_c_dp
25#define _op_mask_p_can_dpan _op_mask_p_c_dp
26#define _op_mask_pas_can_dpan _op_mask_p_c_dp
27#define _op_mask_p_caa_dpan _op_mask_p_c_dp
28#define _op_mask_pas_caa_dpan _op_mask_p_c_dp
29#define _op_mask_pan_caa_dpan _op_mask_p_c_dp
30
31static void
32init_mask_pixel_color_span_funcs_c(void)
33{
34 op_mask_span_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mask_p_c_dp;
35 op_mask_span_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mask_pas_c_dp;
36 op_mask_span_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mask_pan_c_dp;
37 op_mask_span_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mask_p_can_dp;
38 op_mask_span_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mask_pas_can_dp;
39 op_mask_span_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mask_p_caa_dp;
40 op_mask_span_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mask_pas_caa_dp;
41 op_mask_span_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mask_pan_caa_dp;
42
43 op_mask_span_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mask_p_c_dpan;
44 op_mask_span_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mask_pas_c_dpan;
45 op_mask_span_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mask_pan_c_dpan;
46 op_mask_span_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_p_can_dpan;
47 op_mask_span_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pas_can_dpan;
48 op_mask_span_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_p_caa_dpan;
49 op_mask_span_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pas_caa_dpan;
50 op_mask_span_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pan_caa_dpan;
51}
52
53static void
54_op_mask_pt_p_c_dp(DATA32 s, DATA8 m EINA_UNUSED, DATA32 c, DATA32 *d) {
55 c = 1 + ((((c >> 24) * (s >> 24)) + 255) >> 8);
56 *d = MUL_256(c, *d);
57}
58
59#define _op_mask_pt_pas_c_dp _op_mask_pt_p_c_dp
60#define _op_mask_pt_pan_c_dp _op_mask_pt_p_c_dp
61#define _op_mask_pt_p_can_dp _op_mask_pt_p_c_dp
62#define _op_mask_pt_pas_can_dp _op_mask_pt_p_c_dp
63#define _op_mask_pt_p_caa_dp _op_mask_pt_p_c_dp
64#define _op_mask_pt_pas_caa_dp _op_mask_pt_p_c_dp
65#define _op_mask_pt_pan_caa_dp _op_mask_pt_p_c_dp
66
67#define _op_mask_pt_p_c_dpan _op_mask_pt_p_c_dp
68#define _op_mask_pt_pas_c_dpan _op_mask_pt_p_c_dp
69#define _op_mask_pt_pan_c_dpan _op_mask_pt_p_c_dp
70#define _op_mask_pt_p_can_dpan _op_mask_pt_p_c_dp
71#define _op_mask_pt_pas_can_dpan _op_mask_pt_p_c_dp
72#define _op_mask_pt_p_caa_dpan _op_mask_pt_p_c_dp
73#define _op_mask_pt_pas_caa_dpan _op_mask_pt_p_c_dp
74#define _op_mask_pt_pan_caa_dpan _op_mask_pt_p_c_dp
75
76static void
77init_mask_pixel_color_pt_funcs_c(void)
78{
79 op_mask_pt_funcs[SP][SM_N][SC][DP][CPU_C] = _op_mask_pt_p_c_dp;
80 op_mask_pt_funcs[SP_AS][SM_N][SC][DP][CPU_C] = _op_mask_pt_pas_c_dp;
81 op_mask_pt_funcs[SP_AN][SM_N][SC][DP][CPU_C] = _op_mask_pt_pan_c_dp;
82 op_mask_pt_funcs[SP][SM_N][SC_AN][DP][CPU_C] = _op_mask_pt_p_can_dp;
83 op_mask_pt_funcs[SP_AS][SM_N][SC_AN][DP][CPU_C] = _op_mask_pt_pas_can_dp;
84 op_mask_pt_funcs[SP][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_p_caa_dp;
85 op_mask_pt_funcs[SP_AS][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_pas_caa_dp;
86 op_mask_pt_funcs[SP_AN][SM_N][SC_AA][DP][CPU_C] = _op_mask_pt_pan_caa_dp;
87
88 op_mask_pt_funcs[SP][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_p_c_dpan;
89 op_mask_pt_funcs[SP_AS][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_pas_c_dpan;
90 op_mask_pt_funcs[SP_AN][SM_N][SC][DP_AN][CPU_C] = _op_mask_pt_pan_c_dpan;
91 op_mask_pt_funcs[SP][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pt_p_can_dpan;
92 op_mask_pt_funcs[SP_AS][SM_N][SC_AN][DP_AN][CPU_C] = _op_mask_pt_pas_can_dpan;
93 op_mask_pt_funcs[SP][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_p_caa_dpan;
94 op_mask_pt_funcs[SP_AS][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_pas_caa_dpan;
95 op_mask_pt_funcs[SP_AN][SM_N][SC_AA][DP_AN][CPU_C] = _op_mask_pt_pan_caa_dpan;
96}