PRC_InitPrototypeDB*

C Specification

#include <nitro/prc.h>

BOOL PRC_InitPrototypeDB(
PRCPrototypeDB*             protoDB,
void*                       buffer,
const PRCPrototypeList*     prototypeList );

BOOL PRC_InitPrototypeDBEx(
PRCPrototypeDB*             protoDB,
void*                       buffer,
const PRCPrototypeList* prototypeList,
u32                         kindMask,
BOOL                        ignoreDisabledEntries,
const PRCPrototypeDBParam*  param );

Arguments

protoDB Pointer to the sample DB structure to be created.
buffer Pointer to the memory area that will be used in protoDB.
prototypeList Pointer to the sample pattern list.
kindMask Bit field used to select the pattern type of the sample DB entry that will be taken into the sample DB.
ignoreDisabledEntries Designates whether or not a sample entry whose enabled flag is FALSE should be ignored.
param Other parameter values that are dependent on the recognition algorithm (use NULL as the default).

Return Values

Returns TRUE if input pattern data is created successfully.

Description

Converts the PRCPrototypeList type sample pattern list into the PRCPrototypeDB type sample DB that is used for recognition. This function precalculates length, angle, bounding box, and other values used for recognition from a sample pattern list that contains only strokes, and stores them as a sample DB. Depending on the size of the sample DB, the cost of the process can be extremely high.

buffer specifies the memory region used internally by protoDB. Beforehand obtain the amount of memory required using PRC_GetPrototypeDBBufferSize*, and allocate at least that amount. Do not free buffer while protoDB is in use.

The logical AND of the kindMask value and the value of kind for each sample DB entry in the prototypeList is performed. The entry will be brought into the sample DB if the result is non-0. Specifying PRC_KIND_ALL in kindMask will select all kinds. If ignoreDisabledEntries is TRUE, sample DB entries whose enabled flag is FALSE will not be imported, even if their kind values match.

PRC_InitPrototypeDB(protoDB, buffer, bufferSize, prototypeList) is the same as PRC_InitPrototypeDBEx(protoDB, buffer, bufferSize, prototypeList, PRC_KIND_ALL, FALSE, NULL).

See Also

PRC_GetPrototypeDBBufferSize, PRC_GetPrototypeDBBufferSizeEx, PRC_GetRecognizedEntry*

Revision History

03/04/2005 Changed return value of BOOL

06/23/2004 Initial Version