1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
#include "evas_common_private.h"
#include "evas_private.h"
void
cserve2_scale_init(void)
{
evas_common_cpu_init();
evas_common_blend_init();
evas_common_image_init();
evas_common_convert_init();
evas_common_scale_init();
}
void
cserve2_scale_shutdown(void)
{
evas_common_image_shutdown();
}
static inline void
_cserve2_rgba_image_set(RGBA_Image *im, void *data, int w, int h, int alpha)
{
memset(im, 0, sizeof *im);
im->cache_entry.w = w;
im->cache_entry.h = h;
im->cache_entry.space = EVAS_COLORSPACE_ARGB8888;
im->cache_entry.flags.alpha = alpha;
im->image.data = data;
im->cache_entry.allocated.w = w;
im->cache_entry.allocated.h = h;
}
void
cserve2_rgba_image_scale_do(void *src_data, void *dst_data,
int src_x, int src_y, int src_w, int src_h,
int dst_x, int dst_y, int dst_w, int dst_h,
int alpha, int smooth)
{
RGBA_Image src, dst;
RGBA_Draw_Context ct;
_cserve2_rgba_image_set(&src, src_data, src_w, src_h, alpha);
_cserve2_rgba_image_set(&dst, dst_data, dst_w, dst_h, alpha);
dst.flags = RGBA_IMAGE_NOTHING;
memset(&ct, 0, sizeof(ct));
ct.sli.h = 1;
ct.render_op = _EVAS_RENDER_COPY;
if (smooth)
evas_common_scale_rgba_in_to_out_clip_smooth(&src, &dst, &ct,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h);
else
evas_common_scale_rgba_in_to_out_clip_sample(&src, &dst, &ct,
src_x, src_y, src_w, src_h,
dst_x, dst_y, dst_w, dst_h);
}
|