Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
a7660331a
tesseract
提交
7a116ce8
T
tesseract
项目概览
a7660331a
/
tesseract
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
tesseract
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a116ce8
编写于
4月 28, 2017
作者:
R
Ray Smith
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More formatting fixes from clang tidy
上级
77015526
变更
10
展开全部
隐藏空白更改
内联
并排
Showing
10 changed file
with
182 addition
and
192 deletion
+182
-192
api/baseapi.cpp
api/baseapi.cpp
+1
-2
arch/simddetect.cpp
arch/simddetect.cpp
+17
-16
arch/simddetect.h
arch/simddetect.h
+2
-6
ccmain/tesseractclass.h
ccmain/tesseractclass.h
+2
-2
ccstruct/debugpixa.h
ccstruct/debugpixa.h
+1
-1
ccstruct/publictypes.h
ccstruct/publictypes.h
+1
-1
ccutil/scanutils.cpp
ccutil/scanutils.cpp
+6
-6
opencl/openclwrapper.cpp
opencl/openclwrapper.cpp
+143
-147
training/degradeimage.cpp
training/degradeimage.cpp
+1
-2
viewer/svutil.cpp
viewer/svutil.cpp
+8
-9
未找到文件。
api/baseapi.cpp
浏览文件 @
7a116ce8
...
...
@@ -1998,8 +1998,7 @@ bool TessBaseAPI::AdaptToWordStr(PageSegMode mode, const char* wordstr) {
for
(
t
=
0
;
text
[
t
]
!=
'\0'
;
++
t
)
{
if
(
text
[
t
]
==
'\n'
||
text
[
t
]
==
' '
)
continue
;
while
(
wordstr
[
w
]
==
' '
)
++
w
;
while
(
wordstr
[
w
]
==
' '
)
++
w
;
if
(
text
[
t
]
!=
wordstr
[
w
])
break
;
++
w
;
...
...
arch/simddetect.cpp
浏览文件 @
7a116ce8
...
...
@@ -20,17 +20,17 @@
#undef X86_BUILD
#if defined(__x86_64__) || defined(__i386__) || defined(_WIN32)
#
if !defined(ANDROID_BUILD)
#
define X86_BUILD 1
#
endif
// !ANDROID_BUILD
#endif // x86 target
#if !defined(ANDROID_BUILD)
#define X86_BUILD 1
#
endif
// !ANDROID_BUILD
#endif
// x86 target
#if defined(X86_BUILD)
#
if defined(__GNUC__)
#
include <cpuid.h>
#
elif defined(_WIN32)
#
include <intrin.h>
#
endif
#if defined(__GNUC__)
#include <cpuid.h>
#elif defined(_WIN32)
#include <intrin.h>
#endif
#endif
SIMDDetect
SIMDDetect
::
detector
;
...
...
@@ -43,16 +43,17 @@ bool SIMDDetect::sse_available_;
// Constructor.
// Tests the architecture in a system-dependent way to detect AVX, SSE and
// any other available SIMD equipment.
// __GNUC__ is also defined by compilers that include GNU extensions such as clang.
// __GNUC__ is also defined by compilers that include GNU extensions such as
// clang.
SIMDDetect
::
SIMDDetect
()
{
#if defined(X86_BUILD)
#
if defined(__GNUC__)
#if defined(__GNUC__)
unsigned
int
eax
,
ebx
,
ecx
,
edx
;
if
(
__get_cpuid
(
1
,
&
eax
,
&
ebx
,
&
ecx
,
&
edx
)
!=
0
)
{
sse_available_
=
(
ecx
&
0x00080000
)
!=
0
;
avx_available_
=
(
ecx
&
0x10000000
)
!=
0
;
}
#
elif defined(_WIN32)
#elif defined(_WIN32)
int
cpuInfo
[
4
];
__cpuid
(
cpuInfo
,
0
);
if
(
cpuInfo
[
0
]
>=
1
)
{
...
...
@@ -60,8 +61,8 @@ SIMDDetect::SIMDDetect() {
sse_available_
=
(
cpuInfo
[
2
]
&
0x00080000
)
!=
0
;
avx_available_
=
(
cpuInfo
[
2
]
&
0x10000000
)
!=
0
;
}
#
else
#
error "I don't know how to test for SIMD with this compiler"
#
endif
#endif // X86_BUILD
#else
#error "I don't know how to test for SIMD with this compiler"
#endif
#endif
// X86_BUILD
}
arch/simddetect.h
浏览文件 @
7a116ce8
...
...
@@ -23,13 +23,9 @@
class
SIMDDetect
{
public:
// Returns true if AVX is available on this system.
static
inline
bool
IsAVXAvailable
()
{
return
detector
.
avx_available_
;
}
static
inline
bool
IsAVXAvailable
()
{
return
detector
.
avx_available_
;
}
// Returns true if SSE4.1 is available on this system.
static
inline
bool
IsSSEAvailable
()
{
return
detector
.
sse_available_
;
}
static
inline
bool
IsSSEAvailable
()
{
return
detector
.
sse_available_
;
}
private:
// Constructor, must set all static member variables.
...
...
ccmain/tesseractclass.h
浏览文件 @
7a116ce8
...
...
@@ -203,8 +203,8 @@ class Tesseract : public Wordrec {
pix_original_
=
original_pix
;
// Clone to sublangs as well.
for
(
int
i
=
0
;
i
<
sub_langs_
.
size
();
++
i
)
sub_langs_
[
i
]
->
set_pix_original
(
original_pix
?
pixClone
(
original_pix
)
:
nullptr
);
sub_langs_
[
i
]
->
set_pix_original
(
original_pix
?
pixClone
(
original_pix
)
:
nullptr
);
}
// Returns a pointer to a Pix representing the best available (original) image
// of the page. Can be of any bit depth, but never color-mapped, as that has
...
...
ccstruct/debugpixa.h
浏览文件 @
7a116ce8
...
...
@@ -44,7 +44,7 @@ class DebugPixa {
// The collection of images to put in the PDF.
Pixa
*
pixa_
;
// The fonts used to draw text captions.
L_B
MF
*
fonts_
;
L_B
mf
*
fonts_
;
};
}
// namespace tesseract
...
...
ccstruct/publictypes.h
浏览文件 @
7a116ce8
...
...
@@ -235,7 +235,7 @@ enum PageIteratorLevel {
*
* JUSTIFICATION_RIGHT
* Each line, except possibly the first, is flush to the same right tab stop.
*/
*/
enum
ParagraphJustification
{
JUSTIFICATION_UNKNOWN
,
JUSTIFICATION_LEFT
,
...
...
ccutil/scanutils.cpp
浏览文件 @
7a116ce8
...
...
@@ -363,28 +363,28 @@ static int tvfscanf(FILE* stream, const char *format, va_list ap) {
case
'p'
:
// Pointer
rank
=
RANK_PTR
;
base
=
0
;
goto
scan_int
;
goto
scan_int
;
case
'i'
:
// Base-independent integer
base
=
0
;
goto
scan_int
;
goto
scan_int
;
case
'd'
:
// Decimal integer
base
=
10
;
goto
scan_int
;
goto
scan_int
;
case
'o'
:
// Octal integer
base
=
8
;
goto
scan_int
;
goto
scan_int
;
case
'u'
:
// Unsigned decimal integer
base
=
10
;
goto
scan_int
;
goto
scan_int
;
case
'x'
:
// Hexadecimal integer
case
'X'
:
base
=
16
;
goto
scan_int
;
goto
scan_int
;
case
'n'
:
// Number of characters consumed
val
=
ftell
(
stream
)
-
start_off
;
...
...
opencl/openclwrapper.cpp
浏览文件 @
7a116ce8
此差异已折叠。
点击以展开。
training/degradeimage.cpp
浏览文件 @
7a116ce8
...
...
@@ -65,8 +65,7 @@ const int kMinRampSize = 1000;
// corresponding to darkening on the copier and <0 lighter and 0 not copied.
// Exposures in [-2,2] are most useful, with -3 and 3 being extreme.
// If rotation is nullptr, rotation is skipped. If *rotation is non-zero, the
// pix
// is rotated by *rotation else it is randomly rotated and *rotation is
// pix is rotated by *rotation else it is randomly rotated and *rotation is
// modified.
//
// HOW IT WORKS:
...
...
viewer/svutil.cpp
浏览文件 @
7a116ce8
...
...
@@ -84,17 +84,16 @@ void SVMutex::Unlock() {
}
// Create new thread.
void
SVSync
::
StartThread
(
void
*
(
*
func
)(
void
*
),
void
*
arg
)
{
void
SVSync
::
StartThread
(
void
*
(
*
func
)(
void
*
),
void
*
arg
)
{
#ifdef _WIN32
LPTHREAD_START_ROUTINE
f
=
(
LPTHREAD_START_ROUTINE
)
func
;
LPTHREAD_START_ROUTINE
f
=
(
LPTHREAD_START_ROUTINE
)
func
;
DWORD
threadid
;
HANDLE
newthread
=
CreateThread
(
NULL
,
// default security attributes
0
,
// use default stack size
f
,
// thread function
arg
,
// argument to thread function
0
,
// use default creation flags
&
threadid
);
// returns the thread identifier
HANDLE
newthread
=
CreateThread
(
NULL
,
// default security attributes
0
,
// use default stack size
f
,
// thread function
arg
,
// argument to thread function
0
,
// use default creation flags
&
threadid
);
// returns the thread identifier
#else
pthread_t
helper
;
pthread_attr_t
attr
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录