Leptonica  1.54
Файл src/fmorphauto.c
#include <string.h>
#include "allheaders.h"

Макросы

#define OUTROOT   "fmorphgen"
#define TEMPLATE1   "morphtemplate1.txt"
#define TEMPLATE2   "morphtemplate2.txt"
#define BUFFER_SIZE   512
#define PROTOARGS   "(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);"

Функции

static char * makeBarrelshiftString (l_int32 delx, l_int32 dely)
static SARRAYsarrayMakeInnerLoopDWACode (SEL *sel, l_int32 index)
static SARRAYsarrayMakeWplsCode (SEL *sel)
l_int32 fmorphautogen (SELA *sela, l_int32 fileindex, const char *filename)
l_int32 fmorphautogen1 (SELA *sela, l_int32 fileindex, const char *filename)
l_int32 fmorphautogen2 (SELA *sela, l_int32 fileindex, const char *filename)

Переменные

static char wpldecls [][53]
static char wplgendecls [][30]
static char wpldefs [][25]
static char wplstrp [][10]
static char wplstrm [][10]

Макросы

#define BUFFER_SIZE   512
#define OUTROOT   "fmorphgen"
#define PROTOARGS   "(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);"
#define TEMPLATE1   "morphtemplate1.txt"
#define TEMPLATE2   "morphtemplate2.txt"

Функции

l_int32 fmorphautogen ( SELA sela,
l_int32  fileindex,
const char *  filename 
)

fmorphautogen()

Input: sela fileindex filename (<optional>; can be null) Return: 0 if OK; 1 on error

Notes: (1) This function generates all the code for implementing dwa morphological operations using all the sels in the sela. (2) See fmorphautogen1() and fmorphautogen2() for details.

l_int32 fmorphautogen1 ( SELA sela,
l_int32  fileindex,
const char *  filename 
)

fmorphautogen1()

Input: sela fileindex filename (<optional>; can be null) Return: 0 if OK; 1 on error

Notes: (1) This function uses morphtemplate1.txt to create a top-level file that contains two functions. These functions will carry out dilation, erosion, opening or closing for any of the sels in the input sela. (2) The fileindex parameter is inserted into the output filename, as described below. (3) If filename == NULL, the output file is fmorphgen.<n>.c, where <n> is equal to the 'fileindex' parameter. (4) If filename != NULL, the output file is <filename>.<n>.c.

l_int32 fmorphautogen2 ( SELA sela,
l_int32  fileindex,
const char *  filename 
)
static char * makeBarrelshiftString ( l_int32  delx,
l_int32  dely 
) [static]
static SARRAY * sarrayMakeInnerLoopDWACode ( SEL sel,
l_int32  index 
) [static]
static SARRAY * sarrayMakeWplsCode ( SEL sel) [static]

Переменные

char wpldecls[][53] [static]
char wpldefs[][25] [static]
char wplgendecls[][30] [static]
char wplstrm[][10] [static]
Инициализатор
 {"- wpls", "- wpls2", "- wpls3", "- wpls4",
                             "- wpls5", "- wpls6", "- wpls7", "- wpls8",
                             "- wpls9", "- wpls10", "- wpls11", "- wpls12",
                             "- wpls13", "- wpls14", "- wpls15", "- wpls16",
                             "- wpls17", "- wpls18", "- wpls19", "- wpls20",
                             "- wpls21", "- wpls22", "- wpls23", "- wpls24",
                             "- wpls25", "- wpls26", "- wpls27", "- wpls28",
                             "- wpls29", "- wpls30", "- wpls31"}
char wplstrp[][10] [static]
Инициализатор
 {"+ wpls", "+ wpls2", "+ wpls3", "+ wpls4",
                             "+ wpls5", "+ wpls6", "+ wpls7", "+ wpls8",
                             "+ wpls9", "+ wpls10", "+ wpls11", "+ wpls12",
                             "+ wpls13", "+ wpls14", "+ wpls15", "+ wpls16",
                             "+ wpls17", "+ wpls18", "+ wpls19", "+ wpls20",
                             "+ wpls21", "+ wpls22", "+ wpls23", "+ wpls24",
                             "+ wpls25", "+ wpls26", "+ wpls27", "+ wpls28",
                             "+ wpls29", "+ wpls30", "+ wpls31"}