diff options
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c new file mode 100644 index 0000000..37d0497 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_mul/op_mul_pixel_mask_.c | |||
@@ -0,0 +1,117 @@ | |||
1 | /* mul pixel x mask --> dst */ | ||
2 | |||
3 | #ifdef BUILD_C | ||
4 | static void | ||
5 | _op_mul_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
6 | DATA32 *e = d + l; | ||
7 | while (d < e) | ||
8 | { | ||
9 | c = *m; | ||
10 | switch(c) | ||
11 | { | ||
12 | case 0: | ||
13 | break; | ||
14 | case 255: | ||
15 | *d = MUL4_SYM(*s, *d); | ||
16 | break; | ||
17 | default: | ||
18 | c = ~(*s); | ||
19 | c = ~MUL_SYM(*m, c); | ||
20 | *d = MUL4_SYM(c, *d); | ||
21 | break; | ||
22 | } | ||
23 | m++; s++; d++; | ||
24 | } | ||
25 | } | ||
26 | |||
27 | static void | ||
28 | _op_mul_pan_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
29 | DATA32 *e = d + l; | ||
30 | while (d < e) | ||
31 | { | ||
32 | c = *m; | ||
33 | switch(c) | ||
34 | { | ||
35 | case 0: | ||
36 | break; | ||
37 | case 255: | ||
38 | *d = (*d & 0xff000000) + MUL3_SYM(*s, *d); | ||
39 | break; | ||
40 | default: | ||
41 | c = ~(*s); | ||
42 | c = ~MUL_SYM(*m, c); | ||
43 | *d = (*d & 0xff000000) + MUL3_SYM(c, *d); | ||
44 | break; | ||
45 | } | ||
46 | m++; s++; d++; | ||
47 | } | ||
48 | } | ||
49 | |||
50 | static void | ||
51 | _op_mul_p_mas_dpan(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
52 | DATA32 *e = d + l; | ||
53 | while (d < e) | ||
54 | { | ||
55 | c = *m; | ||
56 | switch(c) | ||
57 | { | ||
58 | case 0: | ||
59 | break; | ||
60 | case 255: | ||
61 | *d = (*s & 0xff000000) + MUL3_SYM(*s, *d); | ||
62 | break; | ||
63 | default: | ||
64 | c = ~(*s); | ||
65 | c = ~MUL_SYM(*m, c); | ||
66 | *d = (c & 0xff000000) + MUL3_SYM(c, *d); | ||
67 | break; | ||
68 | } | ||
69 | m++; d++; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #define _op_mul_pas_mas_dp _op_mul_p_mas_dp | ||
74 | |||
75 | #define _op_mul_pan_mas_dpan _op_mul_p_mas_dpan | ||
76 | #define _op_mul_pas_mas_dpan _op_mul_p_mas_dpan | ||
77 | |||
78 | static void | ||
79 | init_mul_pixel_mask_span_funcs_c(void) | ||
80 | { | ||
81 | op_mul_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mul_p_mas_dp; | ||
82 | op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mul_pas_mas_dp; | ||
83 | op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_mul_pan_mas_dp; | ||
84 | |||
85 | op_mul_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_p_mas_dpan; | ||
86 | op_mul_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pas_mas_dpan; | ||
87 | op_mul_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pan_mas_dpan; | ||
88 | } | ||
89 | #endif | ||
90 | |||
91 | #ifdef BUILD_C | ||
92 | static void | ||
93 | _op_mul_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) { | ||
94 | s = ~s; | ||
95 | s = ~MUL_SYM(m, s); | ||
96 | *d = MUL4_SYM(s, *d); | ||
97 | } | ||
98 | |||
99 | #define _op_mul_pt_pas_mas_dp _op_mul_pt_p_mas_dp | ||
100 | #define _op_mul_pt_pan_mas_dp _op_mul_pt_p_mas_dp | ||
101 | |||
102 | #define _op_mul_pt_p_mas_dpan _op_mul_pt_p_mas_dp | ||
103 | #define _op_mul_pt_pas_mas_dpan _op_mul_pt_p_mas_dp | ||
104 | #define _op_mul_pt_pan_mas_dpan _op_mul_pt_p_mas_dp | ||
105 | |||
106 | static void | ||
107 | init_mul_pixel_mask_pt_funcs_c(void) | ||
108 | { | ||
109 | op_mul_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_p_mas_dp; | ||
110 | op_mul_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_pas_mas_dp; | ||
111 | op_mul_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_mul_pt_pan_mas_dp; | ||
112 | |||
113 | op_mul_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_p_mas_dpan; | ||
114 | op_mul_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_pas_mas_dpan; | ||
115 | op_mul_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_mul_pt_pan_mas_dpan; | ||
116 | } | ||
117 | #endif | ||