Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c07513ea
提交
c07513ea
authored
4月 02, 2015
作者:
Anthony Minessale
提交者:
Michael Jerris
5月 28, 2015
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-7506: make freetype optional
上级
83b72513
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
2 行删除
+23
-2
Makefile.am
Makefile.am
+4
-0
configure.ac
configure.ac
+3
-1
switch_core_video.c
src/switch_core_video.c
+16
-1
没有找到文件。
Makefile.am
浏览文件 @
c07513ea
...
...
@@ -149,6 +149,10 @@ if HAVE_PNG
CORE_CFLAGS
+=
-DSWITCH_HAVE_PNG
$(LIBPNG_CFLAGS)
endif
if
HAVE_FREETYPE
CORE_CFLAGS
+=
-DSWITCH_HAVE_FREETYPE
$(LIBFREETYPE_CFLAGS)
endif
##
## libfreeswitch
##
...
...
configure.ac
浏览文件 @
c07513ea
...
...
@@ -1205,7 +1205,9 @@ PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.6.16],[
PKG_CHECK_MODULES([LIBPNG], [libpng >= 1.2.49],[
AM_CONDITIONAL([HAVE_PNG],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_PNG],[false])])])])
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9])
PKG_CHECK_MODULES([FREETYPE], [freetype2 >= 2.4.9],[
AM_CONDITIONAL([HAVE_FREETYPE],[true])],[
AC_MSG_RESULT([no]); AM_CONDITIONAL([HAVE_FREETYPE],[false])])
PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.6.20])
PKG_CHECK_MODULES([CURL], [libcurl >= 7.19])
PKG_CHECK_MODULES([PCRE], [libpcre >= 7.8])
...
...
src/switch_core_video.c
浏览文件 @
c07513ea
...
...
@@ -419,15 +419,19 @@ SWITCH_DECLARE(void) switch_color_set_yuv(switch_yuv_color_t *color, const char
switch_color_rgb2yuv
(
&
rgb
,
color
);
}
#if SWITCH_HAVE_FREETYPE
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#endif
#define MAX_GRADIENT 8
struct
switch_img_txt_handle_s
{
#if SWITCH_HAVE_FREETYPE
FT_Library
library
;
FT_Face
face
;
#endif
char
*
font_family
;
double
angle
;
uint16_t
font_size
;
...
...
@@ -470,9 +474,13 @@ SWITCH_DECLARE(switch_status_t) switch_img_txt_handle_create(switch_img_txt_hand
new_handle
=
switch_core_alloc
(
pool
,
sizeof
(
*
new_handle
));
#if SWITCH_HAVE_FREETYPE
if
(
FT_Init_FreeType
(
&
new_handle
->
library
))
{
return
SWITCH_STATUS_FALSE
;
}
#else
return
SWITCH_STATUS_FALSE
;
#endif
new_handle
->
pool
=
pool
;
new_handle
->
free_pool
=
free_pool
;
...
...
@@ -498,11 +506,12 @@ SWITCH_DECLARE(void) switch_img_txt_handle_destroy(switch_img_txt_handle_t **han
*
handleP
=
NULL
;
#if SWITCH_HAVE_FREETYPE
if
(
old_handle
->
library
)
{
FT_Done_FreeType
(
old_handle
->
library
);
old_handle
->
library
=
NULL
;
}
#endif
pool
=
old_handle
->
pool
;
if
(
old_handle
->
free_pool
)
{
...
...
@@ -513,6 +522,7 @@ SWITCH_DECLARE(void) switch_img_txt_handle_destroy(switch_img_txt_handle_t **han
}
#if SWITCH_HAVE_FREETYPE
static
void
draw_bitmap
(
switch_img_txt_handle_t
*
handle
,
switch_image_t
*
img
,
FT_Bitmap
*
bitmap
,
FT_Int
x
,
FT_Int
y
)
{
FT_Int
i
,
j
,
p
,
q
;
...
...
@@ -569,12 +579,14 @@ static void draw_bitmap(switch_img_txt_handle_t *handle, switch_image_t *img, FT
}
}
}
#endif
SWITCH_DECLARE
(
switch_status_t
)
switch_img_txt_handle_render
(
switch_img_txt_handle_t
*
handle
,
switch_image_t
*
img
,
int
x
,
int
y
,
const
char
*
text
,
const
char
*
font_family
,
const
char
*
font_color
,
const
char
*
bgcolor
,
uint16_t
font_size
,
double
angle
)
{
#if SWITCH_HAVE_FREETYPE
FT_GlyphSlot
slot
;
FT_Matrix
matrix
;
/* transformation matrix */
FT_Vector
pen
;
/* untransformed origin */
...
...
@@ -667,6 +679,9 @@ SWITCH_DECLARE(switch_status_t) switch_img_txt_handle_render(switch_img_txt_hand
FT_Done_Face
(
face
);
return
SWITCH_STATUS_SUCCESS
;
#else
return
SWITCH_STATUS_FALSE
;
#endif
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论