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

Макросы

#define OUTROOT   "fhmtgen"
#define TEMPLATE1   "hmttemplate1.txt"
#define TEMPLATE2   "hmttemplate2.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, l_int32 type)
static SARRAYsarrayMakeInnerLoopDWACode (SEL *sel, l_int32 nhits, l_int32 nmisses)
static SARRAYsarrayMakeWplsCode (SEL *sel)
l_int32 fhmtautogen (SELA *sela, l_int32 fileindex, const char *filename)
l_int32 fhmtautogen1 (SELA *sela, l_int32 fileindex, const char *filename)
l_int32 fhmtautogen2 (SELA *sela, l_int32 fileindex, const char *filename)

Переменные

static char wpldecls [][60]
static char wpldefs [][24]
static char wplstrp [][10]
static char wplstrm [][10]

Макросы

#define BUFFER_SIZE   512
#define OUTROOT   "fhmtgen"
#define PROTOARGS   "(l_uint32 *, l_int32, l_int32, l_int32, l_uint32 *, l_int32);"
#define TEMPLATE1   "hmttemplate1.txt"
#define TEMPLATE2   "hmttemplate2.txt"

Функции

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

fhmtautogen()

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 fhmtautogen1() and fhmtautogen2() for details.

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

fhmtautogen1()

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

Notes: (1) This function uses hmttemplate1.txt to create a top-level file that contains two functions that carry out the hit-miss transform 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 fhmtgen.<n>.c, where <n> is equal to the 'fileindex' parameter. (4) If filename != NULL, the output file is <filename>.<n>.c. (5) Each sel must have at least one hit. A sel with only misses generates code that will abort the operation if it is called.

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

fhmtautogen2()

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

Notes: (1) This function uses hmttemplate2.txt to create a low-level file that contains the low-level functions for implementing the hit-miss transform for every sel 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 fhmtgenlow.<n>.c, where <n> is equal to the 'fileindex' parameter. (4) If filename != NULL, the output file is <filename>low.<n>.c.

static char * makeBarrelshiftString ( l_int32  delx,
l_int32  dely,
l_int32  type 
) [static]
static SARRAY * sarrayMakeInnerLoopDWACode ( SEL sel,
l_int32  nhits,
l_int32  nmisses 
) [static]
static SARRAY * sarrayMakeWplsCode ( SEL sel) [static]

Переменные

char wpldecls[][60] [static]
char wpldefs[][24] [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"}