re_layout()

extern KADMOS_ERROR KADMOS_API re_layout(ReLayoutData *layout);

Parameter:

layout
Pointer to a structure ReLayoutData.

Return value:

RE_SUCCESS or KADMOS error type.

Comment:

re_layout() analyses the structure and content of a given document.

First, the given image_in is checked for proper positioning. If required, it is deskewed. The deskewed image is provided under image_deskewed, it's image handle under h_image_deskewed. If not needed any more, the related memory has to be freed by a call to re_freeimage(). In case of deskewing the related angle is provided under re_layout_deskew.

Second, in the (deskewed) image the content area, the area of interest is determined. The related rectangle is provided under content.

Third, the content area is analysed. The found items are provided separately in the elements of re_layout_result. re_layout_result_len specifies the number of found result items or elements of re_layout_result. Every item is described by it's surrounding rectangle subimage, by it's type result_flag, and by a related handle h_result_image_bw to the black and white result image. RESULT_FLAG_NOTEXT Unspecified content. Maybe picture or graphics. RESULT_FLAG_GRID Line, underline, box, table grid, or something alike. RESULT_FLAG_UNDERLINE Horizontal line below text items. RESULT_FLAG_TEXT Area containing one column text for recognition by rep_do().

RE_SUCCESS will be returned, in case of error a related error type and the error text can be retrieved with re_GetErrorText().

Reference: