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_scale_smooth_scaler_downy.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 '')
-rw-r--r-- | libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c | 260 |
1 files changed, 260 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c new file mode 100644 index 0000000..4c5448e --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_downy.c | |||
@@ -0,0 +1,260 @@ | |||
1 | { | ||
2 | int Cy, j; | ||
3 | DATA32 *dptr, *pix, *pbuf, **yp; | ||
4 | int r, g, b, a, rr, gg, bb, aa; | ||
5 | int *xp, xap, yap, pos; | ||
6 | int dyy, dxx; | ||
7 | int w = dst_clip_w; | ||
8 | #ifdef EVAS_SLI | ||
9 | int ysli = dst_clip_y; | ||
10 | #endif | ||
11 | |||
12 | dptr = dst_ptr; | ||
13 | pos = (src_region_y * src_w) + src_region_x; | ||
14 | dyy = dst_clip_y - dst_region_y; | ||
15 | dxx = dst_clip_x - dst_region_x; | ||
16 | |||
17 | xp = xpoints;// + dxx; | ||
18 | yp = ypoints;// + dyy; | ||
19 | xapp = xapoints;// + dxx; | ||
20 | yapp = yapoints;// + dyy; | ||
21 | pbuf = buf; | ||
22 | |||
23 | if (src->cache_entry.flags.alpha) | ||
24 | { | ||
25 | while (dst_clip_h--) | ||
26 | { | ||
27 | #ifdef EVAS_SLI | ||
28 | if (((ysli) % dc->sli.h) == dc->sli.y) | ||
29 | #endif | ||
30 | { | ||
31 | Cy = *yapp >> 16; | ||
32 | yap = *yapp & 0xffff; | ||
33 | |||
34 | while (dst_clip_w--) | ||
35 | { | ||
36 | pix = *yp + *xp + pos; | ||
37 | |||
38 | a = (A_VAL(pix) * yap) >> 10; | ||
39 | r = (R_VAL(pix) * yap) >> 10; | ||
40 | g = (G_VAL(pix) * yap) >> 10; | ||
41 | b = (B_VAL(pix) * yap) >> 10; | ||
42 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
43 | { | ||
44 | pix += src_w; | ||
45 | a += (A_VAL(pix) * Cy) >> 10; | ||
46 | r += (R_VAL(pix) * Cy) >> 10; | ||
47 | g += (G_VAL(pix) * Cy) >> 10; | ||
48 | b += (B_VAL(pix) * Cy) >> 10; | ||
49 | } | ||
50 | if (j > 0) | ||
51 | { | ||
52 | pix += src_w; | ||
53 | a += (A_VAL(pix) * j) >> 10; | ||
54 | r += (R_VAL(pix) * j) >> 10; | ||
55 | g += (G_VAL(pix) * j) >> 10; | ||
56 | b += (B_VAL(pix) * j) >> 10; | ||
57 | } | ||
58 | if ((xap = *xapp) > 0) | ||
59 | { | ||
60 | pix = *yp + *xp + 1 + pos; | ||
61 | aa = (A_VAL(pix) * yap) >> 10; | ||
62 | rr = (R_VAL(pix) * yap) >> 10; | ||
63 | gg = (G_VAL(pix) * yap) >> 10; | ||
64 | bb = (B_VAL(pix) * yap) >> 10; | ||
65 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
66 | { | ||
67 | pix += src_w; | ||
68 | aa += (A_VAL(pix) * Cy) >> 10; | ||
69 | rr += (R_VAL(pix) * Cy) >> 10; | ||
70 | gg += (G_VAL(pix) * Cy) >> 10; | ||
71 | bb += (B_VAL(pix) * Cy) >> 10; | ||
72 | } | ||
73 | if (j > 0) | ||
74 | { | ||
75 | pix += src_w; | ||
76 | aa += (A_VAL(pix) * j) >> 10; | ||
77 | rr += (R_VAL(pix) * j) >> 10; | ||
78 | gg += (G_VAL(pix) * j) >> 10; | ||
79 | bb += (B_VAL(pix) * j) >> 10; | ||
80 | } | ||
81 | a += ((aa - a) * xap) >> 8; | ||
82 | r += ((rr - r) * xap) >> 8; | ||
83 | g += ((gg - g) * xap) >> 8; | ||
84 | b += ((bb - b) * xap) >> 8; | ||
85 | } | ||
86 | *pbuf++ = ARGB_JOIN(((a + (1 << 3)) >> 4), | ||
87 | ((r + (1 << 3)) >> 4), | ||
88 | ((g + (1 << 3)) >> 4), | ||
89 | ((b + (1 << 3)) >> 4)); | ||
90 | xp++; xapp++; | ||
91 | } | ||
92 | |||
93 | func(buf, NULL, dc->mul.col, dptr, w); | ||
94 | } | ||
95 | #ifdef EVAS_SLI | ||
96 | ysli++; | ||
97 | #endif | ||
98 | pbuf = buf; | ||
99 | dptr += dst_w; dst_clip_w = w; | ||
100 | yp++; yapp++; | ||
101 | xp = xpoints;// + dxx; | ||
102 | xapp = xapoints;// + dxx; | ||
103 | } | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | #ifdef DIRECT_SCALE | ||
108 | if ((!src->cache_entry.flags.alpha) && | ||
109 | (!dst->cache_entry.flags.alpha) && | ||
110 | (!dc->mul.use)) | ||
111 | { | ||
112 | while (dst_clip_h--) | ||
113 | { | ||
114 | #ifdef EVAS_SLI | ||
115 | if (((ysli) % dc->sli.h) == dc->sli.y) | ||
116 | #endif | ||
117 | { | ||
118 | Cy = *yapp >> 16; | ||
119 | yap = *yapp & 0xffff; | ||
120 | |||
121 | pbuf = dptr; | ||
122 | while (dst_clip_w--) | ||
123 | { | ||
124 | pix = *yp + *xp + pos; | ||
125 | |||
126 | r = (R_VAL(pix) * yap) >> 10; | ||
127 | g = (G_VAL(pix) * yap) >> 10; | ||
128 | b = (B_VAL(pix) * yap) >> 10; | ||
129 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
130 | { | ||
131 | pix += src_w; | ||
132 | r += (R_VAL(pix) * Cy) >> 10; | ||
133 | g += (G_VAL(pix) * Cy) >> 10; | ||
134 | b += (B_VAL(pix) * Cy) >> 10; | ||
135 | } | ||
136 | if (j > 0) | ||
137 | { | ||
138 | pix += src_w; | ||
139 | r += (R_VAL(pix) * j) >> 10; | ||
140 | g += (G_VAL(pix) * j) >> 10; | ||
141 | b += (B_VAL(pix) * j) >> 10; | ||
142 | } | ||
143 | if ((xap = *xapp) > 0) | ||
144 | { | ||
145 | pix = *yp + *xp + 1 + pos; | ||
146 | rr = (R_VAL(pix) * yap) >> 10; | ||
147 | gg = (G_VAL(pix) * yap) >> 10; | ||
148 | bb = (B_VAL(pix) * yap) >> 10; | ||
149 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
150 | { | ||
151 | pix += src_w; | ||
152 | rr += (R_VAL(pix) * Cy) >> 10; | ||
153 | gg += (G_VAL(pix) * Cy) >> 10; | ||
154 | bb += (B_VAL(pix) * Cy) >> 10; | ||
155 | } | ||
156 | if (j > 0) | ||
157 | { | ||
158 | pix += src_w; | ||
159 | rr += (R_VAL(pix) * j) >> 10; | ||
160 | gg += (G_VAL(pix) * j) >> 10; | ||
161 | bb += (B_VAL(pix) * j) >> 10; | ||
162 | } | ||
163 | r += ((rr - r) * xap) >> 8; | ||
164 | g += ((gg - g) * xap) >> 8; | ||
165 | b += ((bb - b) * xap) >> 8; | ||
166 | } | ||
167 | *pbuf++ = ARGB_JOIN(0xff, | ||
168 | ((r + (1 << 3)) >> 4), | ||
169 | ((g + (1 << 3)) >> 4), | ||
170 | ((b + (1 << 3)) >> 4)); | ||
171 | xp++; xapp++; | ||
172 | } | ||
173 | } | ||
174 | #ifdef EVAS_SLI | ||
175 | ysli++; | ||
176 | #endif | ||
177 | dptr += dst_w; dst_clip_w = w; | ||
178 | yp++; yapp++; | ||
179 | xp = xpoints;// + dxx; | ||
180 | xapp = xapoints;// + dxx; | ||
181 | } | ||
182 | } | ||
183 | else | ||
184 | #endif | ||
185 | { | ||
186 | while (dst_clip_h--) | ||
187 | { | ||
188 | #ifdef EVAS_SLI | ||
189 | if (((ysli) % dc->sli.h) == dc->sli.y) | ||
190 | #endif | ||
191 | { | ||
192 | Cy = *yapp >> 16; | ||
193 | yap = *yapp & 0xffff; | ||
194 | |||
195 | while (dst_clip_w--) | ||
196 | { | ||
197 | pix = *yp + *xp + pos; | ||
198 | |||
199 | r = (R_VAL(pix) * yap) >> 10; | ||
200 | g = (G_VAL(pix) * yap) >> 10; | ||
201 | b = (B_VAL(pix) * yap) >> 10; | ||
202 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
203 | { | ||
204 | pix += src_w; | ||
205 | r += (R_VAL(pix) * Cy) >> 10; | ||
206 | g += (G_VAL(pix) * Cy) >> 10; | ||
207 | b += (B_VAL(pix) * Cy) >> 10; | ||
208 | } | ||
209 | if (j > 0) | ||
210 | { | ||
211 | pix += src_w; | ||
212 | r += (R_VAL(pix) * j) >> 10; | ||
213 | g += (G_VAL(pix) * j) >> 10; | ||
214 | b += (B_VAL(pix) * j) >> 10; | ||
215 | } | ||
216 | if ((xap = *xapp) > 0) | ||
217 | { | ||
218 | pix = *yp + *xp + 1 + pos; | ||
219 | rr = (R_VAL(pix) * yap) >> 10; | ||
220 | gg = (G_VAL(pix) * yap) >> 10; | ||
221 | bb = (B_VAL(pix) * yap) >> 10; | ||
222 | for (j = (1 << 14) - yap; j > Cy; j -= Cy) | ||
223 | { | ||
224 | pix += src_w; | ||
225 | rr += (R_VAL(pix) * Cy) >> 10; | ||
226 | gg += (G_VAL(pix) * Cy) >> 10; | ||
227 | bb += (B_VAL(pix) * Cy) >> 10; | ||
228 | } | ||
229 | if (j > 0) | ||
230 | { | ||
231 | pix += src_w; | ||
232 | rr += (R_VAL(pix) * j) >> 10; | ||
233 | gg += (G_VAL(pix) * j) >> 10; | ||
234 | bb += (B_VAL(pix) * j) >> 10; | ||
235 | } | ||
236 | r += ((rr - r) * xap) >> 8; | ||
237 | g += ((gg - g) * xap) >> 8; | ||
238 | b += ((bb - b) * xap) >> 8; | ||
239 | } | ||
240 | *pbuf++ = ARGB_JOIN(0xff, | ||
241 | ((r + (1 << 3)) >> 4), | ||
242 | ((g + (1 << 3)) >> 4), | ||
243 | ((b + (1 << 3)) >> 4)); | ||
244 | xp++; xapp++; | ||
245 | } | ||
246 | |||
247 | func(buf, NULL, dc->mul.col, dptr, w); | ||
248 | } | ||
249 | #ifdef EVAS_SLI | ||
250 | ysli++; | ||
251 | #endif | ||
252 | pbuf = buf; | ||
253 | dptr += dst_w; dst_clip_w = w; | ||
254 | yp++; yapp++; | ||
255 | xp = xpoints;// + dxx; | ||
256 | xapp = xapoints;// + dxx; | ||
257 | } | ||
258 | } | ||
259 | } | ||
260 | } | ||