mupdf
Toggle main menu visibility
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
30
typedef
enum
31
{
32
FZ_DEFLATE_NONE
= 0,
33
FZ_DEFLATE_BEST_SPEED
= 1,
34
FZ_DEFLATE_BEST
= 9,
35
FZ_DEFLATE_DEFAULT
= -1
36
}
fz_deflate_level
;
37
42
size_t
fz_deflate_bound
(
fz_context
*ctx,
size_t
size);
43
50
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);
51
61
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);
62
72
unsigned
char
*
fz_new_deflated_data_from_buffer
(
fz_context
*ctx,
size_t
*compressed_length,
fz_buffer
*buffer,
fz_deflate_level
level);
73
74
typedef
enum
75
{
76
FZ_BROTLI_NONE
= 0,
77
FZ_BROTLI_BEST_SPEED
= 1,
78
FZ_BROTLI_BEST
= 11,
79
FZ_BROTLI_DEFAULT
= 6
/* Guess */
80
}
fz_brotli_level
;
81
86
size_t
fz_brotli_bound
(
fz_context
*ctx,
size_t
size);
87
94
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);
95
105
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);
106
116
unsigned
char
*
fz_new_brotli_data_from_buffer
(
fz_context
*ctx,
size_t
*compressed_length,
fz_buffer
*buffer,
fz_brotli_level
level);
117
123
fz_buffer
*
fz_compress_ccitt_fax_g3
(
fz_context
*ctx,
const
unsigned
char
*data,
int
columns,
int
rows, ptrdiff_t stride);
124
130
fz_buffer
*
fz_compress_ccitt_fax_g4
(
fz_context
*ctx,
const
unsigned
char
*data,
int
columns,
int
rows, ptrdiff_t stride);
131
132
#endif
buffer.h
fz_deflate_level
fz_deflate_level
Definition
compress.h:31
FZ_DEFLATE_BEST_SPEED
@ FZ_DEFLATE_BEST_SPEED
Definition
compress.h:33
FZ_DEFLATE_DEFAULT
@ FZ_DEFLATE_DEFAULT
Definition
compress.h:35
FZ_DEFLATE_NONE
@ FZ_DEFLATE_NONE
Definition
compress.h:32
FZ_DEFLATE_BEST
@ FZ_DEFLATE_BEST
Definition
compress.h:34
fz_brotli_level
fz_brotli_level
Definition
compress.h:75
FZ_BROTLI_BEST_SPEED
@ FZ_BROTLI_BEST_SPEED
Definition
compress.h:77
FZ_BROTLI_NONE
@ FZ_BROTLI_NONE
Definition
compress.h:76
FZ_BROTLI_DEFAULT
@ FZ_BROTLI_DEFAULT
Definition
compress.h:79
FZ_BROTLI_BEST
@ FZ_BROTLI_BEST
Definition
compress.h:78
fz_deflate_bound
size_t fz_deflate_bound(fz_context *ctx, size_t size)
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)
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)
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)
fz_brotli_bound
size_t fz_brotli_bound(fz_context *ctx, size_t size)
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)
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)
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)
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)
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)
pixmap.h
fz_buffer
Definition
buffer.h:41
fz_context
Definition
context.h:886
system.h
include
mupdf
fitz
compress.h
Generated by
1.17.0