diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c | 189 |
1 files changed, 189 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c new file mode 100644 index 0000000..a9d0f4b --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_op_blend/op_blend_pixel_mask_.c | |||
@@ -0,0 +1,189 @@ | |||
1 | /* blend pixel x mask --> dst */ | ||
2 | |||
3 | #ifdef BUILD_C | ||
4 | static void | ||
5 | _op_blend_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
6 | DATA32 *e; | ||
7 | int alpha; | ||
8 | UNROLL8_PLD_WHILE(d, l, e, | ||
9 | { | ||
10 | alpha = *m; | ||
11 | switch(alpha) | ||
12 | { | ||
13 | case 0: | ||
14 | break; | ||
15 | case 255: | ||
16 | alpha = 256 - (*s >> 24); | ||
17 | *d = *s + MUL_256(alpha, *d); | ||
18 | break; | ||
19 | default: | ||
20 | c = MUL_SYM(alpha, *s); | ||
21 | alpha = 256 - (c >> 24); | ||
22 | *d = c + MUL_256(alpha, *d); | ||
23 | break; | ||
24 | } | ||
25 | m++; s++; d++; | ||
26 | }); | ||
27 | } | ||
28 | |||
29 | static void | ||
30 | _op_blend_pas_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
31 | DATA32 *e; | ||
32 | int alpha; | ||
33 | UNROLL8_PLD_WHILE(d, l, e, | ||
34 | { | ||
35 | alpha = *m; | ||
36 | switch(alpha) | ||
37 | { | ||
38 | case 0: | ||
39 | break; | ||
40 | case 255: | ||
41 | *d = *s; | ||
42 | break; | ||
43 | default: | ||
44 | alpha++; | ||
45 | *d = INTERP_256(alpha, *s, *d); | ||
46 | break; | ||
47 | } | ||
48 | m++; s++; d++; | ||
49 | }); | ||
50 | } | ||
51 | |||
52 | static void | ||
53 | _op_blend_pan_mas_dp(DATA32 *s, DATA8 *m, DATA32 c __UNUSED__, DATA32 *d, int l) { | ||
54 | DATA32 *e; | ||
55 | int alpha; | ||
56 | UNROLL8_PLD_WHILE(d, l, e, | ||
57 | { | ||
58 | alpha = *m; | ||
59 | switch(alpha) | ||
60 | { | ||
61 | case 0: | ||
62 | break; | ||
63 | case 255: | ||
64 | *d = *s; | ||
65 | break; | ||
66 | default: | ||
67 | alpha++; | ||
68 | *d = INTERP_256(alpha, *s, *d); | ||
69 | break; | ||
70 | } | ||
71 | m++; s++; d++; | ||
72 | }); | ||
73 | } | ||
74 | |||
75 | |||
76 | #define _op_blend_p_mas_dpan _op_blend_p_mas_dp | ||
77 | #define _op_blend_pas_mas_dpan _op_blend_pas_mas_dp | ||
78 | #define _op_blend_pan_mas_dpan _op_blend_pan_mas_dp | ||
79 | |||
80 | static void | ||
81 | init_blend_pixel_mask_span_funcs_c(void) | ||
82 | { | ||
83 | op_blend_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_p_mas_dp; | ||
84 | op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_pas_mas_dp; | ||
85 | op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_pan_mas_dp; | ||
86 | |||
87 | op_blend_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_p_mas_dpan; | ||
88 | op_blend_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pas_mas_dpan; | ||
89 | op_blend_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pan_mas_dpan; | ||
90 | } | ||
91 | #endif | ||
92 | |||
93 | #ifdef BUILD_C | ||
94 | static void | ||
95 | _op_blend_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
96 | s = MUL_SYM(m, s); | ||
97 | c = 256 - (s >> 24); | ||
98 | *d = s + MUL_256(c, *d); | ||
99 | } | ||
100 | |||
101 | static void | ||
102 | _op_blend_pt_pan_mas_dp(DATA32 s, DATA8 m, DATA32 c __UNUSED__, DATA32 *d) { | ||
103 | *d = INTERP_256(m + 1, s, *d); | ||
104 | } | ||
105 | |||
106 | #define _op_blend_pt_pas_mas_dp _op_blend_pt_p_mas_dp | ||
107 | |||
108 | #define _op_blend_pt_p_mas_dpan _op_blend_pt_p_mas_dp | ||
109 | #define _op_blend_pt_pas_mas_dpan _op_blend_pt_pas_mas_dp | ||
110 | #define _op_blend_pt_pan_mas_dpan _op_blend_pt_pan_mas_dp | ||
111 | |||
112 | static void | ||
113 | init_blend_pixel_mask_pt_funcs_c(void) | ||
114 | { | ||
115 | op_blend_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_p_mas_dp; | ||
116 | op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_pas_mas_dp; | ||
117 | op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_pt_pan_mas_dp; | ||
118 | |||
119 | op_blend_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_p_mas_dpan; | ||
120 | op_blend_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_pas_mas_dpan; | ||
121 | op_blend_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_pt_pan_mas_dpan; | ||
122 | } | ||
123 | #endif | ||
124 | |||
125 | /*-----*/ | ||
126 | |||
127 | /* blend_rel pixel x mask -> dst */ | ||
128 | |||
129 | #ifdef BUILD_C | ||
130 | static void | ||
131 | _op_blend_rel_p_mas_dp(DATA32 *s, DATA8 *m, DATA32 c, DATA32 *d, int l) { | ||
132 | DATA32 *e; | ||
133 | int alpha; | ||
134 | UNROLL8_PLD_WHILE(d, l, e, | ||
135 | { | ||
136 | c = MUL_SYM(*m, *s); | ||
137 | alpha = 256 - (c >> 24); | ||
138 | *d = MUL_SYM(*d >> 24, c) + MUL_256(alpha, *d); | ||
139 | d++; m++; s++; | ||
140 | }); | ||
141 | } | ||
142 | |||
143 | #define _op_blend_rel_pas_mas_dp _op_blend_rel_p_mas_dp | ||
144 | #define _op_blend_rel_pan_mas_dp _op_blend_rel_p_mas_dp | ||
145 | |||
146 | #define _op_blend_rel_p_mas_dpan _op_blend_p_mas_dpan | ||
147 | #define _op_blend_rel_pas_mas_dpan _op_blend_pas_mas_dpan | ||
148 | #define _op_blend_rel_pan_mas_dpan _op_blend_pan_mas_dpan | ||
149 | |||
150 | static void | ||
151 | init_blend_rel_pixel_mask_span_funcs_c(void) | ||
152 | { | ||
153 | op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_p_mas_dp; | ||
154 | op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pas_mas_dp; | ||
155 | op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pan_mas_dp; | ||
156 | |||
157 | op_blend_rel_span_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_p_mas_dpan; | ||
158 | op_blend_rel_span_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pas_mas_dpan; | ||
159 | op_blend_rel_span_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pan_mas_dpan; | ||
160 | } | ||
161 | #endif | ||
162 | |||
163 | #ifdef BUILD_C | ||
164 | static void | ||
165 | _op_blend_rel_pt_p_mas_dp(DATA32 s, DATA8 m, DATA32 c, DATA32 *d) { | ||
166 | s = MUL_SYM(m, s); | ||
167 | c = 256 - (s >> 24); | ||
168 | *d = MUL_SYM(*d >> 24, s) + MUL_256(c, *d); | ||
169 | } | ||
170 | |||
171 | #define _op_blend_rel_pt_pas_mas_dp _op_blend_rel_pt_p_mas_dp | ||
172 | #define _op_blend_rel_pt_pan_mas_dp _op_blend_rel_pt_p_mas_dp | ||
173 | |||
174 | #define _op_blend_rel_pt_p_mas_dpan _op_blend_pt_p_mas_dpan | ||
175 | #define _op_blend_rel_pt_pas_mas_dpan _op_blend_pt_pas_mas_dpan | ||
176 | #define _op_blend_rel_pt_pan_mas_dpan _op_blend_pt_pan_mas_dpan | ||
177 | |||
178 | static void | ||
179 | init_blend_rel_pixel_mask_pt_funcs_c(void) | ||
180 | { | ||
181 | op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_p_mas_dp; | ||
182 | op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_pas_mas_dp; | ||
183 | op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP][CPU_C] = _op_blend_rel_pt_pan_mas_dp; | ||
184 | |||
185 | op_blend_rel_pt_funcs[SP][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_p_mas_dpan; | ||
186 | op_blend_rel_pt_funcs[SP_AS][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pas_mas_dpan; | ||
187 | op_blend_rel_pt_funcs[SP_AN][SM_AS][SC_N][DP_AN][CPU_C] = _op_blend_rel_pt_pan_mas_dpan; | ||
188 | } | ||
189 | #endif | ||