Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
zdenop committed Apr 23, 2019
2 parents 5c6ac61 + db08786 commit 7bacc88
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/api/altorenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include <memory>
#include <sstream> // for std::stringstream
#include "baseapi.h"
#ifdef _WIN32
# include <windows.h> // MultiByteToWideChar, ...
# include "host.h" // windows.h for MultiByteToWideChar, ...
#endif
#include "baseapi.h"
#include "renderer.h"

namespace tesseract {
Expand Down
4 changes: 2 additions & 2 deletions src/api/hocrrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
#include <locale> // for std::locale::classic
#include <memory> // for std::unique_ptr
#include <sstream> // for std::stringstream
#include "baseapi.h" // for TessBaseAPI
#ifdef _WIN32
# include <windows.h> // MultiByteToWideChar, ...
# include "host.h" // windows.h for MultiByteToWideChar, ...
#endif
#include "baseapi.h" // for TessBaseAPI
#include "renderer.h"
#include "tesseractclass.h" // for Tesseract

Expand Down
4 changes: 2 additions & 2 deletions src/api/wordstrboxrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ char* TessBaseAPI::GetWordStrBoxText(int page_number=0) {
continue;
}

// Use bounding box for whole line for WordStr
res_it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom);
if (res_it->IsAtBeginningOf(RIL_TEXTLINE)) {
if (!first_line) {
wordstr_box_str.add_str_int("\n\t ", right + 1);
Expand All @@ -57,6 +55,8 @@ char* TessBaseAPI::GetWordStrBoxText(int page_number=0) {
} else {
first_line = false;
}
// Use bounding box for whole line for WordStr
res_it->BoundingBox(RIL_TEXTLINE, &left, &top, &right, &bottom);
wordstr_box_str.add_str_int("WordStr ", left);
wordstr_box_str.add_str_int(" ", image_height_ - bottom);
wordstr_box_str.add_str_int(" ", right);
Expand Down
3 changes: 1 addition & 2 deletions src/ccmain/thresholder.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
///////////////////////////////////////////////////////////////////////
// File: thresholder.cpp
// Description: Base API for thresolding images in tesseract.
// Description: Base API for thresholding images in tesseract.
// Author: Ray Smith
// Created: Mon May 12 11:28:15 PDT 2008
//
// (C) Copyright 2008, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
3 changes: 1 addition & 2 deletions src/ccmain/thresholder.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
///////////////////////////////////////////////////////////////////////
// File: thresholder.h
// Description: Base API for thresolding images in tesseract.
// Description: Base API for thresholding images in tesseract.
// Author: Ray Smith
// Created: Mon May 12 11:00:15 PDT 2008
//
// (C) Copyright 2008, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
4 changes: 2 additions & 2 deletions src/ccutil/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ AM_CPPFLAGS += -DTESS_EXPORTS
endif

pkginclude_HEADERS = \
genericvector.h helpers.h host.h \
genericvector.h helpers.h \
ocrclass.h platform.h serialis.h strngs.h \
tesscallback.h unichar.h

noinst_HEADERS = \
ambigs.h basedir.h bits16.h bitvector.h ccutil.h clst.h doubleptr.h elst2.h \
elst.h errcode.h fileerr.h fileio.h \
genericheap.h globaloc.h \
genericheap.h globaloc.h host.h \
indexmapbidi.h kdpair.h lsterr.h \
object_cache.h params.h qrsequence.h sorthelper.h \
scanutils.h tessdatamanager.h tprintf.h \
Expand Down
7 changes: 4 additions & 3 deletions src/ccutil/ccutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,16 @@
#ifndef TESSERACT_CCUTIL_CCUTIL_H_
#define TESSERACT_CCUTIL_CCUTIL_H_

#ifdef _WIN32
#include <windows.h> // HANDLE, ...
#else
#ifndef _WIN32
#include <pthread.h>
#include <semaphore.h>
#endif

#include "ambigs.h"
#include "errcode.h"
#ifdef _WIN32
#include "host.h" // windows.h for HANDLE, ...
#endif
#include "strngs.h"
#include "params.h"
#include "unicharset.h"
Expand Down
2 changes: 1 addition & 1 deletion src/ccutil/fileio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
**********************************************************************/

#ifdef _WIN32
#include <windows.h> // BOOL, ...
#ifndef unlink
#include <io.h>
#endif
Expand All @@ -30,6 +29,7 @@

#include "errcode.h"
#include "fileio.h"
#include "host.h" // includes windows.h for BOOL, ...
#include "tprintf.h"

namespace tesseract {
Expand Down
6 changes: 6 additions & 0 deletions src/ccutil/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@
#include "platform.h"
/* _WIN32 */
#ifdef _WIN32
# ifndef NOMINMAX
# define NOMINMAX
# endif /* NOMINMAX */
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
#include <windows.h>
#undef min
#undef max
Expand Down
14 changes: 1 addition & 13 deletions src/ccutil/platform.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,7 @@
#define TESSERACT_CCUTIL_PLATFORM_H_

#define DLLSYM
#ifdef _WIN32
# ifndef NOMINMAX
# define NOMINMAX
# endif /* NOMINMAX */
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# ifdef __GNUC__
# define ultoa _ultoa
# endif /* __GNUC__ */
# define SIGNED
#else
#ifndef _WIN32
# ifdef __cplusplus
# include <climits>
# else /* C compiler*/
Expand All @@ -41,7 +30,6 @@
# else
# define MAX_PATH PATH_MAX
# endif
# define SIGNED signed
#endif

#if defined(_WIN32) || defined(__CYGWIN__)
Expand Down
3 changes: 1 addition & 2 deletions src/viewer/svutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// File: svutil.cpp
// Description: ScrollView Utilities
// Author: Joern Wanke
// Created: Thu Nov 29 2007
//
// (C) Copyright 2007, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -22,7 +21,6 @@

#include <cstdio>
#ifdef _WIN32
#include <windows.h>
#pragma comment(lib, "Ws2_32.lib")
struct addrinfo {
struct sockaddr* ai_addr;
Expand All @@ -31,6 +29,7 @@ struct addrinfo {
int ai_socktype;
int ai_protocol;
};
#include <winsock2.h> // for fd_set, send, ...
#else
#include <arpa/inet.h>
#include <netdb.h>
Expand Down
12 changes: 1 addition & 11 deletions src/viewer/svutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// File: svutil.h
// Description: ScrollView Utilities
// Author: Joern Wanke
// Created: Thu Nov 29 2007
//
// (C) Copyright 2007, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -25,23 +24,14 @@
#define TESSERACT_VIEWER_SVUTIL_H_

#ifdef _WIN32
#include <windows.h>
#include "platform.h"
#include "host.h" // also includes windows.h
#else
#include <pthread.h>
#include <semaphore.h>
#endif

#include <string>

#ifndef MAX
#define MAX(a, b) ((a > b) ? a : b)
#endif

#ifndef MIN
#define MIN(a, b) ((a < b) ? a : b)
#endif

/// The SVSync class provides functionality for Thread & Process Creation
class SVSync {
public:
Expand Down

0 comments on commit 7bacc88

Please sign in to comment.