forked from koreader/koreader-base
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leptonica_h.lua
55 lines (54 loc) · 1.97 KB
/
leptonica_h.lua
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
local ffi = require("ffi")
ffi.cdef[[
typedef signed char l_int8;
typedef unsigned char l_uint8;
typedef short int l_int16;
typedef short unsigned int l_uint16;
typedef int l_int32;
typedef unsigned int l_uint32;
typedef float l_float32;
typedef double l_float64;
typedef struct Box BOX;
typedef struct Boxa BOXA;
typedef struct Numa NUMA;
typedef struct Pix PIX;
typedef struct Pixa PIXA;
static const int L_NOCOPY = 0;
static const int L_COPY = 1;
static const int L_CLONE = 2;
BOX *boxAdjustSides(BOX *, BOX *, l_int32, l_int32, l_int32, l_int32);
BOX *boxCreate(l_int32, l_int32, l_int32, l_int32);
void boxDestroy(BOX **);
int boxGetGeometry(const BOX *, l_int32 *, l_int32 *, l_int32 *, l_int32 *);
BOX *boxOverlapRegion(BOX *, BOX *);
int boxaAddBox(BOXA *, BOX *, l_int32);
BOXA *boxaClipToBox(BOXA *, BOX *);
BOXA *boxaCombineOverlaps(BOXA *, PIXA *);
BOXA *boxaCreate(l_int32);
void boxaDestroy(BOXA **);
BOX *boxaGetBox(BOXA *, l_int32, l_int32);
int boxaGetBoxGeometry(BOXA *, l_int32, l_int32 *, l_int32 *, l_int32 *, l_int32 *);
l_int32 boxaGetCount(const BOXA *);
NUMA *numaCreateFromFArray(l_float32 *, l_int32, l_int32);
void numaDestroy(NUMA **);
l_int32 numaGetCount(NUMA *);
l_float32 *numaGetFArray(NUMA *, l_int32);
int numaGetIValue(NUMA *, l_int32, l_int32 *);
PIX *pixClipRectangle(PIX *, BOX *, BOX **);
PIX *pixClone(PIX *);
BOXA *pixConnCompBB(PIX *, l_int32);
PIX *pixConvertRGBToGrayFast(PIX *);
PIX *pixConvertTo32(PIX *);
void pixDestroy(PIX **);
PIX *pixDrawBoxaRandom(PIX *, BOXA *, l_int32);
l_int32 pixGetDepth(const PIX *);
l_int32 pixGetHeight(const PIX *);
int pixGetRegionsBinary(PIX *, PIX **, PIX **, PIX **, PIXA *);
l_int32 pixGetWidth(const PIX *);
PIX *pixInvert(PIX *, PIX *);
PIX *pixMultiplyByColor(PIX *, PIX *, BOX *, l_uint32);
BOXA *pixSplitIntoBoxa(PIX *, l_int32, l_int32, l_int32, l_int32, l_int32, l_int32);
PIX *pixThresholdToBinary(PIX *, l_int32);
int pixWriteMemPng(l_uint8 **, size_t *, PIX *, l_float32);
int pixWritePng(const char *, PIX *, l_float32);
]]