summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_scale_sample.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2014-10-22 19:59:50 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2014-11-12 17:26:27 +0900
commit237fdd3db89d3a8736771bc0bc75ba43fb1404ac (patch)
treeb71f62dccd602e30d45462e3cb08692c4facfd7b /src/lib/evas/common/evas_scale_sample.c
parent11001b3c33a88a493980c88d0fb9dd1e574b1877 (diff)
Evas: Improved code consistency
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_scale_sample.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/evas/common/evas_scale_sample.c b/src/lib/evas/common/evas_scale_sample.c
index 57fcd1633c..8b522807d7 100644
--- a/src/lib/evas/common/evas_scale_sample.c
+++ b/src/lib/evas/common/evas_scale_sample.c
@@ -63,9 +63,8 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
63{ 63{
64 int x, y; 64 int x, y;
65 int *lin_ptr; 65 int *lin_ptr;
66 int offset;
67 DATA32 *buf, *dptr; 66 DATA32 *buf, *dptr;
68 DATA32 *row_ptr; 67 DATA32 **row_ptr;
69 DATA32 *ptr, *dst_ptr, *src_data, *dst_data; 68 DATA32 *ptr, *dst_ptr, *src_data, *dst_data;
70 int src_w, src_h, dst_w, dst_h; 69 int src_w, src_h, dst_w, dst_h;
71 RGBA_Gfx_Func func; 70 RGBA_Gfx_Func func;
@@ -220,10 +219,14 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
220 { 219 {
221 /* allocate scale lookup tables */ 220 /* allocate scale lookup tables */
222 lin_ptr = alloca(dst_clip_w * sizeof(int)); 221 lin_ptr = alloca(dst_clip_w * sizeof(int));
222 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
223 223
224 /* fill scale tables */ 224 /* fill scale tables */
225 for (x = 0; x < dst_clip_w; x++) 225 for (x = 0; x < dst_clip_w; x++)
226 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x; 226 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;
227 for (y = 0; y < dst_clip_h; y++)
228 row_ptr[y] = src_data + (((((y + dst_clip_y - dst_region_y) * src_region_h) / dst_region_h)
229 + src_region_y) * src_w);
227 230
228 /* scale to dst */ 231 /* scale to dst */
229 dptr = dst_ptr; 232 dptr = dst_ptr;
@@ -231,16 +234,13 @@ evas_common_scale_rgba_sample_draw(RGBA_Image *src, RGBA_Image *dst, int dst_cli
231 /* a scanline buffer */ 234 /* a scanline buffer */
232 buf = alloca(dst_clip_w * sizeof(DATA32)); 235 buf = alloca(dst_clip_w * sizeof(DATA32));
233 236
234 offset = dst_clip_y - dst_region_y;
235
236 for (y = 0; y < dst_clip_h; y++) 237 for (y = 0; y < dst_clip_h; y++)
237 { 238 {
238 dst_ptr = buf; 239 dst_ptr = buf;
239 row_ptr = src_data + (((((y + offset) * src_region_h) / dst_region_h) + src_region_y) * src_w);
240 240
241 for (x = 0; x < dst_clip_w; x++) 241 for (x = 0; x < dst_clip_w; x++)
242 { 242 {
243 ptr = row_ptr + lin_ptr[x]; 243 ptr = row_ptr[y] + lin_ptr[x];
244 *dst_ptr = *ptr; 244 *dst_ptr = *ptr;
245 dst_ptr++; 245 dst_ptr++;
246 } 246 }
@@ -389,10 +389,6 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
389 } 389 }
390 if (dst_clip_h <= 0) return EINA_FALSE; 390 if (dst_clip_h <= 0) return EINA_FALSE;
391 391
392 /* allocate scale lookup tables */
393 lin_ptr = alloca(dst_clip_w * sizeof(int));
394 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
395
396 /* figure out dst jump */ 392 /* figure out dst jump */
397 //dst_jump = dst_w - dst_clip_w; 393 //dst_jump = dst_w - dst_clip_w;
398 394
@@ -443,6 +439,10 @@ scale_rgba_in_to_out_clip_sample_internal(RGBA_Image *src, RGBA_Image *dst,
443 } 439 }
444 else 440 else
445 { 441 {
442 /* allocate scale lookup tables */
443 lin_ptr = alloca(dst_clip_w * sizeof(int));
444 row_ptr = alloca(dst_clip_h * sizeof(DATA32 *));
445
446 /* fill scale tables */ 446 /* fill scale tables */
447 for (x = 0; x < dst_clip_w; x++) 447 for (x = 0; x < dst_clip_w; x++)
448 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x; 448 lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * src_region_w) / dst_region_w) + src_region_x;