mupdf
Loading...
Searching...
No Matches
compressed-buffer.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_COMPRESSED_BUFFER_H
24#define MUPDF_FITZ_COMPRESSED_BUFFER_H
25
26#include "mupdf/fitz/system.h"
27#include "mupdf/fitz/context.h"
28#include "mupdf/fitz/buffer.h"
29#include "mupdf/fitz/stream.h"
30#include "mupdf/fitz/filter.h"
31
36typedef struct
37{
38 int type;
39 union {
40 struct {
41 int color_transform; /* Use -1 for unset */
42 int invert_cmyk; /* Use 1 for standalone JPEG files */
43 } jpeg;
44 struct {
46 } jpx;
47 struct {
50 } jbig2;
51 struct {
53 int rows;
54 int k;
60 } fax;
61 struct
62 {
63 int columns;
64 int colors;
66 int bpc;
67 }
69 struct
70 {
71 int columns;
72 int colors;
73 int predictor;
74 int bpc;
75 }
77 struct
78 {
79 int columns;
80 int colors;
81 int predictor;
82 int bpc;
84 } lzw;
85 } u;
87
98
103
111
116
128
134
139int fz_recognize_image_format(fz_context *ctx, unsigned char p[8]);
140
146const char *fz_image_type_name(int type);
147
152int fz_lookup_image_type(const char *type);
153
154enum
155{
157
158 /* Uncompressed samples */
160
161 /* Compressed samples */
167
168 /* Full image formats */
179};
180
188
193
194#endif
fz_stream * fz_open_image_decomp_stream_from_buffer(fz_context *ctx, fz_compressed_buffer *, int *l2factor)
@ FZ_IMAGE_PNM
Definition compressed-buffer.h:176
@ FZ_IMAGE_RLD
Definition compressed-buffer.h:165
@ FZ_IMAGE_TIFF
Definition compressed-buffer.h:177
@ FZ_IMAGE_PSD
Definition compressed-buffer.h:178
@ FZ_IMAGE_JBIG2
Definition compressed-buffer.h:171
@ FZ_IMAGE_LZW
Definition compressed-buffer.h:164
@ FZ_IMAGE_RAW
Definition compressed-buffer.h:159
@ FZ_IMAGE_JPX
Definition compressed-buffer.h:173
@ FZ_IMAGE_FLATE
Definition compressed-buffer.h:163
@ FZ_IMAGE_BMP
Definition compressed-buffer.h:169
@ FZ_IMAGE_UNKNOWN
Definition compressed-buffer.h:156
@ FZ_IMAGE_JPEG
Definition compressed-buffer.h:172
@ FZ_IMAGE_BROTLI
Definition compressed-buffer.h:166
@ FZ_IMAGE_PNG
Definition compressed-buffer.h:175
@ FZ_IMAGE_JXR
Definition compressed-buffer.h:174
@ FZ_IMAGE_FAX
Definition compressed-buffer.h:162
@ FZ_IMAGE_GIF
Definition compressed-buffer.h:170
void fz_drop_compressed_buffer(fz_context *ctx, fz_compressed_buffer *buf)
fz_stream * fz_open_compressed_buffer(fz_context *ctx, fz_compressed_buffer *)
const char * fz_image_type_name(int type)
int fz_lookup_image_type(const char *type)
size_t fz_compressed_buffer_size(fz_compressed_buffer *buffer)
fz_compressed_buffer * fz_new_compressed_buffer(fz_context *ctx)
fz_stream * fz_open_image_decomp_stream(fz_context *ctx, fz_stream *, fz_compression_params *, int *l2factor)
fz_compressed_buffer * fz_keep_compressed_buffer(fz_context *ctx, fz_compressed_buffer *cbuf)
int fz_recognize_image_format(fz_context *ctx, unsigned char p[8])
struct fz_jbig2_globals fz_jbig2_globals
Definition filter.h:32
Definition buffer.h:41
Definition compressed-buffer.h:93
fz_buffer * buffer
Definition compressed-buffer.h:96
fz_compression_params params
Definition compressed-buffer.h:95
int refs
Definition compressed-buffer.h:94
Definition compressed-buffer.h:37
struct fz_compression_params::@122207027215301061135317265304215131332355175121::@340107023211076170137043074331027252022311137057 brotli
fz_jbig2_globals * globals
Definition compressed-buffer.h:48
int colors
Definition compressed-buffer.h:64
int columns
Definition compressed-buffer.h:52
int rows
Definition compressed-buffer.h:53
struct fz_compression_params::@122207027215301061135317265304215131332355175121::@376054267002200121173047226040225317352234037313 flate
int early_change
Definition compressed-buffer.h:83
int embedded
Definition compressed-buffer.h:49
int type
Definition compressed-buffer.h:38
int encoded_byte_align
Definition compressed-buffer.h:56
int black_is_1
Definition compressed-buffer.h:58
int damaged_rows_before_error
Definition compressed-buffer.h:59
int predictor
Definition compressed-buffer.h:65
int color_transform
Definition compressed-buffer.h:41
int bpc
Definition compressed-buffer.h:66
int end_of_block
Definition compressed-buffer.h:57
int invert_cmyk
Definition compressed-buffer.h:42
int k
Definition compressed-buffer.h:54
int smask_in_data
Definition compressed-buffer.h:45
int end_of_line
Definition compressed-buffer.h:55
Definition context.h:886
Definition stream.h:320