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 628de5ba3f
commit 67ede37b50
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))
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)

View File

@ -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) {