Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
37d109b1
提交
37d109b1
authored
5月 15, 2013
作者:
Steve Underwood
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Some tweaks to the image translate code
上级
97faaab4
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
55 行增加
和
37 行删除
+55
-37
image_translate.c
libs/spandsp/src/image_translate.c
+12
-3
image_translate.h
libs/spandsp/src/spandsp/image_translate.h
+16
-8
t42_t43_local.h
libs/spandsp/src/t42_t43_local.h
+1
-0
t4_tx.c
libs/spandsp/src/t4_tx.c
+1
-1
image_translate_tests.c
libs/spandsp/tests/image_translate_tests.c
+25
-25
没有找到文件。
libs/spandsp/src/image_translate.c
浏览文件 @
37d109b1
...
...
@@ -48,6 +48,7 @@
#include <math.h>
#endif
#include "floating_fudge.h"
#include <jpeglib.h>
#include <tiffio.h>
#include <assert.h>
...
...
@@ -648,13 +649,21 @@ SPAN_DECLARE(int) image_translate_get_output_length(image_translate_state_t *s)
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
int
)
image_translate_set_row_read_handler
(
image_translate_state_t
*
s
,
t4_row_read_handler_t
row_read_handler
,
void
*
row_read_user_data
)
{
s
->
row_read_handler
=
row_read_handler
;
s
->
row_read_user_data
=
row_read_user_data
;
return
0
;
}
/*- End of function --------------------------------------------------------*/
SPAN_DECLARE
(
image_translate_state_t
*
)
image_translate_init
(
image_translate_state_t
*
s
,
int
input_format
,
int
input_width
,
int
input_length
,
int
output_format
,
int
output_width
,
int
output_length
,
int
input_format
,
int
input_width
,
int
input_length
,
t4_row_read_handler_t
row_read_handler
,
void
*
row_read_user_data
)
{
...
...
libs/spandsp/src/spandsp/image_translate.h
浏览文件 @
37d109b1
...
...
@@ -66,29 +66,37 @@ SPAN_DECLARE(int) image_translate_get_output_width(image_translate_state_t *s);
\return The length of the output image, in pixel. */
SPAN_DECLARE
(
int
)
image_translate_get_output_length
(
image_translate_state_t
*
s
);
/*! \brief Set the row read callback routine for an image translation context.
\param s The image translation context.
\param row_read_handler A callback routine used to pull rows of pixels from the source image
into the translation process.
\param row_read_user_data An opaque pointer passed to read_row_handler
\return 0 for success, else -1. */
SPAN_DECLARE
(
int
)
image_translate_set_row_read_handler
(
image_translate_state_t
*
s
,
t4_row_read_handler_t
row_read_handler
,
void
*
row_read_user_data
);
/*! \brief Initialise an image translation context for rescaling and squashing a gray scale
or colour image to a bi-level FAX type image.
\param s The image translation context.
\param input_format x
\param input_width The width of the source image, in pixels.
\param input_length The length of the source image, in pixels.
\param output_format x
\param output_format The type of output image
\param output_width The width of the output image, in pixels. If this is set <= 0 the image
will not be resized.
\param output_length The length of the output image, in pixels. If this is set to <= 0 the
output length will be derived automatically from the width, to maintain the geometry
of the original image.
\param input_format The type of source image
\param input_width The width of the source image, in pixels.
\param input_length The length of the source image, in pixels.
\param row_read_handler A callback routine used to pull rows of pixels from the source image
into the translation process.
\param row_read_user_data An opaque point passed to read_row_handler
\param row_read_user_data An opaque point
er
passed to read_row_handler
\return A pointer to the context, or NULL if there was a problem. */
SPAN_DECLARE
(
image_translate_state_t
*
)
image_translate_init
(
image_translate_state_t
*
s
,
int
input_format
,
int
input_width
,
int
input_length
,
int
output_format
,
int
output_width
,
int
output_length
,
int
input_format
,
int
input_width
,
int
input_length
,
t4_row_read_handler_t
row_read_handler
,
void
*
row_read_user_data
);
...
...
libs/spandsp/src/t42_t43_local.h
浏览文件 @
37d109b1
...
...
@@ -34,6 +34,7 @@ extern "C"
#endif
void
set_illuminant_from_code
(
logging_state_t
*
logging
,
lab_params_t
*
s
,
const
uint8_t
code
[
4
]);
void
set_gamut_from_code
(
logging_state_t
*
logging
,
lab_params_t
*
s
,
const
uint8_t
code
[
12
]);
#if defined(__cplusplus)
...
...
libs/spandsp/src/t4_tx.c
浏览文件 @
37d109b1
...
...
@@ -834,7 +834,7 @@ static int read_tiff_image(t4_tx_state_t *s)
{
/* We need to dither this image down to pure black and white, possibly resizing it
along the way. */
if
((
translator
=
image_translate_init
(
NULL
,
s
->
tiff
.
image_type
,
s
->
image_width
,
s
->
image_length
,
T4_IMAGE_TYPE_BILEVEL
,
1728
,
-
1
,
row_read
,
s
))
==
NULL
)
if
((
translator
=
image_translate_init
(
NULL
,
T4_IMAGE_TYPE_BILEVEL
,
1728
,
-
1
,
s
->
tiff
.
image_type
,
s
->
image_width
,
s
->
image_length
,
row_read
,
s
))
==
NULL
)
return
-
1
;
s
->
image_width
=
image_translate_get_output_width
(
translator
);
s
->
image_length
=
image_translate_get_output_length
(
translator
);
...
...
libs/spandsp/tests/image_translate_tests.c
浏览文件 @
37d109b1
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论