next up previous contents index
Next: Images Up: Frontend API Previous: Initializing and finalizing   Contents   Index


Attributes

After calling gocr_init(), the next thing to do is to set the attributes of the library. These are parameters that let you tune several aspects of the API. They can be set and read using these two functions:

int gocr_setAttribute ( gocr_AttributeType t, void *value );

void *gocr_getAttribute ( gocr_AttributeType t );

The first function sets the attribute t with a value value. The second returns the current value of attribute t. The list of attributes currently supported and the values you can pass to them is:



Attribute type Value Function Default
LIBVERSION string Returns a string containing the library version. This is a read-only attribute. none
VERBOSE an integer from 0 to 3 Sets the level of output:
0 nothing;
1 error messages;
2 warnings and errors;
3: everything. Used mostly for debugging.
1
BLOCK_OVERLAP boolean If true, allows two blocks to overlap FALSE
NO_BLOCK boolean If true, and no block was found, creates a block covering whole image. TRUE
CHAR_OVERLAP boolean If true, allows characters to overlap TRUE
CHAR_RECTANGLES boolean If true, all characters are selected as rectangles TRUE
FIND_ALL boolean If true, first find all characters, saving in memory, and then process. FALSE
ERROR_FILE (FILE *) variable Sets the error messages output file. stderr
PRINT an integer from 0 to 6 What is printed:
0: only data bit (. = white, * = black)
1: marked bits (mark1 + 2*mark2 + 4*mark3)
2: data and marked bits: if white, a...h;if black, marked bits->A...H
3: only isblock bit (. = is not block, * = is block)
4: only ischar bit (. = is not char, * = is char)
5: complete byte, in hexadecimal
6: complete byte, in ASCII
0
PRINT_IMAGE boolean If true, gocr_print* functions will print the image associated with the structure. 1



Boolean values are either GOCR_TRUE or GOCR_FALSE. Do not use TRUE or FALSE, since they are defined with different values by Unicode.

Some module packages may require certain attributes; take a look at their documentation. They may automatically set these attributes, so don't be stubborn and override. Certain functions of libgocr may lock some attributes, to avoid chaos.


next up previous contents index
Next: Images Up: Frontend API Previous: Initializing and finalizing   Contents   Index
root 2002-02-17