summaryrefslogtreecommitdiff
path: root/im/src/lua5/clua/im_convert.clua
blob: 88e733f237b59e800fd5fec1feec23426781a2df (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
{
static const unsigned char B1[] = {
	0x20, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6d, 0x2e, 0x43, 0x6f, 
	0x6e, 0x76, 0x65, 0x72, 0x74, 0x44, 0x61, 0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x65, 0x77, 
	0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x64, 0x61, 0x74, 0x61, 
	0x5f, 0x74, 0x79, 0x70, 0x65, 0x2c, 0x20, 0x63, 0x70, 0x78, 0x32, 0x72, 0x65, 0x61, 0x6c, 0x2c, 
	0x20, 0x67, 0x61, 0x6d, 0x6d, 0x61, 0x2c, 0x20, 0x61, 0x62, 0x73, 0x73, 0x6f, 0x6c, 0x75, 0x74, 
	0x65, 0x2c, 0x20, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x29, 0x0a, 0x20, 0x20, 
	0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 
	0x3d, 0x20, 0x69, 0x6d, 0x2e, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 
	0x42, 0x61, 0x73, 0x65, 0x64, 0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 
	0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 
	0x64, 0x61, 0x74, 0x61, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 
	0x75, 0x72, 0x6e, 0x20, 0x69, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x44, 0x61, 
	0x74, 0x61, 0x54, 0x79, 0x70, 0x65, 0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 
	0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x63, 0x70, 0x78, 
	0x32, 0x72, 0x65, 0x61, 0x6c, 0x2c, 0x20, 0x67, 0x61, 0x6d, 0x6d, 0x61, 0x2c, 0x20, 0x61, 0x62, 
	0x73, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x2c, 0x20, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 
	0x64, 0x65, 0x29, 0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a, 0x65, 
	0x6e, 0x64, 0x0a, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6d, 0x2e, 
	0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x70, 0x61, 0x63, 
	0x65, 0x4e, 0x65, 0x77, 0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 
	0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x68, 0x61, 0x73, 
	0x5f, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x29, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 
	0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x2e, 0x49, 
	0x6d, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 0x28, 
	0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 
	0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 
	0x29, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x6c, 0x70, 0x68, 
	0x61, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 
	0x65, 0x3a, 0x41, 0x64, 0x64, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x28, 0x29, 0x20, 0x65, 0x6e, 0x64, 
	0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x6d, 0x2e, 0x43, 0x6f, 0x6e, 
	0x76, 0x65, 0x72, 0x74, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x70, 0x61, 0x63, 0x65, 0x28, 0x73, 
	0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 
	0x61, 0x67, 0x65, 0x29, 0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a, 
	0x65, 0x6e, 0x64, 0x0a, 0x0a, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6d, 
	0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x42, 0x69, 0x74, 0x6d, 0x61, 0x70, 
	0x4e, 0x65, 0x77, 0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x63, 
	0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73, 0x70, 0x61, 0x63, 0x65, 0x2c, 0x20, 0x68, 0x61, 0x73, 0x5f, 
	0x61, 0x6c, 0x70, 0x68, 0x61, 0x2c, 0x20, 0x63, 0x70, 0x78, 0x32, 0x72, 0x65, 0x61, 0x6c, 0x2c, 
	0x20, 0x67, 0x61, 0x6d, 0x6d, 0x61, 0x2c, 0x20, 0x61, 0x62, 0x73, 0x73, 0x6f, 0x6c, 0x75, 0x74, 
	0x65, 0x2c, 0x20, 0x63, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x29, 0x0a, 0x20, 0x20, 
	0x69, 0x66, 0x20, 0x28, 0x6e, 0x6f, 0x74, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73, 0x70, 
	0x61, 0x63, 0x65, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 
	0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x2e, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 
	0x4d, 0x6f, 0x64, 0x65, 0x54, 0x6f, 0x42, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x28, 0x73, 0x72, 0x63, 
	0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x3a, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x53, 0x70, 0x61, 0x63, 
	0x65, 0x28, 0x29, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 
	0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x20, 0x3d, 0x20, 0x69, 0x6d, 0x2e, 
	0x49, 0x6d, 0x61, 0x67, 0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x61, 0x73, 0x65, 0x64, 
	0x28, 0x73, 0x72, 0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x6e, 0x69, 0x6c, 0x2c, 
	0x20, 0x6e, 0x69, 0x6c, 0x2c, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x5f, 0x73, 0x70, 0x61, 0x63, 
	0x65, 0x29, 0x0a, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x68, 0x61, 0x73, 0x5f, 0x61, 0x6c, 0x70, 
	0x68, 0x61, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 
	0x67, 0x65, 0x3a, 0x41, 0x64, 0x64, 0x41, 0x6c, 0x70, 0x68, 0x61, 0x28, 0x29, 0x20, 0x65, 0x6e, 
	0x64, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x69, 0x6d, 0x2e, 0x43, 0x6f, 
	0x6e, 0x76, 0x65, 0x72, 0x74, 0x54, 0x6f, 0x42, 0x69, 0x74, 0x6d, 0x61, 0x70, 0x28, 0x73, 0x72, 
	0x63, 0x5f, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 0x69, 0x6d, 0x61, 
	0x67, 0x65, 0x2c, 0x20, 0x63, 0x70, 0x78, 0x32, 0x72, 0x65, 0x61, 0x6c, 0x2c, 0x20, 0x67, 0x61, 
	0x6d, 0x6d, 0x61, 0x2c, 0x20, 0x61, 0x62, 0x73, 0x73, 0x6f, 0x6c, 0x75, 0x74, 0x65, 0x2c, 0x20, 
	0x63, 0x61, 0x73, 0x74, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x29, 0x2c, 0x20, 0x64, 0x73, 0x74, 0x5f, 
	0x69, 0x6d, 0x61, 0x67, 0x65, 0x0a, 0x65, 0x6e, 0x64, 0x0a, 
};

 if (luaL_loadbuffer(L, (const char *)B1, sizeof(B1), "im_convert.lua") == 0) lua_call(L, 0, 0);
}