From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: 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. --- .../engines/common/evas_scale_smooth_scaler_down.c | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c (limited to 'libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c') diff --git a/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c new file mode 100644 index 0000000..357eb32 --- /dev/null +++ b/libraries/evas/src/lib/engines/common/evas_scale_smooth_scaler_down.c @@ -0,0 +1,43 @@ +{ + DATA32 **ypoints; + int *xpoints; + int *xapoints, *xapp; + int *yapoints, *yapp; + DATA32 *buf, *src_data; + + RGBA_Gfx_Func func; + + src_data = src->image.data; + + /* some maximum region sizes to avoid insane calc point tables */ + SCALE_CALC_X_POINTS(xpoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w); + SCALE_CALC_Y_POINTS(ypoints, src_data, src_w, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h); + SCALE_CALC_A_POINTS(xapoints, src_region_w, dst_region_w, dst_clip_x - dst_region_x, dst_clip_w); + SCALE_CALC_A_POINTS(yapoints, src_region_h, dst_region_h, dst_clip_y - dst_region_y, dst_clip_h); + + /* a scanline buffer */ + buf = alloca(dst_clip_w * sizeof(DATA32)); + + if (dc->mul.use) + func = evas_common_gfx_func_composite_pixel_color_span_get(src, dc->mul.col, dst, dst_clip_w, dc->render_op); + else + func = evas_common_gfx_func_composite_pixel_span_get(src, dst, dst_clip_w, dc->render_op); + /* scaling down vertically */ + if ((dst_region_w >= src_region_w) && + (dst_region_h < src_region_h)) + { +#include "evas_scale_smooth_scaler_downy.c" + } + /* scaling down horizontally */ + else if ((dst_region_w < src_region_w) && + (dst_region_h >= src_region_h)) + { +#include "evas_scale_smooth_scaler_downx.c" + } + /* scaling down both vertically & horizontally */ + else if ((dst_region_w < src_region_w) && + (dst_region_h < src_region_h)) + { +#include "evas_scale_smooth_scaler_downx_downy.c" + } +} -- cgit v1.1