Пример #1
0
// char* TessResultIteratorGetUTF8Text(const TessResultIterator* handle, TessPageIteratorLevel level);
func (r *ResultIterator) Text(level PageIteratorLevel) (string, error) {
	cText := C.TessResultIteratorGetUTF8Text(r.ri, C.TessPageIteratorLevel(level))
	if cText == nil {
		return "", errors.New("already at the end")
	}
	defer C.free(unsafe.Pointer(cText))
	text := C.GoString(cText)
	return text, nil
}
Пример #2
0
func (t *TesseractAPI) BaseAPIGetComponentImages(level TessPageIteratorLevel,
	flag int, pixa **C.struct_Pixa, blockids **C.int) *C.BOXA {
	boxaImg := C.TessBaseAPIGetComponentImages(t.api, C.TessPageIteratorLevel(level), C.int(flag), pixa, blockids)
	return boxaImg
}
Пример #3
0
// TESS_API BOOL  TESS_CALL TessResultIteratorNext(TessResultIterator* handle, TessPageIteratorLevel level);
func (r *ResultIterator) Next(level PageIteratorLevel) bool {
	return gobool(C.TessResultIteratorNext(r.ri, C.TessPageIteratorLevel(level)))
}