#ifndef MUPDF_FITZ_FILTER_H
#define MUPDF_FITZ_FILTER_H
#include “mupdf/fitz/system.h”
#include “mupdf/fitz/context.h”
#include “mupdf/fitz/buffer.h”
#include “mupdf/fitz/store.h”
#include “mupdf/fitz/stream.h”
typedef struct fz_jbig2_globals fz_jbig2_globals;
typedef struct
{
int64_t offset;
size_t length;
} fz_range;
/**
The null filter reads a specified amount of data from the
substream.
空过滤器从子流中读取指定数量的数据。
*/
fz_stream *fz_open_null_filter(fz_context *ctx, fz_stream *chain, int len, int64_t offset);
/**
The range filter copies data from specified ranges of the
chained stream.
范围过滤器从指定范围内复制数据链式流。
*/
fz_stream *fz_open_range_filter(fz_context *ctx, fz_stream *chain, fz_range *ranges, int nranges);
/**
The endstream filter reads a PDF substream, and starts to look
for an ‘endstream’ token after the specified length.
端流过滤器读取 PDF 子流,并开始查找对于指定长度之后的“endstream”标记。
*/
fz_stream *fz_open_endstream_filter(fz_context *ctx, fz_stream *chain, int len, int64_t offset);
/**
Concat filter concatenates several streams into one.
Concat 过滤器将多个流连接成一个。
*/
fz_stream *fz_open_concat(fz_context *ctx, int max, int pad);
/**
Add a chained stream to the end of the concatenate filter.
Ownership of chain is passed in.
将链接流添加到串联过滤器的末尾。
链的所有权传入。
*/
void fz_concat_push_drop(fz_context *ctx, fz_stream *concat, fz_stream *chain);
/**
arc4 filter performs RC4 decoding of data read from the chained
filter using the supplied key.
arc4 过滤器对从链接的数据读取的数据执行 RC4 解码使用提供的密钥过滤。
*/
fz_stream *fz_open_arc4(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen);
/**
aesd filter performs AES decoding of data read from the chained
filter using the supplied key.
aesd 过滤器对从链接的数据读取的数据执行 AES 解码使用提供的密钥过滤。
*/
fz_stream *fz_open_aesd(fz_context *ctx, fz_stream *chain, unsigned char *key, unsigned keylen);
/**
a85d filter performs ASCII 85 Decoding of data read
from the chained filter.
a85d 过滤器对读取的数据执行 ASCII 85 解码来自链式过滤器。
*/
fz_stream *fz_open_a85d(fz_context *ctx, fz_stream *chain);
/**
ahxd filter performs ASCII Hex decoding of data read
from the chained filter.
ahxd 过滤器对读取的数据执行 ASCII 十六进制解码来自链式过滤器。
*/
fz_stream *fz_open_ahxd(fz_context *ctx, fz_stream *chain);
/**
rld filter performs Run Length Decoding of data read
from the chained filter.
rld 过滤器对读取的数据执行运行长度解码来自链式过滤器。
*/
fz_stream *fz_open_rld(fz_context *ctx, fz_stream *chain);
/**
dctd filter performs DCT (JPEG) decoding of data read
from the chained filter.
color_transform implements the PDF color_transform option;
use -1 (unset) as a default.
For subsampling on decode, set l2factor to the log2 of the
reduction required (therefore 0 = full size decode).
jpegtables is an optional stream from which the JPEG tables
can be read. Use NULL if not required.
dctd 过滤器对读取的数据执行 DCT (JPEG) 解码
来自链式过滤器。
color_transform 实现 PDF color_transform 选项;
使用 -1(未设置)作为默认值。
对于解码的子采样,将 l2factor 设置为
需要减少(因此 0 = 全尺寸解码)。
jpegtables 是一个可选的流,其中 JPEG 表
可以阅读。 如果不需要,请使用 NULL。
*/
fz_stream *fz_open_dctd(fz_context *ctx, fz_stream *chain, int color_transform, int l2factor, fz_stream *jpegtables);
/**
faxd filter performs FAX decoding of data read from
the chained filter.
k: see fax specification (fax default is 0).
end_of_line: whether we expect end of line markers (fax default
is 0).
encoded_byte_align: whether we align to bytes after each line
(fax default is 0).
columns: how many columns in the image (fax default is 1728).
rows: 0 for unspecified or the number of rows of data to expect.
end_of_block: whether we expect end of block markers (fax
default is 1).
black_is_1: determines the polarity of the image (fax default is
0).
faxd 过滤器对读取的数据执行传真解码
链式过滤器。
k:参见传真规格(传真默认值为 0)。
end_of_line:我们是否期望行尾标记(传真默认
是 0)。
encoding_byte_align:我们是否在每行之后对齐字节
(传真默认为 0)。
列:图像中有多少列(传真默认为 1728)。
行:0 表示未指定或期望的数据行数。
end_of_block:我们是否期望块结束标记(传真
默认为 1)。
black_is_1:决定图像的极性(传真默认为
0)。
*/
fz_stream *fz_open_faxd(fz_context *ctx, fz_stream *chain,
int k, int end_of_line, int encoded_byte_align,
int columns, int rows, int end_of_block, int black_is_1);
/**
flated filter performs LZ77 decoding (inflating) of data read
from the chained filter.
window_bits: How large a decompression window to use. Typically
15. A negative number, -n, means to use n bits, but to expect
raw data with no header.
flated 过滤器对读取的数据执行 LZ77 解码(膨胀)
来自链式过滤器。
window_bits:使用多大的解压窗口。 通常
15. 负数 -n 表示使用 n 位,但期望
没有标题的原始数据。
*/
fz_stream *fz_open_flated(fz_context *ctx, fz_stream *chain, int window_bits);
/**
lzwd filter performs LZW decoding of data read from the chained
filter.
early_change: (Default 1) specifies whether to change codes 1
bit early.
min_bits: (Default 9) specifies the minimum number of bits to
use.
reverse_bits: (Default 0) allows for compatibility with gif and
old style tiffs (1).
old_tiff: (Default 0) allows for different handling of the clear
code, as found in old style tiffs.
lzwd 过滤器对从链接的数据读取的数据执行 LZW 解码
筛选。
early_change:(默认1)指定是否更改代码1
有点早。
min_bits:(默认 9)指定最小位数
用。
reverse_bits:(默认 0)允许与 gif 和
旧式 tiffs (1)。
old_tiff:(默认 0)允许对清除进行不同的处理
代码,如旧式 tiffs 中所示。
*/
fz_stream *fz_open_lzwd(fz_context *ctx, fz_stream *chain, int early_change, int min_bits, int reverse_bits, int old_tiff);
/**
predict filter performs pixel prediction on data read from
the chained filter.
predictor: 1 = copy, 2 = tiff, other = inline PNG predictor
columns: width of image in pixels
colors: number of components.
bpc: bits per component (typically 8)
预测过滤器对从中读取的数据执行像素预测
链式过滤器。
预测器:1 = 复制,2 = tiff,其他 = 内联 PNG 预测器
列:以像素为单位的图像宽度
颜色:组件的数量。
bpc:每个组件的位数(通常为 8)
*/
fz_stream *fz_open_predict(fz_context *ctx, fz_stream *chain, int predictor, int columns, int colors, int bpc);
/**
Open a filter that performs jbig2 decompression on the chained
stream, using the optional globals record.
打开一个过滤器,对链接的文件执行 jbig2 解压
流,使用可选的全局记录。
*/
fz_stream *fz_open_jbig2d(fz_context *ctx, fz_stream *chain, fz_jbig2_globals *globals, int embedded);
/**
Create a jbig2 globals record from a buffer.
Immutable once created.
从缓冲区创建 jbig2 全局记录。
创建后不可变。
*/
fz_jbig2_globals *fz_load_jbig2_globals(fz_context *ctx, fz_buffer *buf);
/**
Increment the reference count for a jbig2 globals record.
Never throws an exception.
增加 jbig2 全局记录的引用计数。
从不抛出异常。
*/
fz_jbig2_globals *fz_keep_jbig2_globals(fz_context *ctx, fz_jbig2_globals *globals);
/**
Decrement the reference count for a jbig2 globals record.
When the reference count hits zero, the record is freed.
Never throws an exception.
减少 jbig2 全局记录的引用计数。
当引用计数为零时,记录被释放。
从不抛出异常。
*/
void fz_drop_jbig2_globals(fz_context *ctx, fz_jbig2_globals *globals);
/**
Special jbig2 globals drop function for use in implementing
store support.
用于实现的特殊 jbig2 globals drop 函数
商店支持。
*/
void fz_drop_jbig2_globals_imp(fz_context *ctx, fz_storable *globals);
/**
Return buffer containing jbig2 globals data stream.
返回包含 jbig2 全局数据流的缓冲区。
*/
fz_buffer * fz_jbig2_globals_data(fz_context *ctx, fz_jbig2_globals *globals);
/* Extra filters for tiff */
/**
SGI Log 16bit (greyscale) decode from the chained filter.
Decodes lines of w pixels to 8bpp greyscale.
来自链接过滤器的 SGI Log 16 位(灰度)解码。将 w 像素的行解码为 8bpp 灰度。
*/
fz_stream *fz_open_sgilog16(fz_context *ctx, fz_stream *chain, int w);
/**
SGI Log 24bit (LUV) decode from the chained filter.
Decodes lines of w pixels to 8bpc rgb.
来自链式过滤器的 SGI Log 24 位 (LUV) 解码。
将 w 像素的行解码为 8bpc rgb。
*/
fz_stream *fz_open_sgilog24(fz_context *ctx, fz_stream *chain, int w);
/**
SGI Log 32bit (LUV) decode from the chained filter.
Decodes lines of w pixels to 8bpc rgb.
来自链式过滤器的 SGI Log 32 位 (LUV) 解码。
将 w 像素的行解码为 8bpc rgb。
*/
fz_stream *fz_open_sgilog32(fz_context *ctx, fz_stream *chain, int w);
/**
4bit greyscale Thunderscan decoding from the chained filter.
Decodes lines of w pixels to 8bpp greyscale.
来自链式过滤器的 4 位灰度 Thunderscan 解码。 将 w 像素的行解码为 8bpp 灰度。
*/
fz_stream *fz_open_thunder(fz_context *ctx, fz_stream *chain, int w);
#endif