# PRC_InitPrototypeDB*

## Syntax

      #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 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.

The `buffer` argument specifies the memory region used internally by `protoDB`. First, use `PRC_GetPrototypeDBBufferSize*` to get the amount of memory required, and then 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-zero. Specifying `PRC_KIND_ALL` in `kindMask` will select all `kind` instances. 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

2005/03/04 Changed return value to BOOL.
2004/06/23 Initial version.

CONFIDENTIAL