跳到主要内容

4.6 数据转换

为了把一种数据结构转换为另一种,系统提供了若干转换模块。这些模块分为两类:任务进程和子程序。任务进程是 MOS 进程,只能在本文所述的环境中使用;子程序用 c 编写,在 UNIX 下兼容,用途更广。

字符串或文本可以转换为向量格式,从而形成图片与文字结合的集成图像。

下表列出这些转换模块,包括其功能和描述(见附录 3)。

module  type          from          to      description

decomp process dacom vector decomp(fax)
recomp process vector dacom recomp(fax)

ccitt process vector t4 ccitt(fax)
t4 vector

bitmap subroutine vector bitmap bit-map(fax)
tovec subroutine bitmap vector tovec(fax)

ts subroutine ASCII string vector ts(fax)
string process ASCII string vector string(fax)
tf process text vector tf(fax)

由于每个 DACOM 块都包含循环冗余校验(Cyclic Redundancy Check,CRC)字段,系统提供了子程序 crc() 来计算或检查 CRC 码(见 crc(fax))。

如果要在 DACOM 传真机上打印向量文件,图像数据应重新压缩为 DACOM 块格式,所需的命令字符串如下。

fs"e,pic|recomp|fax"w

where fs - file system task
e - read an existing file
ic - file name
recomp - re-compression task
fax - interface task for facsimile machine
w - print an image on facsimile machine