mupdf
Loading...
Searching...
No Matches
compress.h
Go to the documentation of this file.
1// Copyright (C) 2004-2025 Artifex Software, Inc.
2//
3// This file is part of MuPDF.
4//
5// MuPDF is free software: you can redistribute it and/or modify it under the
6// terms of the GNU Affero General Public License as published by the Free
7// Software Foundation, either version 3 of the License, or (at your option)
8// any later version.
9//
10// MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12// FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13// details.
14//
15// You should have received a copy of the GNU Affero General Public License
16// along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17//
18// Alternative licensing terms are available from the licensor.
19// For commercial licensing, see <https://www.artifex.com/> or contact
20// Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21// CA 94129, USA, for further information.
22
23#ifndef MUPDF_FITZ_COMPRESS_H
24#define MUPDF_FITZ_COMPRESS_H
25
26#include "mupdf/fitz/system.h"
27#include "mupdf/fitz/buffer.h"
28#include "mupdf/fitz/pixmap.h"
29
37
42size_t fz_deflate_bound(fz_context *ctx, size_t size);
43
50void fz_deflate(fz_context *ctx, unsigned char *dest, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level);
51
61unsigned char *fz_new_deflated_data(fz_context *ctx, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_deflate_level level);
62
72unsigned char *fz_new_deflated_data_from_buffer(fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_deflate_level level);
73
81
86size_t fz_brotli_bound(fz_context *ctx, size_t size);
87
94void 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);
95
105unsigned char *fz_new_brotli_data(fz_context *ctx, size_t *compressed_length, const unsigned char *source, size_t source_length, fz_brotli_level level);
106
116unsigned char *fz_new_brotli_data_from_buffer(fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_brotli_level level);
117
123fz_buffer *fz_compress_ccitt_fax_g3(fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride);
124
130fz_buffer *fz_compress_ccitt_fax_g4(fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride);
131
132#endif
fz_deflate_level
Definition compress.h:31
@ FZ_DEFLATE_BEST_SPEED
Definition compress.h:33
@ FZ_DEFLATE_DEFAULT
Definition compress.h:35
@ FZ_DEFLATE_NONE
Definition compress.h:32
@ FZ_DEFLATE_BEST
Definition compress.h:34
fz_brotli_level
Definition compress.h:75
@ FZ_BROTLI_BEST_SPEED
Definition compress.h:77
@ FZ_BROTLI_NONE
Definition compress.h:76
@ FZ_BROTLI_DEFAULT
Definition compress.h:79
@ FZ_BROTLI_BEST
Definition compress.h:78
size_t fz_deflate_bound(fz_context *ctx, size_t size)
unsigned char * fz_new_deflated_data_from_buffer(fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_deflate_level level)
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)
size_t fz_brotli_bound(fz_context *ctx, size_t size)
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)
fz_buffer * fz_compress_ccitt_fax_g3(fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride)
unsigned char * fz_new_brotli_data_from_buffer(fz_context *ctx, size_t *compressed_length, fz_buffer *buffer, fz_brotli_level level)
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)
fz_buffer * fz_compress_ccitt_fax_g4(fz_context *ctx, const unsigned char *data, int columns, int rows, ptrdiff_t stride)
Definition buffer.h:41
Definition context.h:886