mirror of
https://github.com/tesseract-ocr/tesseract.git
synced 2025-01-18 06:30:14 +08:00
Fixes #74 NO_CUBE_BUILD with reverting to ANDROID_BUILD in baseapi
This commit is contained in:
parent
628de5ba3f
commit
67ede37b50
@ -47,7 +47,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES:$(LOCAL_PATH)/%=%)
|
||||
$(info local src files = $(LOCAL_SRC_FILES))
|
||||
|
||||
LOCAL_LDLIBS := -ldl -llog -ljnigraphics
|
||||
LOCAL_CFLAGS := -DNO_CUBE_BUILD -DGRAPHICS_DISABLED
|
||||
LOCAL_CFLAGS := -DANDROID_BUILD -DNO_CUBE_BUILD -DGRAPHICS_DISABLED
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
@ -792,7 +792,7 @@ int CubeAPITest(Boxa* boxa_blocks, Pixa* pixa_blocks,
|
||||
ASSERT_HOST(pr_word == word_count);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
#endif // NO_CUBE_BUILD
|
||||
|
||||
/**
|
||||
* Runs page layout analysis in the mode set by SetPageSegMode.
|
||||
@ -1029,11 +1029,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
|
||||
int timeout_millisec,
|
||||
TessResultRenderer* renderer,
|
||||
int tessedit_page_number) {
|
||||
#ifndef NO_CUBE_BUILD
|
||||
#ifndef ANDROID_BUILD
|
||||
Pix *pix = NULL;
|
||||
#ifdef USE_OPENCL
|
||||
OpenclDevice od;
|
||||
#endif
|
||||
#endif // USE_OPENCL
|
||||
int page = (tessedit_page_number >= 0) ? tessedit_page_number : 0;
|
||||
for (; ; ++page) {
|
||||
if (tessedit_page_number >= 0)
|
||||
@ -1043,11 +1043,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
|
||||
// FIXME(jbreiden) Not implemented.
|
||||
pix = od.pixReadMemTiffCl(data, size, page);
|
||||
} else {
|
||||
#endif
|
||||
#endif // USE_OPENCL
|
||||
pix = pixReadMemTiff(data, size, page);
|
||||
#ifdef USE_OPENCL
|
||||
}
|
||||
#endif
|
||||
#endif // USE_OPENCL
|
||||
if (pix == NULL) break;
|
||||
tprintf("Page %d\n", page + 1);
|
||||
char page_str[kMaxIntSize];
|
||||
@ -1098,7 +1098,7 @@ bool TessBaseAPI::ProcessPagesInternal(const char* filename,
|
||||
const char* retry_config,
|
||||
int timeout_millisec,
|
||||
TessResultRenderer* renderer) {
|
||||
#ifndef NO_CUBE_BUILD
|
||||
#ifndef ANDROID_BUILD
|
||||
PERF_COUNT_START("ProcessPages")
|
||||
bool stdInput = !strcmp(filename, "stdin") || !strcmp(filename, "-");
|
||||
if (stdInput) {
|
||||
@ -1222,10 +1222,10 @@ bool TessBaseAPI::ProcessPage(Pix* pix, int page_index, const char* filename,
|
||||
failed = Recognize(NULL) < 0;
|
||||
}
|
||||
if (tesseract_->tessedit_write_images) {
|
||||
#ifndef NO_CUBE_BUILD
|
||||
#ifndef ANDROID_BUILD
|
||||
Pix* page_pix = GetThresholdedImage();
|
||||
pixWrite("tessinput.tif", page_pix, IFF_TIFF_G4);
|
||||
#endif
|
||||
#endif // ANDROID_BUILD
|
||||
}
|
||||
if (failed && retry_config != NULL && retry_config[0] != '\0') {
|
||||
// Save current config variables before switching modes.
|
||||
@ -2638,7 +2638,7 @@ int TessBaseAPI::NumDawgs() const {
|
||||
CubeRecoContext *TessBaseAPI::GetCubeRecoContext() const {
|
||||
return (tesseract_ == NULL) ? NULL : tesseract_->GetCubeRecoContext();
|
||||
}
|
||||
#endif
|
||||
#endif // NO_CUBE_BUILD
|
||||
|
||||
/** Escape a char string - remove <>&"' with HTML codes. */
|
||||
STRING HOcrEscape(const char* text) {
|
||||
|
Loading…
Reference in New Issue
Block a user