tesseract v5.3.3.20231005
ccutil.h
Go to the documentation of this file.
1
2// File: ccutil.h
3// Description: ccutil class.
4// Author: Samuel Charron
5//
6// (C) Copyright 2006, Google Inc.
7// Licensed under the Apache License, Version 2.0 (the "License");
8// you may not use this file except in compliance with the License.
9// You may obtain a copy of the License at
10// http://www.apache.org/licenses/LICENSE-2.0
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS,
13// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
18
19#ifndef TESSERACT_CCUTIL_CCUTIL_H_
20#define TESSERACT_CCUTIL_CCUTIL_H_
21
22#ifndef _WIN32
23# include <pthread.h>
24# include <semaphore.h>
25#endif
26
27#ifdef HAVE_CONFIG_H
28# include "config_auto.h" // DISABLED_LEGACY_ENGINE
29#endif
30
31#ifndef DISABLED_LEGACY_ENGINE
32# include "ambigs.h"
33#endif
34#include "errcode.h"
35#ifdef _WIN32
36# include "host.h" // windows.h for HANDLE, ...
37#endif
38#include "params.h"
39#include "unicharset.h"
40
41namespace tesseract {
42
44public:
45 CCUtil();
46 virtual ~CCUtil();
47
48public:
49 // Read the arguments and set up the data path.
50 void main_setup(const std::string &argv0, // program name
51 const std::string &basename // name of image
52 );
54 return &params_;
55 }
56
57 std::string datadir; // dir for data files
58 std::string imagebasename; // name of image
59 std::string lang;
62#ifndef DISABLED_LEGACY_ENGINE
64#endif
65 std::string imagefile; // image file name
66 std::string directory; // main directory
67
68private:
69 ParamsVectors params_;
70
71public:
72 // Member parameters.
73 // These have to be declared and initialized after params_ member, since
74 // params_ should be initialized before parameters are added to it.
75 INT_VAR_H(ambigs_debug_level);
76 BOOL_VAR_H(use_ambigs_for_adaption);
77};
78
79} // namespace tesseract
80
81#endif // TESSERACT_CCUTIL_CCUTIL_H_
INT_VAR_H(ambigs_debug_level)
std::string language_data_path_prefix
Definition: ccutil.h:60
std::string imagebasename
Definition: ccutil.h:58
ParamsVectors * params()
Definition: ccutil.h:53
UNICHARSET unicharset
Definition: ccutil.h:61
std::string directory
Definition: ccutil.h:66
std::string imagefile
Definition: ccutil.h:65
std::string lang
Definition: ccutil.h:59
std::string datadir
Definition: ccutil.h:57
BOOL_VAR_H(use_ambigs_for_adaption)
UnicharAmbigs unichar_ambigs
Definition: ccutil.h:63
#define TESS_API
Definition: export.h:32