Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6e6272a7
提交
6e6272a7
authored
4月 22, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
More changes towards colour FAX support
上级
f93c3f70
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
42 行增加
和
15 行删除
+42
-15
t30.h
libs/spandsp/src/spandsp/private/t30.h
+0
-2
t4_rx.h
libs/spandsp/src/spandsp/t4_rx.h
+2
-2
t30.c
libs/spandsp/src/t30.c
+2
-2
t30_api.c
libs/spandsp/src/t30_api.c
+0
-1
t4_rx.c
libs/spandsp/src/t4_rx.c
+37
-7
fax_tests.c
libs/spandsp/tests/fax_tests.c
+1
-1
没有找到文件。
libs/spandsp/src/spandsp/private/t30.h
浏览文件 @
6e6272a7
...
...
@@ -232,8 +232,6 @@ struct t30_state_s
int
mutual_image_sizes
;
/*! \brief The image coding being used on the line. */
int
line_encoding
;
/*! \brief The image coding being used for output files. */
int
output_encoding
;
/*! \brief The current DCS message minimum scan time code. */
uint8_t
min_scan_time_code
;
/*! \brief The X direction resolution of the current image, in pixels per metre. */
...
...
libs/spandsp/src/spandsp/t4_rx.h
浏览文件 @
6e6272a7
...
...
@@ -563,9 +563,9 @@ SPAN_DECLARE(logging_state_t *) t4_rx_get_logging_state(t4_rx_state_t *s);
/*! \brief Prepare for reception of a document.
\param s The T.4 context.
\param file The name of the file to be received.
\param supported_compressions The compression schemes supported for output to a TIFF file.
\param supported_
output_
compressions The compression schemes supported for output to a TIFF file.
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
t4_rx_state_t
*
)
t4_rx_init
(
t4_rx_state_t
*
s
,
const
char
*
file
,
int
supported_compressions
);
SPAN_DECLARE
(
t4_rx_state_t
*
)
t4_rx_init
(
t4_rx_state_t
*
s
,
const
char
*
file
,
int
supported_
output_
compressions
);
/*! \brief End reception of a document. Tidy up and close the file.
This should be used to end T.4 reception started with t4_rx_init.
...
...
libs/spandsp/src/t30.c
浏览文件 @
6e6272a7
...
...
@@ -2899,7 +2899,7 @@ static int process_rx_dcs(t30_state_t *s, const uint8_t *msg, int len)
}
if
(
s
->
operation_in_progress
!=
OPERATION_IN_PROGRESS_T4_RX
)
{
if
(
t4_rx_init
(
&
s
->
t4
.
rx
,
s
->
rx_file
,
s
->
output_encoding
)
==
NULL
)
if
(
t4_rx_init
(
&
s
->
t4
.
rx
,
s
->
rx_file
,
s
->
supported_output_compressions
)
==
NULL
)
{
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"Cannot open target TIFF file '%s'
\n
"
,
s
->
rx_file
);
t30_set_status
(
s
,
T30_ERR_FILEERROR
);
...
...
@@ -6806,7 +6806,7 @@ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s,
|
T4_SUPPORT_LENGTH_UNLIMITED
;
/* Set the output encoding to something safe. Most things get 1D and 2D
encoding right. Quite a lot get other things wrong. */
s
->
output_encoding
=
T4_COMPRESSION_T4_2D
;
s
->
supported_output_compressions
=
T4_COMPRESSION_T4_2D
;
s
->
local_min_scan_time_code
=
T30_MIN_SCAN_0MS
;
span_log_init
(
&
s
->
logging
,
SPAN_LOG_NONE
,
NULL
);
span_log_set_protocol
(
&
s
->
logging
,
"T.30"
);
...
...
libs/spandsp/src/t30_api.c
浏览文件 @
6e6272a7
...
...
@@ -649,7 +649,6 @@ SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled)
SPAN_DECLARE
(
int
)
t30_set_supported_output_compressions
(
t30_state_t
*
s
,
int
supported_compressions
)
{
s
->
supported_output_compressions
=
supported_compressions
;
s
->
output_encoding
=
supported_compressions
;
return
0
;
}
/*- End of function --------------------------------------------------------*/
...
...
libs/spandsp/src/t4_rx.c
浏览文件 @
6e6272a7
...
...
@@ -578,13 +578,13 @@ static int write_tiff_image(t4_rx_state_t *s)
offset
=
0
;
if
(
!
TIFFWriteCustomDirectory
(
t
->
tiff_file
,
&
offset
))
printf
(
"Failed to write custom directory.
\n
"
);
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"Failed to write custom directory.
\n
"
);
/* Now go back and patch in the pointer to the new IFD */
if
(
!
TIFFSetDirectory
(
t
->
tiff_file
,
s
->
current_page
))
printf
(
"Failed to set directory.
\n
"
);
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"Failed to set directory.
\n
"
);
if
(
!
TIFFSetField
(
t
->
tiff_file
,
TIFFTAG_GLOBALPARAMETERSIFD
,
offset
))
printf
(
"Failed to set field.
\n
"
);
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"Failed to set field.
\n
"
);
if
(
!
TIFFWriteDirectory
(
t
->
tiff_file
))
span_log
(
&
s
->
logging
,
SPAN_LOG_WARNING
,
"%s: Failed to write directory for page %d.
\n
"
,
t
->
file
,
s
->
current_page
);
}
...
...
@@ -726,6 +726,31 @@ SPAN_DECLARE(void) t4_rx_set_model(t4_rx_state_t *s, const char *model)
}
/*- End of function --------------------------------------------------------*/
static
void
select_tiff_compression
(
t4_rx_state_t
*
s
,
int
output_image_type
)
{
if
(
output_image_type
==
T4_IMAGE_TYPE_BILEVEL
)
{
/* Only provide for one form of coding throughout the file, even though the
coding on the wire could change between pages. */
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T85
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T85
;
else
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T6
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T6
;
else
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T4_2D
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T4_2D
;
else
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T4_1D
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T4_1D
;
}
else
{
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T42_T81
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T42_T81
;
else
if
((
s
->
supported_tiff_compressions
&
T4_SUPPORT_COMPRESSION_T43
))
s
->
tiff
.
output_encoding
=
T4_COMPRESSION_T43
;
}
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
int
)
t4_rx_set_rx_encoding
(
t4_rx_state_t
*
s
,
int
encoding
)
{
switch
(
encoding
)
...
...
@@ -744,6 +769,7 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
break
;
}
s
->
line_encoding
=
encoding
;
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_BILEVEL
);
return
t4_t6_decode_set_encoding
(
&
s
->
decoder
.
t4_t6
,
encoding
);
case
T4_COMPRESSION_T85
:
case
T4_COMPRESSION_T85_L0
:
...
...
@@ -760,6 +786,7 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
t85_decode_set_image_size_constraints
(
&
s
->
decoder
.
t85
,
T4_WIDTH_1200_A3
,
0
);
break
;
}
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_BILEVEL
);
s
->
line_encoding
=
encoding
;
return
0
;
#if defined(SPANDSP_SUPPORT_T88)
...
...
@@ -771,6 +798,7 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
default
:
break
;
}
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_BILEVEL
);
s
->
line_encoding
=
encoding
;
return
0
;
#endif
...
...
@@ -790,6 +818,7 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
break
;
}
s
->
line_encoding
=
encoding
;
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_COLOUR_8BIT
);
return
0
;
#if defined(SPANDSP_SUPPORT_T43)
case
T4_COMPRESSION_T43
:
...
...
@@ -806,6 +835,7 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
break
;
}
s
->
line_encoding
=
encoding
;
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_COLOUR_8BIT
);
return
0
;
#endif
#if defined(SPANDSP_SUPPORT_T45)
...
...
@@ -818,9 +848,11 @@ SPAN_DECLARE(int) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding)
break
;
}
s
->
line_encoding
=
encoding
;
select_tiff_compression
(
s
,
T4_IMAGE_TYPE_COLOUR_8BIT
);
return
0
;
#endif
}
return
-
1
;
}
/*- End of function --------------------------------------------------------*/
...
...
@@ -1055,7 +1087,7 @@ SPAN_DECLARE(logging_state_t *) t4_rx_get_logging_state(t4_rx_state_t *s)
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
t4_rx_state_t
*
)
t4_rx_init
(
t4_rx_state_t
*
s
,
const
char
*
file
,
int
output_encoding
)
SPAN_DECLARE
(
t4_rx_state_t
*
)
t4_rx_init
(
t4_rx_state_t
*
s
,
const
char
*
file
,
int
supported_output_compressions
)
{
int
allocated
;
...
...
@@ -1075,9 +1107,7 @@ SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int
span_log
(
&
s
->
logging
,
SPAN_LOG_FLOW
,
"Start rx document
\n
"
);
/* Only provide for one form of coding throughout the file, even though the
coding on the wire could change between pages. */
s
->
tiff
.
output_encoding
=
output_encoding
;
s
->
supported_tiff_compressions
=
supported_output_compressions
;
/* Set some default values */
s
->
metadata
.
x_resolution
=
T4_X_RESOLUTION_R8
;
...
...
libs/spandsp/tests/fax_tests.c
浏览文件 @
6e6272a7
...
...
@@ -861,7 +861,7 @@ int main(int argc, char *argv[])
|
T4_SUPPORT_RESOLUTION_600_1200
|
T4_SUPPORT_RESOLUTION_1200_1200
);
t30_set_supported_colour_resolutions
(
t30_state
[
i
],
0
);
//t30_set_rx_encoding(t30_state[i], T4_COMPRESSION_T6
);
t30_set_supported_output_compressions
(
t30_state
[
i
],
T4_SUPPORT_COMPRESSION_T4_2D
);
t30_set_ecm_capability
(
t30_state
[
i
],
use_ecm
);
t30_set_supported_compressions
(
t30_state
[
i
],
T4_SUPPORT_COMPRESSION_T4_1D
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论