mupdf
Loading...
Searching...
No Matches
compress.h File Reference
Include dependency graph for compress.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  fz_deflate_level { FZ_DEFLATE_NONE = 0 , FZ_DEFLATE_BEST_SPEED = 1 , FZ_DEFLATE_BEST = 9 , FZ_DEFLATE_DEFAULT = -1 }
enum  fz_brotli_level { FZ_BROTLI_NONE = 0 , FZ_BROTLI_BEST_SPEED = 1 , FZ_BROTLI_BEST = 11 , FZ_BROTLI_DEFAULT = 6 }

Functions

size_t fz_deflate_bound (fz_context *ctx, size_t size)
void fz_deflate (fz_context *ctx, unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level)
unsigned char * fz_new_deflated_data (fz_context *ctx, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level)
unsigned char * fz_new_deflated_data_from_buffer (fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_deflate_level level)
size_t fz_brotli_bound (fz_context *ctx, size_t size)
void fz_compress_brotli (fz_context *ctx, unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_brotli_level level)
unsigned char * fz_new_brotli_data (fz_context *ctx, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_brotli_level level)
unsigned char * fz_new_brotli_data_from_buffer (fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_brotli_level level)
fz_bufferfz_compress_ccitt_fax_g3 (fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride)
fz_bufferfz_compress_ccitt_fax_g4 (fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride)

Enumeration Type Documentation

◆ fz_brotli_level

Enumerator
FZ_BROTLI_NONE 
FZ_BROTLI_BEST_SPEED 
FZ_BROTLI_BEST 
FZ_BROTLI_DEFAULT 

◆ fz_deflate_level

Enumerator
FZ_DEFLATE_NONE 
FZ_DEFLATE_BEST_SPEED 
FZ_DEFLATE_BEST 
FZ_DEFLATE_DEFAULT 

Function Documentation

◆ fz_brotli_bound()

size_t fz_brotli_bound ( fz_context * ctx,
size_t size )

Returns the upper bound on the size of brotli compressed data of length size.

◆ fz_compress_brotli()

void fz_compress_brotli ( fz_context * ctx,
unsigned char * dest,
size_t * compressed_length,
const unsigned char * source,
size_t source_length,
fz_brotli_level level )

Compress source_length bytes of data starting at source, into a buffer of length *destLen, starting at dest. compressed_length will be updated on exit to contain the size actually used.

◆ fz_compress_ccitt_fax_g3()

fz_buffer * fz_compress_ccitt_fax_g3 ( fz_context * ctx,
const unsigned char * data,
int columns,
int rows,
ptrdiff_t stride )

Compress bitmap data as CCITT Group 3 1D fax image. Creates a stream assuming the default PDF parameters, except the number of columns.

◆ fz_compress_ccitt_fax_g4()

fz_buffer * fz_compress_ccitt_fax_g4 ( fz_context * ctx,
const unsigned char * data,
int columns,
int rows,
ptrdiff_t stride )

Compress bitmap data as CCITT Group 4 2D fax image. Creates a stream assuming the default PDF parameters, except K=-1 and the number of columns.

◆ fz_deflate()

void fz_deflate ( fz_context * ctx,
unsigned char * dest,
size_t * compressed_length,
const unsigned char * source,
size_t source_length,
fz_deflate_level level )

Compress source_length bytes of data starting at source, into a buffer of length *compressed_length, starting at dest. *compressed_length will be updated on exit to contain the size actually used.

◆ fz_deflate_bound()

size_t fz_deflate_bound ( fz_context * ctx,
size_t size )

Returns the upper bound on the size of flated data of length size.

◆ fz_new_brotli_data()

unsigned char * fz_new_brotli_data ( fz_context * ctx,
size_t * compressed_length,
const unsigned char * source,
size_t source_length,
fz_brotli_level level )

Compress source_length bytes of data starting at source, into a new memory block malloced for that purpose. compressed_length is updated on exit to contain the size used. Ownership of the block is returned from this function, and the caller is therefore responsible for freeing it. The block may be considerably larger than is actually required. The caller is free to fz_realloc it down if it wants to.

◆ fz_new_brotli_data_from_buffer()

unsigned char * fz_new_brotli_data_from_buffer ( fz_context * ctx,
size_t * compressed_length,
fz_buffer * buffer,
fz_brotli_level level )

Compress the contents of a fz_buffer into a new block malloced for that purpose. *compressed_length is updated on exit to contain the size used. Ownership of the block is returned from this function, and the caller is therefore responsible for freeing it. The block may be considerably larger than is actually required. The caller is free to fz_realloc it down if it wants to.

◆ fz_new_deflated_data()

unsigned char * fz_new_deflated_data ( fz_context * ctx,
size_t * compressed_length,
const unsigned char * source,
size_t source_length,
fz_deflate_level level )

Compress source_length bytes of data starting at source, into a new memory block malloced for that purpose. compressed_length is updated on exit to contain the size used. Ownership of the block is returned from this function, and the caller is therefore responsible for freeing it. The block may be considerably larger than is actually required. The caller is free to fz_realloc it down if it wants to.

◆ fz_new_deflated_data_from_buffer()

unsigned char * fz_new_deflated_data_from_buffer ( fz_context * ctx,
size_t * compressed_length,
fz_buffer * buffer,
fz_deflate_level level )

Compress the contents of a fz_buffer into a new block malloced for that purpose. *compressed_length is updated on exit to contain the size used. Ownership of the block is returned from this function, and the caller is therefore responsible for freeing it. The block may be considerably larger than is actually required. The caller is free to fz_realloc it down if it wants to.