MuPDF X.Y.Z

fitz/filter.h

Index

typedef

struct

function

Filter

typedef fz_jbig2_globals

typedef struct fz_jbig2_globals fz_jbig2_globals

struct fz_range

struct fz_range
{
        int64_t offset;
        uint64_t length;
}

function fz_open_null_filter

fz_stream *
fz_open_null_filter (
        fz_context *ctx,
        fz_stream *chain,
        uint64_t len,
        int64_t offset
)

The null filter reads a specified amount of data from the substream.

function fz_open_range_filter

fz_stream *
fz_open_range_filter (
        fz_context *ctx,
        fz_stream *chain,
        fz_range *ranges,
        int nranges
)

The range filter copies data from specified ranges of the chained stream.

function fz_open_endstream_filter

fz_stream *
fz_open_endstream_filter (
        fz_context *ctx,
        fz_stream *chain,
        uint64_t len,
        int64_t offset
)

The endstream filter reads a PDF substream, and starts to look for an ‘endstream’ token after the specified length.

function fz_open_concat

fz_stream *
fz_open_concat (
        fz_context *ctx,
        int max,
        int pad
)

Concat filter concatenates several streams into one.

function fz_concat_push_drop

void
fz_concat_push_drop (
        fz_context *ctx,
        fz_stream *concat,
        fz_stream *chain
)

Add a chained stream to the end of the concatenate filter.

Ownership of chain is passed in.

function fz_open_arc4

fz_stream *
fz_open_arc4 (
        fz_context *ctx,
        fz_stream *chain,
        unsigned char *key,
        unsigned keylen
)

arc4 filter performs RC4 decoding of data read from the chained filter using the supplied key.

function fz_open_aesd

fz_stream *
fz_open_aesd (
        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.

function fz_open_a85d

fz_stream *
fz_open_a85d (
        fz_context *ctx,
        fz_stream *chain
)

a85d filter performs ASCII 85 Decoding of data read from the chained filter.

function fz_open_ahxd

fz_stream *
fz_open_ahxd (
        fz_context *ctx,
        fz_stream *chain
)

ahxd filter performs ASCII Hex decoding of data read from the chained filter.

function fz_open_rld

fz_stream *
fz_open_rld (
        fz_context *ctx,
        fz_stream *chain
)

rld filter performs Run Length Decoding of data read from the chained filter.

function fz_open_dctd

fz_stream *
fz_open_dctd (
        fz_context *ctx,
        fz_stream *chain,
        int color_transform,
        int invert_cmyk,
        int l2factor,
        fz_stream *jpegtables
)

dctd filter performs DCT (JPEG) decoding of data read from the chained filter.

color_transform implements the PDF color_transform option use -1 for default behavior use 0 to disable YUV-RGB / YCCK-CMYK transforms use 1 to enable YUV-RGB / YCCK-CMYK transforms

invert_cmyk implements the necessary inversion for Photoshop CMYK images use 0 if embedded in PDF use 1 if not embedded in PDF

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.

function fz_open_faxd

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
)

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).

function fz_open_flated

fz_stream *
fz_open_flated (
        fz_context *ctx,
        fz_stream *chain,
        int window_bits
)

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.

function fz_open_libarchived

fz_stream *
fz_open_libarchived (
        fz_context *ctx,
        fz_stream *chain
)

libarchived filter performs generic compressed decoding of data in any format understood by libarchive from the chained filter.

This will throw an exception if libarchive is not built in, or if the compression format is not recognised.

function fz_open_brotlid

fz_stream *
fz_open_brotlid (
        fz_context *ctx,
        fz_stream *chain
)

brotlid filter performs Brotli decoding of data read from the chained filter.

function fz_open_lzwd

fz_stream *
fz_open_lzwd (
        fz_context *ctx,
        fz_stream *chain,
        int early_change,
        int min_bits,
        int reverse_bits,
        int old_tiff
)

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.

function fz_open_predict

fz_stream *
fz_open_predict (
        fz_context *ctx,
        fz_stream *chain,
        int predictor,
        int columns,
        int colors,
        int bpc
)

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)

function fz_open_jbig2d

fz_stream *
fz_open_jbig2d (
        fz_context *ctx,
        fz_stream *chain,
        fz_jbig2_globals *globals,
        int embedded
)

Open a filter that performs jbig2 decompression on the chained stream, using the optional globals record.

function fz_load_jbig2_globals

fz_jbig2_globals *
fz_load_jbig2_globals (
        fz_context *ctx,
        fz_buffer *buf
)

Create a jbig2 globals record from a buffer.

Immutable once created.

function fz_keep_jbig2_globals

fz_jbig2_globals *
fz_keep_jbig2_globals (
        fz_context *ctx,
        fz_jbig2_globals *globals
)

Increment the reference count for a jbig2 globals record.

Never throws an exception.

function fz_drop_jbig2_globals

void
fz_drop_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.

function fz_drop_jbig2_globals_imp

void
fz_drop_jbig2_globals_imp (
        fz_context *ctx,
        fz_storable *globals
)

Special jbig2 globals drop function for use in implementing store support.

function fz_jbig2_globals_data

fz_buffer *
fz_jbig2_globals_data (
        fz_context *ctx,
        fz_jbig2_globals *globals
)

Return buffer containing jbig2 globals data stream.

Extra filters for tiff

function fz_open_sgilog16

fz_stream *
fz_open_sgilog16 (
        fz_context *ctx,
        fz_stream *chain,
        int w
)

SGI Log 16bit (greyscale) decode from the chained filter. Decodes lines of w pixels to 8bpp greyscale.

function fz_open_sgilog24

fz_stream *
fz_open_sgilog24 (
        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.

function fz_open_sgilog32

fz_stream *
fz_open_sgilog32 (
        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.

function fz_open_thunder

fz_stream *
fz_open_thunder (
        fz_context *ctx,
        fz_stream *chain,
        int w
)

4bit greyscale Thunderscan decoding from the chained filter. Decodes lines of w pixels to 8bpp greyscale.