Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Harfbuzz
提交
8caf5dcd
T
Third Party Harfbuzz
项目概览
OpenHarmony
/
Third Party Harfbuzz
大约 1 年 前同步成功
通知
0
Star
18
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Harfbuzz
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8caf5dcd
编写于
5月 13, 2012
作者:
B
Behdad Esfahbod
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Minor
上级
617f4ac4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
33 addition
and
34 deletion
+33
-34
util/ansi-print.cc
util/ansi-print.cc
+33
-34
未找到文件。
util/ansi-print.cc
浏览文件 @
8caf5dcd
...
@@ -251,8 +251,6 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
...
@@ -251,8 +251,6 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
col_sum_i
[
i
]
+=
col_sum_i
[
i
-
1
];
col_sum_i
[
i
]
+=
col_sum_i
[
i
-
1
];
}
}
*
score
=
(
unsigned
int
)
-
1
;
*
inverse
=
false
;
const
char
*
best_c
=
" "
;
const
char
*
best_c
=
" "
;
/* Maybe empty is better! */
/* Maybe empty is better! */
...
@@ -301,7 +299,6 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
...
@@ -301,7 +299,6 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
}
}
/* Find best left line */
/* Find best left line */
/* Disable this as it looks ugly because of line height issues. */
if
(
1
)
{
if
(
1
)
{
unsigned
int
best_s
=
(
unsigned
int
)
-
1
;
unsigned
int
best_s
=
(
unsigned
int
)
-
1
;
bool
best_inv
=
false
;
bool
best_inv
=
false
;
...
@@ -333,35 +330,37 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
...
@@ -333,35 +330,37 @@ block_best (const biimage_t &bi, unsigned int *score, bool *inverse)
}
}
}
}
/* Quadrant? */
/* Find best quadrant */
unsigned
int
q
=
0
;
if
(
1
)
{
unsigned
int
qs
=
0
;
unsigned
int
q
=
0
;
for
(
unsigned
int
i
=
0
;
i
<
2
;
i
++
)
unsigned
int
qs
=
0
;
for
(
unsigned
int
j
=
0
;
j
<
2
;
j
++
)
for
(
unsigned
int
i
=
0
;
i
<
2
;
i
++
)
if
(
quad
[
i
][
j
]
>
quad_i
[
i
][
j
])
{
for
(
unsigned
int
j
=
0
;
j
<
2
;
j
++
)
q
+=
1
<<
(
2
*
i
+
j
);
if
(
quad
[
i
][
j
]
>
quad_i
[
i
][
j
])
{
qs
+=
quad_i
[
i
][
j
];
q
+=
1
<<
(
2
*
i
+
j
);
}
else
qs
+=
quad_i
[
i
][
j
];
qs
+=
quad
[
i
][
j
];
}
else
if
(
qs
<
*
score
)
{
qs
+=
quad
[
i
][
j
];
const
char
*
c
=
NULL
;
if
(
qs
<
*
score
)
{
bool
inv
=
false
;
const
char
*
c
=
NULL
;
switch
(
q
)
{
bool
inv
=
false
;
case
1
:
c
=
"▟"
;
inv
=
true
;
break
;
switch
(
q
)
{
case
2
:
c
=
"▙"
;
inv
=
true
;
break
;
case
1
:
c
=
"▟"
;
inv
=
true
;
break
;
case
4
:
c
=
"▖"
;
inv
=
false
;
break
;
case
2
:
c
=
"▙"
;
inv
=
true
;
break
;
case
8
:
c
=
"▗"
;
inv
=
false
;
break
;
case
4
:
c
=
"▖"
;
inv
=
false
;
break
;
case
9
:
c
=
"▚"
;
inv
=
false
;
break
;
case
8
:
c
=
"▗"
;
inv
=
false
;
break
;
case
6
:
c
=
"▞"
;
inv
=
false
;
break
;
case
9
:
c
=
"▚"
;
inv
=
false
;
break
;
case
7
:
c
=
"▜"
;
inv
=
true
;
break
;
case
6
:
c
=
"▞"
;
inv
=
false
;
break
;
case
11
:
c
=
"▜"
;
inv
=
true
;
break
;
case
7
:
c
=
"▜"
;
inv
=
true
;
break
;
case
13
:
c
=
"▙"
;
inv
=
true
;
break
;
case
11
:
c
=
"▜"
;
inv
=
true
;
break
;
case
14
:
c
=
"▟"
;
inv
=
true
;
break
;
case
13
:
c
=
"▙"
;
inv
=
true
;
break
;
}
case
14
:
c
=
"▟"
;
inv
=
true
;
break
;
if
(
c
)
{
}
*
score
=
qs
;
if
(
c
)
{
*
inverse
=
inv
;
*
score
=
qs
;
best_c
=
c
;
*
inverse
=
inv
;
best_c
=
c
;
}
}
}
}
}
...
@@ -377,7 +376,7 @@ ansi_print_image_rgb24 (const uint32_t *data,
...
@@ -377,7 +376,7 @@ ansi_print_image_rgb24 (const uint32_t *data,
image_t
image
(
width
,
height
,
data
,
stride
);
image_t
image
(
width
,
height
,
data
,
stride
);
unsigned
int
rows
=
(
height
+
CELL_H
-
1
)
/
CELL_H
;
unsigned
int
rows
=
(
height
+
CELL_H
-
1
)
/
CELL_H
;
unsigned
int
cols
=
(
width
+
CELL_W
-
1
)
/
CELL_W
;
unsigned
int
cols
=
(
width
+
CELL_W
-
1
)
/
CELL_W
;
image_t
cell
(
CELL_W
,
CELL_H
);
image_t
cell
(
CELL_W
,
CELL_H
);
biimage_t
bi
(
CELL_W
,
CELL_H
);
biimage_t
bi
(
CELL_W
,
CELL_H
);
unsigned
int
last_bg
=
-
1
,
last_fg
=
-
1
;
unsigned
int
last_bg
=
-
1
,
last_fg
=
-
1
;
...
@@ -394,7 +393,7 @@ ansi_print_image_rgb24 (const uint32_t *data,
...
@@ -394,7 +393,7 @@ ansi_print_image_rgb24 (const uint32_t *data,
}
else
{
}
else
{
/* Figure out the closest character to the biimage */
/* Figure out the closest character to the biimage */
unsigned
int
score
=
(
unsigned
int
)
-
1
;
unsigned
int
score
=
(
unsigned
int
)
-
1
;
bool
inverse
;
bool
inverse
=
false
;
const
char
*
c
=
block_best
(
bi
,
&
score
,
&
inverse
);
const
char
*
c
=
block_best
(
bi
,
&
score
,
&
inverse
);
if
(
inverse
)
{
if
(
inverse
)
{
if
(
last_bg
!=
bi
.
fg
||
last_fg
!=
bi
.
bg
)
{
if
(
last_bg
!=
bi
.
fg
||
last_fg
!=
bi
.
bg
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录