summaryrefslogtreecommitdiff
path: root/Source/DirectFB/src/gfx/generic/stretch_up_down_32_indexed.h
blob: 655bf98a90ef68cfad2fd0808925381e5e9da151 (plain)
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#define SOURCE_LOOKUP(x) (((const u32*)colors)[x])
#define SOURCE_TYPE      u8


#define POINT_0               hfraq
#define LINE_0                vfraq
#define MINUS_1               0
#define POINT_TO_RATIO(p,ps)  ( (((((p)) & 0x3ffff) ? : 0x40000) << SHIFT_L8) / (ps) )
#define LINE_TO_RATIO(l,ls)   ( (((((l)) & 0x3ffff) ? : 0x40000) << SHIFT_L8) / (ls) )

#define POINT_L(p,ps)  ( (((p)-1) >> 18) - 1 )
#define POINT_R(p,ps)  ( (((p)-1) >> 18) )

#define LINE_T(l,ls)  ( (((l)-1) >> 18) - 1 )
#define LINE_B(l,ls)  ( (((l)-1) >> 18) )

static void FUNC_NAME(down)( void       *dst,
                             int         dpitch,
                             const void *src,
                             int         spitch,
                             int         width,
                             int         height,
                             int         dst_width,
                             int         dst_height,
                             DFBRegion  *clip,
                             const void *colors )
{
#include "stretch_hvx_32.h"
}

#undef POINT_0
#undef LINE_0
#undef MINUS_1
#undef POINT_TO_RATIO
#undef LINE_TO_RATIO
#undef POINT_L
#undef POINT_R
#undef LINE_T
#undef LINE_B

/**********************************************************************************************************************/

#define POINT_0               0
#define LINE_0                0
#define MINUS_1               1
#define POINT_TO_RATIO(p,ps)  ( ((p) & 0x3ffff) >> (18-SHIFT_L8) )
#define LINE_TO_RATIO(l,ls)   ( ((l) & 0x3ffff) >> (18-SHIFT_L8) )

#define POINT_L(p,ps)  ( (((p)) >> 18) )
#define POINT_R(p,ps)  ( (((p)) >> 18) + 1 )

#define LINE_T(l,ls)  ( (((l)) >> 18) )
#define LINE_B(l,ls)  ( (((l)) >> 18) + 1 )

static void FUNC_NAME(up)( void       *dst,
                           int         dpitch,
                           const void *src,
                           int         spitch,
                           int         width,
                           int         height,
                           int         dst_width,
                           int         dst_height,
                           DFBRegion  *clip,
                           const void *colors )
{
#include "stretch_hvx_32.h"
}

#undef POINT_0
#undef LINE_0
#undef MINUS_1
#undef POINT_TO_RATIO
#undef LINE_TO_RATIO
#undef POINT_L
#undef POINT_R
#undef LINE_T
#undef LINE_B


#undef SOURCE_LOOKUP
#undef SOURCE_TYPE