Fixes #74 NO_CUBE_BUILD with reverting to ANDROID_BUILD in baseapi

This commit is contained in:
Zdenko Podobný 2015-08-09 18:09:30 +02:00
parent ff6c088084
commit 9e4ceb1522
2 changed files with 10 additions and 10 deletions

View File

@ -47,7 +47,7 @@ LOCAL_SRC_FILES := $(LOCAL_SRC_FILES:$(LOCAL_PATH)/%=%)
$(info local src files = $(LOCAL_SRC_FILES)) $(info local src files = $(LOCAL_SRC_FILES))
LOCAL_LDLIBS := -ldl -llog -ljnigraphics 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) include $(BUILD_SHARED_LIBRARY)

View File

@ -792,7 +792,7 @@ int CubeAPITest(Boxa* boxa_blocks, Pixa* pixa_blocks,
ASSERT_HOST(pr_word == word_count); ASSERT_HOST(pr_word == word_count);
return 0; return 0;
} }
#endif #endif // NO_CUBE_BUILD
/** /**
* Runs page layout analysis in the mode set by SetPageSegMode. * Runs page layout analysis in the mode set by SetPageSegMode.
@ -1029,11 +1029,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
int timeout_millisec, int timeout_millisec,
TessResultRenderer* renderer, TessResultRenderer* renderer,
int tessedit_page_number) { int tessedit_page_number) {
#ifndef NO_CUBE_BUILD #ifndef ANDROID_BUILD
Pix *pix = NULL; Pix *pix = NULL;
#ifdef USE_OPENCL #ifdef USE_OPENCL
OpenclDevice od; OpenclDevice od;
#endif #endif // USE_OPENCL
int page = (tessedit_page_number >= 0) ? tessedit_page_number : 0; int page = (tessedit_page_number >= 0) ? tessedit_page_number : 0;
for (; ; ++page) { for (; ; ++page) {
if (tessedit_page_number >= 0) if (tessedit_page_number >= 0)
@ -1043,11 +1043,11 @@ bool TessBaseAPI::ProcessPagesMultipageTiff(const l_uint8 *data,
// FIXME(jbreiden) Not implemented. // FIXME(jbreiden) Not implemented.
pix = od.pixReadMemTiffCl(data, size, page); pix = od.pixReadMemTiffCl(data, size, page);
} else { } else {
#endif #endif // USE_OPENCL
pix = pixReadMemTiff(data, size, page); pix = pixReadMemTiff(data, size, page);
#ifdef USE_OPENCL #ifdef USE_OPENCL
} }
#endif #endif // USE_OPENCL
if (pix == NULL) break; if (pix == NULL) break;
tprintf("Page %d\n", page + 1); tprintf("Page %d\n", page + 1);
char page_str[kMaxIntSize]; char page_str[kMaxIntSize];
@ -1098,7 +1098,7 @@ bool TessBaseAPI::ProcessPagesInternal(const char* filename,
const char* retry_config, const char* retry_config,
int timeout_millisec, int timeout_millisec,
TessResultRenderer* renderer) { TessResultRenderer* renderer) {
#ifndef NO_CUBE_BUILD #ifndef ANDROID_BUILD
PERF_COUNT_START("ProcessPages") PERF_COUNT_START("ProcessPages")
bool stdInput = !strcmp(filename, "stdin") || !strcmp(filename, "-"); bool stdInput = !strcmp(filename, "stdin") || !strcmp(filename, "-");
if (stdInput) { if (stdInput) {
@ -1222,10 +1222,10 @@ bool TessBaseAPI::ProcessPage(Pix* pix, int page_index, const char* filename,
failed = Recognize(NULL) < 0; failed = Recognize(NULL) < 0;
} }
if (tesseract_->tessedit_write_images) { if (tesseract_->tessedit_write_images) {
#ifndef NO_CUBE_BUILD #ifndef ANDROID_BUILD
Pix* page_pix = GetThresholdedImage(); Pix* page_pix = GetThresholdedImage();
pixWrite("tessinput.tif", page_pix, IFF_TIFF_G4); pixWrite("tessinput.tif", page_pix, IFF_TIFF_G4);
#endif #endif // ANDROID_BUILD
} }
if (failed && retry_config != NULL && retry_config[0] != '\0') { if (failed && retry_config != NULL && retry_config[0] != '\0') {
// Save current config variables before switching modes. // Save current config variables before switching modes.
@ -2638,7 +2638,7 @@ int TessBaseAPI::NumDawgs() const {
CubeRecoContext *TessBaseAPI::GetCubeRecoContext() const { CubeRecoContext *TessBaseAPI::GetCubeRecoContext() const {
return (tesseract_ == NULL) ? NULL : tesseract_->GetCubeRecoContext(); return (tesseract_ == NULL) ? NULL : tesseract_->GetCubeRecoContext();
} }
#endif #endif // NO_CUBE_BUILD
/** Escape a char string - remove <>&"' with HTML codes. */ /** Escape a char string - remove <>&"' with HTML codes. */
STRING HOcrEscape(const char* text) { STRING HOcrEscape(const char* text) {