Main

概述

Main 是 Aspose.Font FOSS 中用于 Python 的类。继承自:decode_Decode。

Main.ParseQuality 将字符串 s 中的质量设置解析为 quality 对象。

此类提供 27 个用于在 Python 程序中操作 Main 对象的方法。可用的方法包括:BROTLI_FAILURE、BROTLI_LOG、BROTLI_LOG_ARRAY_INDEX、BROTLI_LOG_UCHAR_VECTOR、BROTLI_LOG_UINT、BrotliDecompress、BrotliDecompressStreaming、BrotliDecompressedSize、CopyUncompressedBlockToOutput、DecodeBlockType、DecodeBlockTypeWithContext、DecodeContextMap,以及另外 15 个方法。安装 Aspose.Font FOSS for Python 包后,所有公共成员对任何 Python 应用程序都可访问。

方法

签名描述
__init__()Calls init 在此 Main 实例上。
ParseQuality(s, quality)将字符串 s 中的质量设置解析为 quality 对象
ParseArgv(argc, argv, input_path, output_path, force, quality, decompress)处理命令行参数 (argc, argv),并填充 input_path、output_path、force、quality、decompress
main()作为程序入口点,执行 font tool 工作流
BROTLI_FAILURE()返回一个常量,指示 Brotli 解压缩失败
BROTLI_LOG_UINT(x)记录无符号整数 x 用于 Brotli 调试
BROTLI_LOG_ARRAY_INDEX(array_name, idx)记录 array_name 的索引 idx 用于 Brotli 调试
BROTLI_LOG(x)在 Brotli 处理期间记录通用消息 x
BROTLI_LOG_UCHAR_VECTOR(v, _hx_len)记录一个长度为 _hx_len 的向量 v,用于 Brotli 调试
DecodeWindowBits(br)从位读取器 br 读取 Brotli 流的窗口位
DecodeVarLenUint8(br)从位读取器 br 读取可变长度的 uint8
JumpToByteBoundary(br)将 br 前进到下一个字节边界
DecodeMetaBlockLength(br, meta_block_length, input_end, is_metadata, is_uncompressed)从 br 解码元块长度,设置长度和标志
ReadSymbol(table, table_off, br)使用 br 从偏移量 table_off 处的表读取符号
ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, s)读取 num_symbols 的 Huffman 码长度到 code_lengths
ReadHuffmanCode(alphabet_size, table, table_off, opt_table_size, s)使用 br 和 s 为 alphabet_size 构建 Huffman 码表
ReadBlockLength(table, table_off, br)使用 br 从位于 table_off 的表中读取块长度
TranslateShortCodes(code, ringbuffer, index)将短码转换为索引处的环形缓冲区位置
InverseMoveToFrontTransform(v, v_len)对长度为 v_len 的向量 v 执行 MTF 逆操作
HuffmanTreeGroupDecode(group, s)使用 s 解码一组 Huffman 树
DecodeContextMap(context_map_size, num_htrees, context_map, s)使用 s 解码给定大小和树数量的上下文映射
DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br)使用 max_block_type 以及相关表格确定块类型
DecodeBlockTypeWithContext(s, br)使用来自 br 的额外上下文解码块类型
CopyUncompressedBlockToOutput(output, pos, s)将未压缩的块数据复制到输出的 pos 位置
BrotliDecompressedSize(encoded_size, encoded_buffer, encoded_buffer_off, decoded_size)根据编码缓冲区参数计算解压后的大小
BrotliDecompressStreaming(input, output, finish, s)执行从输入到输出的流式 Brotli 解压缩
BrotliDecompress(input, output)将完整的 Brotli 缓冲区从输入解压缩到输出

另请参阅

 中文