///////////////////////////////////////////////////////////////////////
// File: tesscallback.h
// Description: classes and functions to replace pointer-to-functions
// Author: Samuel Charron
//
// (C) Copyright 2006, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
///////////////////////////////////////////////////////////////////////
#ifndef TESS_CALLBACK_SPECIALIZATIONS_H_
#define TESS_CALLBACK_SPECIALIZATIONS_H_
#include "host.h" // For NULL.
struct TessCallbackUtils_ {
static void FailIsRepeatable(const char* name);
};
class TessClosure {
public:
virtual ~TessClosure() { }
virtual void Run() = 0;
};
template <class R>
class TessResultCallback {
public:
virtual ~TessResultCallback() { }
virtual R Run() = 0;
};
template <bool del, class R, class T>
class _ConstTessMemberResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T>
class _ConstTessMemberResultCallback_0_0<del, void, T>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() const;
private:
const T* object_;
MemberSignature member_;
public:
inline _ConstTessMemberResultCallback_0_0(
const T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0<true,R,T1>(
obj, member);
}
#endif
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _ConstTessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
const T1* obj, R (T2::*member)() const) {
return new _ConstTessMemberResultCallback_0_0<false,R,T1>(
obj, member);
}
#endif
template <bool del, class R, class T>
class _TessMemberResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual R Run() {
if (!del) {
R result = (object_->*member_)();
return result;
} else {
R result = (object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T>
class _TessMemberResultCallback_0_0<del, void, T>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)() ;
private:
T* object_;
MemberSignature member_;
public:
inline _TessMemberResultCallback_0_0(
T* object, MemberSignature member)
: object_(object),
member_(member) {
}
virtual void Run() {
if (!del) {
(object_->*member_)();
} else {
(object_->*member_)();
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
}
}
};
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<true,R,T1>::base*
NewTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0<true,R,T1>(
obj, member);
}
#endif
#ifndef SWIG
template <class T1, class T2, class R>
inline typename _TessMemberResultCallback_0_0<false,R,T1>::base*
NewPermanentTessCallback(
T1* obj, R (T2::*member)() ) {
return new _TessMemberResultCallback_0_0<false,R,T1>(
obj, member);
}
#endif
template <bool del, class R>
class _TessFunctionResultCallback_0_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual R Run() {
if (!del) {
R result = (*function_)();
return result;
} else {
R result = (*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
return result;
}
}
};
template <bool del>
class _TessFunctionResultCallback_0_0<del, void>
: public TessClosure {
public:
typedef TessClosure base;
typedef void (*FunctionSignature)();
private:
FunctionSignature function_;
public:
inline _TessFunctionResultCallback_0_0(
FunctionSignature function)
: function_(function) {
}
virtual void Run() {
if (!del) {
(*function_)();
} else {
(*function_)();
// zero out the pointer to ensure segfault if used again
function_ = NULL;
delete this;
}
}
};
template <class R>
inline typename _TessFunctionResultCallback_0_0<true,R>::base*
NewTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0<true,R>(function);
}
template <class R>
inline typename _TessFunctionResultCallback_0_0<false,R>::base*
NewPermanentTessCallback(R (*function)()) {
return new _TessFunctionResultCallback_0_0<false,R>(function);
}
// Specified by TR1 [4.7.2] Reference modifications.
template <class T> struct remove_reference;
template<typename T> struct remove_reference { typedef T type; };
template<typename T> struct remove_reference<T&> { typedef T type; };
// Identity<T>::type is a typedef of T. Useful for preventing the
// compiler from inferring the type of an argument in templates.
template <typename T>
struct Identity {
typedef T type;
};
template <bool del, class R, class T, class P1>
class _ConstTessMemberResultCallback_1_0 : public TessResultCallback<R> {
public:
typedef TessResultCallback<R> base;
typedef R (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remove_reference<P1>::type p1_;
public:
inline _ConstTessMemberResultCallback_1_0(const T* object, MemberSignature member, P1 p1)
: object_(object),
member_(member), p1_(p1) { }
virtual R Run() {
if (!del) {
R result = (object_->*member_)(p1_);
return result;
} else {
R result = (object_->*member_)(p1_);
// zero out the pointer to ensure segfault if used again
member_ = NULL;
delete this;
return result;
}
}
};
template <bool del, class T, class P1>
class _ConstTessMemberResultCallback_1_0<del, void, T, P1> : public TessClosure {
public:
typedef TessClosure base;
typedef void (T::*MemberSignature)(P1) const;
private:
const T* object_;
MemberSignature member_;
typename remov
没有合适的资源?快使用搜索试试~ 我知道了~
Tesseract4.0+VS2017+win10编译库文件
共218个文件
h:86个
lib:66个
dll:58个
4星 · 超过85%的资源 需积分: 49 257 下载量 22 浏览量
2018-05-15
19:12:27
上传
评论 6
收藏 26.76MB 7Z 举报
温馨提示
win10 X64和VS2017的环境下编译的Tesseract4.0库文件,配置方法请参考http://livezingy.com/compilation-tesseract4-in-vs2017-win10/
资源推荐
资源详情
资源评论
收起资源包目录
Tesseract4.0+VS2017+win10编译库文件 (218个子文件)
TesseractTargets.cmake 3KB
TesseractConfig.cmake 2KB
TesseractTargets-release.cmake 1000B
TesseractTargets-debug.cmake 992B
TesseractConfig-version.cmake 395B
pvt.cppan.demo.unicode.icu.data-60.2.0.dll 30.79MB
pvt.cppan.demo.unicode.icu.data-60.2.0.dll 25.66MB
tesseract400d.dll 8.22MB
tesseract400d.dll 8.22MB
pvt.cppan.demo.unicode.icu.i18n-60.2.0.dll 4.81MB
pvt.cppan.demo.danbloomberg.leptonica-1.74.4.dll 4.73MB
tesseract400.dll 3.17MB
tesseract400.dll 3.17MB
pvt.cppan.demo.cairographics.cairo-1.15.6.dll 3.16MB
pvt.cppan.demo.unicode.icu.common-60.2.0.dll 2.99MB
pvt.cppan.demo.danbloomberg.leptonica-1.74.4.dll 2.41MB
pvt.cppan.demo.unicode.icu.i18n-60.2.0.dll 2.13MB
pvt.cppan.demo.gnome.glib.glib-2.50.3.dll 1.85MB
pvt.cppan.demo.unicode.icu.common-60.2.0.dll 1.47MB
pvt.cppan.demo.behdad.harfbuzz-1.5.1.dll 1.36MB
pvt.cppan.demo.freetype-2.8.1.dll 1.33MB
pvt.cppan.demo.cairographics.cairo-1.15.6.dll 1.27MB
pvt.cppan.demo.gnu.iconv.libiconv-1.15.0.dll 1.23MB
pvt.cppan.demo.webp-0.6.0.dll 1.2MB
pvt.cppan.demo.gnome.glib.glib-2.50.3.dll 1.04MB
pvt.cppan.demo.tiff-4.0.8.dll 953KB
pvt.cppan.demo.gnu.iconv.libiconv-1.15.0.dll 917KB
pvt.cppan.demo.openjpeg.openjp2-2.3.0.dll 872KB
pvt.cppan.demo.freetype-2.8.1.dll 605KB
pvt.cppan.demo.pcre.pcre-8.40.0.dll 570KB
pvt.cppan.demo.jpeg-9.2.0.dll 541KB
pvt.cppan.demo.gnome.glib.gobject-2.50.3.dll 538KB
pvt.cppan.demo.webp-0.6.0.dll 534KB
pvt.cppan.demo.gnome.pango.pango-1.40.9.dll 519KB
pvt.cppan.demo.freedesktop.fontconfig.fontconfig-2.12.1.dll 494KB
pvt.cppan.demo.behdad.harfbuzz-1.5.1.dll 475KB
pvt.cppan.demo.xz_utils.lzma-5.2.3.dll 444KB
pvt.cppan.demo.tiff-4.0.8.dll 428KB
pvt.cppan.demo.png-1.6.33.dll 419KB
pvt.cppan.demo.expat-2.2.5.dll 342KB
pvt.cppan.demo.jpeg-9.2.0.dll 285KB
pvt.cppan.demo.openjpeg.openjp2-2.3.0.dll 278KB
pvt.cppan.demo.gnome.pango.pango-1.40.9.dll 277KB
pvt.cppan.demo.freedesktop.fontconfig.fontconfig-2.12.1.dll 265KB
pvt.cppan.demo.gnome.glib.gobject-2.50.3.dll 250KB
pvt.cppan.demo.pcre.pcre-8.40.0.dll 238KB
pvt.cppan.demo.gnu.gettext.intl-0.19.8.dll 234KB
pvt.cppan.demo.gnome.pango.pangocairo-1.40.9.dll 217KB
pvt.cppan.demo.madler.zlib-1.2.11.dll 205KB
pvt.cppan.demo.png-1.6.33.dll 191KB
pvt.cppan.demo.bzip2-1.0.6.dll 185KB
pvt.cppan.demo.gnome.pango.pangoft2-1.40.9.dll 168KB
pvt.cppan.demo.xz_utils.lzma-5.2.3.dll 151KB
pvt.cppan.demo.expat-2.2.5.dll 143KB
pvt.cppan.demo.weltling.winlibs.libffi-3.2.1.dll 100KB
pvt.cppan.demo.gnome.pango.pangocairo-1.40.9.dll 99KB
pvt.cppan.demo.madler.zlib-1.2.11.dll 85KB
pvt.cppan.demo.gnome.pango.pangoft2-1.40.9.dll 78KB
pvt.cppan.demo.bzip2-1.0.6.dll 71KB
pvt.cppan.demo.gnu.gettext.intl-0.19.8.dll 61KB
pvt.cppan.demo.gnu.iconv.libcharset-1.15.0.dll 52KB
pvt.cppan.demo.weltling.winlibs.libffi-3.2.1.dll 29KB
pvt.cppan.demo.gnu.iconv.libcharset-1.15.0.dll 12KB
tesseract.exe 36KB
tesscallback.h 351KB
allheaders.h 254KB
pix.h 58KB
bmfdata.h 46KB
unicharset.h 42KB
genericvector.h 36KB
baseapi.h 36KB
lstmtrainer.h 22KB
capi.h 22KB
environ.h 21KB
recodebeam.h 19KB
networkio.h 15KB
recog.h 15KB
pageiterator.h 15KB
network.h 14KB
lstmrecognizer.h 13KB
publictypes.h 12KB
readbarcode.h 11KB
dewarp.h 11KB
params.h 11KB
arrayaccess.h 11KB
imageio.h 11KB
unicharcompress.h 10KB
networkscratch.h 10KB
morph.h 9KB
ltrresultiterator.h 9KB
resultiterator.h 9KB
renderer.h 9KB
weightmatrix.h 9KB
networkbuilder.h 8KB
thresholder.h 8KB
ocrclass.h 8KB
functions.h 7KB
jbclass.h 7KB
lstm.h 7KB
strngs.h 7KB
共 218 条
- 1
- 2
- 3
livezingy
- 粉丝: 10
- 资源: 13
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- IBM FileNet Content Manager智能内容服务介绍V3.8
- C++程序设计-参考答案
- STM32超声波测距模块HC-SR04用定时器输入捕获实现测距
- 管理系统开发指南:功能要求、技术栈及安全控制
- 小学生信息管理系统,仅供参考
- IBM决策管理平台ODM介绍
- 汽车租赁管理系统,仅供参考
- 改进多任务transformer模型,以提高输血分类预测和注射种类容量回归预测的精度-医疗AI领域的多任务Transformer模型改进与应用:提高输血分类与注射容量预测的准确性
- 基于霍夫变换的人数检测软件
- IBM Process Mining流程挖掘
- 宿舍管理系统项目源代码全套技术资料.zip
- 最新仿720云全景制作源码-krpano仿720云全景网站源码 新增微信支付+打赏+场景红包
- 02326操作系统历年真题及答案2004-2023及课件PPT
- 音频采样与转换软件界面
- 租房网站项目源代码全套技术资料.zip
- java毕设项目之ssm班主任助理系统的设计与实现+jsp(完整前后端+说明文档+mysql+lw).zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页