forked from torch/image
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjpeg.c
More file actions
25 lines (19 loc) · 633 Bytes
/
jpeg.c
File metadata and controls
25 lines (19 loc) · 633 Bytes
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
#include <TH.h>
#include <luaT.h>
#include <jpeglib.h>
#include <setjmp.h>
#define torch_(NAME) TH_CONCAT_3(torch_, Real, NAME)
#define torch_Tensor TH_CONCAT_STRING_3(torch., Real, Tensor)
#define libjpeg_(NAME) TH_CONCAT_3(libjpeg_, Real, NAME)
#include "generic/jpeg.c"
#include "THGenerateAllTypes.h"
DLL_EXPORT int luaopen_libjpeg(lua_State *L)
{
libjpeg_FloatMain_init(L);
libjpeg_DoubleMain_init(L);
libjpeg_ByteMain_init(L);
luaL_register(L, "libjpeg.double", libjpeg_DoubleMain__);
luaL_register(L, "libjpeg.float", libjpeg_FloatMain__);
luaL_register(L, "libjpeg.byte", libjpeg_ByteMain__);
return 1;
}