PyMuPDF 1.26.6__cp310-abi3-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fitz/__init__.py +13 -0
- fitz/table.py +2 -0
- fitz/utils.py +2 -0
- pymupdf/__init__.py +25899 -0
- pymupdf/__main__.py +1140 -0
- pymupdf/_apply_pages.py +253 -0
- pymupdf/_build.py +8 -0
- pymupdf/_extra.pyd +0 -0
- pymupdf/_mupdf.pyd +0 -0
- pymupdf/_wxcolors.py +562 -0
- pymupdf/extra.py +220 -0
- pymupdf/mupdf-devel/include/mupdf/classes.h +19999 -0
- pymupdf/mupdf-devel/include/mupdf/classes2.h +12244 -0
- pymupdf/mupdf-devel/include/mupdf/exceptions.h +118 -0
- pymupdf/mupdf-devel/include/mupdf/extra.h +189 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/archive.h +444 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/band-writer.h +117 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/barcode.h +138 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/bidi.h +90 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/bitmap.h +188 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/buffer.h +250 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/color.h +433 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/compress.h +132 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/compressed-buffer.h +194 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/config.h +302 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/context.h +1064 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/crypt.h +270 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/deskew.h +46 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/device.h +652 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/display-list.h +142 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/document.h +1103 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/export.h +52 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/filter.h +269 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/font.h +858 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/geometry.h +885 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/getopt.h +134 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/glyph-cache.h +96 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/glyph.h +81 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/hash.h +126 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/heap-imp.h +190 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/heap.h +143 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/image.h +451 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/json.h +98 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/link.h +130 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/log.h +61 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/outline.h +254 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/output-svg.h +64 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/output.h +448 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/path.h +477 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/pixmap.h +516 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/pool.h +102 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/separation.h +138 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/shade.h +233 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/store.h +465 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/story-writer.h +209 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/story.h +232 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/stream.h +646 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/string-util.h +335 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/structured-text.h +924 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/system.h +495 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/text.h +210 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/track-usage.h +57 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/transition.h +76 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/tree.h +62 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/types.h +41 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/util.h +159 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/version.h +31 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/write-pixmap.h +507 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/writer.h +269 -0
- pymupdf/mupdf-devel/include/mupdf/fitz/xml.h +435 -0
- pymupdf/mupdf-devel/include/mupdf/fitz.h +101 -0
- pymupdf/mupdf-devel/include/mupdf/functions.h +13819 -0
- pymupdf/mupdf-devel/include/mupdf/helpers/mu-office-lib.h +666 -0
- pymupdf/mupdf-devel/include/mupdf/helpers/mu-threads.h +280 -0
- pymupdf/mupdf-devel/include/mupdf/helpers/pkcs7-openssl.h +48 -0
- pymupdf/mupdf-devel/include/mupdf/html.h +53 -0
- pymupdf/mupdf-devel/include/mupdf/internal.h +29 -0
- pymupdf/mupdf-devel/include/mupdf/memento.h +425 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/annot.h +1015 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/clean.h +68 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/cmap.h +145 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/crypt.h +108 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/document.h +902 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/event.h +167 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/font.h +168 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/form.h +381 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/image-rewriter.h +78 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/interpret.h +518 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/javascript.h +43 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/name-table.h +621 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/object.h +445 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/page.h +327 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/parse.h +61 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/recolor.h +49 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/resource.h +144 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/xref.h +300 -0
- pymupdf/mupdf-devel/include/mupdf/pdf/zugferd.h +49 -0
- pymupdf/mupdf-devel/include/mupdf/pdf.h +59 -0
- pymupdf/mupdf-devel/include/mupdf/ucdn.h +464 -0
- pymupdf/mupdf-devel/lib/libmuthreads.lib +0 -0
- pymupdf/mupdf-devel/lib/mupdfcpp64.lib +0 -0
- pymupdf/mupdf.py +63667 -0
- pymupdf/mupdfcpp64.dll +0 -0
- pymupdf/pymupdf.py +2 -0
- pymupdf/table.py +2697 -0
- pymupdf/utils.py +1169 -0
- pymupdf-1.26.6.dist-info/COPYING +1 -0
- pymupdf-1.26.6.dist-info/METADATA +83 -0
- pymupdf-1.26.6.dist-info/README.md +60 -0
- pymupdf-1.26.6.dist-info/RECORD +112 -0
- pymupdf-1.26.6.dist-info/WHEEL +4 -0
- pymupdf-1.26.6.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// Copyright (C) 2004-2021 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_SEPARATION_H
|
|
24
|
+
#define MUPDF_FITZ_SEPARATION_H
|
|
25
|
+
|
|
26
|
+
#include "mupdf/fitz/system.h"
|
|
27
|
+
#include "mupdf/fitz/context.h"
|
|
28
|
+
#include "mupdf/fitz/color.h"
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
A fz_separation structure holds details of a set of separations
|
|
32
|
+
(such as might be used on within a page of the document).
|
|
33
|
+
|
|
34
|
+
The app might control the separations by enabling/disabling them,
|
|
35
|
+
and subsequent renders would take this into account.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
enum
|
|
39
|
+
{
|
|
40
|
+
FZ_MAX_SEPARATIONS = 64
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
typedef struct fz_separations fz_separations;
|
|
44
|
+
|
|
45
|
+
typedef enum
|
|
46
|
+
{
|
|
47
|
+
/* "Composite" separations are rendered using process
|
|
48
|
+
* colors using the equivalent colors */
|
|
49
|
+
FZ_SEPARATION_COMPOSITE = 0,
|
|
50
|
+
/* Spot colors are rendered into their own spot plane. */
|
|
51
|
+
FZ_SEPARATION_SPOT = 1,
|
|
52
|
+
/* Disabled colors are not rendered at all in the final
|
|
53
|
+
* output. */
|
|
54
|
+
FZ_SEPARATION_DISABLED = 2
|
|
55
|
+
} fz_separation_behavior;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
Create a new separations structure (initially empty)
|
|
59
|
+
*/
|
|
60
|
+
fz_separations *fz_new_separations(fz_context *ctx, int controllable);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
Increment the reference count for a separations structure.
|
|
64
|
+
Returns the same pointer.
|
|
65
|
+
|
|
66
|
+
Never throws exceptions.
|
|
67
|
+
*/
|
|
68
|
+
fz_separations *fz_keep_separations(fz_context *ctx, fz_separations *sep);
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
Decrement the reference count for a separations structure.
|
|
72
|
+
When the reference count hits zero, the separations structure
|
|
73
|
+
is freed.
|
|
74
|
+
|
|
75
|
+
Never throws exceptions.
|
|
76
|
+
*/
|
|
77
|
+
void fz_drop_separations(fz_context *ctx, fz_separations *sep);
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
Add a separation (null terminated name, colorspace)
|
|
81
|
+
*/
|
|
82
|
+
void fz_add_separation(fz_context *ctx, fz_separations *sep, const char *name, fz_colorspace *cs, int cs_channel);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
Add a separation with equivalents (null terminated name,
|
|
86
|
+
colorspace)
|
|
87
|
+
|
|
88
|
+
(old, deprecated)
|
|
89
|
+
*/
|
|
90
|
+
void fz_add_separation_equivalents(fz_context *ctx, fz_separations *sep, uint32_t rgba, uint32_t cmyk, const char *name);
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
Control the rendering of a given separation.
|
|
94
|
+
*/
|
|
95
|
+
void fz_set_separation_behavior(fz_context *ctx, fz_separations *sep, int separation, fz_separation_behavior behavior);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
Test for the current behavior of a separation.
|
|
99
|
+
*/
|
|
100
|
+
fz_separation_behavior fz_separation_current_behavior(fz_context *ctx, const fz_separations *sep, int separation);
|
|
101
|
+
|
|
102
|
+
const char *fz_separation_name(fz_context *ctx, const fz_separations *sep, int separation);
|
|
103
|
+
int fz_count_separations(fz_context *ctx, const fz_separations *sep);
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
Return the number of active separations.
|
|
107
|
+
*/
|
|
108
|
+
int fz_count_active_separations(fz_context *ctx, const fz_separations *seps);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
Compare 2 separations structures (or NULLs).
|
|
112
|
+
|
|
113
|
+
Return 0 if identical, non-zero if not identical.
|
|
114
|
+
*/
|
|
115
|
+
int fz_compare_separations(fz_context *ctx, const fz_separations *sep1, const fz_separations *sep2);
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
Return a separations object with all the spots in the input
|
|
120
|
+
separations object that are set to composite, reset to be
|
|
121
|
+
enabled. If there ARE no spots in the object, this returns
|
|
122
|
+
NULL. If the object already has all its spots enabled, then
|
|
123
|
+
just returns another handle on the same object.
|
|
124
|
+
*/
|
|
125
|
+
fz_separations *fz_clone_separations_for_overprint(fz_context *ctx, fz_separations *seps);
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
Convert a color given in terms of one colorspace,
|
|
129
|
+
to a color in terms of another colorspace/separations.
|
|
130
|
+
*/
|
|
131
|
+
void fz_convert_separation_colors(fz_context *ctx, fz_colorspace *src_cs, const float *src_color, fz_separations *dst_seps, fz_colorspace *dst_cs, float *dst_color, fz_color_params color_params);
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
Get the equivalent separation color in a given colorspace.
|
|
135
|
+
*/
|
|
136
|
+
void fz_separation_equivalent(fz_context *ctx, const fz_separations *seps, int idx, fz_colorspace *dst_cs, float *dst_color, fz_colorspace *prf, fz_color_params color_params);
|
|
137
|
+
|
|
138
|
+
#endif
|
|
@@ -0,0 +1,233 @@
|
|
|
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_SHADE_H
|
|
24
|
+
#define MUPDF_FITZ_SHADE_H
|
|
25
|
+
|
|
26
|
+
#include "mupdf/fitz/system.h"
|
|
27
|
+
#include "mupdf/fitz/context.h"
|
|
28
|
+
#include "mupdf/fitz/geometry.h"
|
|
29
|
+
#include "mupdf/fitz/store.h"
|
|
30
|
+
#include "mupdf/fitz/pixmap.h"
|
|
31
|
+
#include "mupdf/fitz/compressed-buffer.h"
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The shading code uses gouraud shaded triangle meshes.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
enum
|
|
38
|
+
{
|
|
39
|
+
FZ_FUNCTION_BASED = 1,
|
|
40
|
+
FZ_LINEAR = 2,
|
|
41
|
+
FZ_RADIAL = 3,
|
|
42
|
+
FZ_MESH_TYPE4 = 4,
|
|
43
|
+
FZ_MESH_TYPE5 = 5,
|
|
44
|
+
FZ_MESH_TYPE6 = 6,
|
|
45
|
+
FZ_MESH_TYPE7 = 7
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
Structure is public to allow derived classes. Do not
|
|
50
|
+
access the members directly.
|
|
51
|
+
*/
|
|
52
|
+
typedef struct
|
|
53
|
+
{
|
|
54
|
+
fz_storable storable;
|
|
55
|
+
|
|
56
|
+
fz_rect bbox; /* can be fz_infinite_rect */
|
|
57
|
+
fz_colorspace *colorspace;
|
|
58
|
+
|
|
59
|
+
fz_matrix matrix; /* matrix from pattern dict */
|
|
60
|
+
int use_background; /* background color for fills but not 'sh' */
|
|
61
|
+
float background[FZ_MAX_COLORS];
|
|
62
|
+
|
|
63
|
+
/* Just to be confusing, PDF Shadings of Type 1 (Function Based
|
|
64
|
+
* Shadings), do NOT use function, but all the others do. This
|
|
65
|
+
* is because Type 1 shadings take 2 inputs, whereas all the
|
|
66
|
+
* others (when used with a function take 1 input. The type 1
|
|
67
|
+
* data is in the 'f' field of the union below. */
|
|
68
|
+
/* If function_stride = 0, then function is not used. Otherwise
|
|
69
|
+
* function points to 256*function_stride entries. */
|
|
70
|
+
int function_stride;
|
|
71
|
+
float *function;
|
|
72
|
+
|
|
73
|
+
int type; /* function, linear, radial, mesh */
|
|
74
|
+
union
|
|
75
|
+
{
|
|
76
|
+
struct
|
|
77
|
+
{
|
|
78
|
+
int extend[2];
|
|
79
|
+
float coords[2][3]; /* (x,y,r) twice */
|
|
80
|
+
} l_or_r;
|
|
81
|
+
struct
|
|
82
|
+
{
|
|
83
|
+
int vprow;
|
|
84
|
+
int bpflag;
|
|
85
|
+
int bpcoord;
|
|
86
|
+
int bpcomp;
|
|
87
|
+
float x0, x1;
|
|
88
|
+
float y0, y1;
|
|
89
|
+
float c0[FZ_MAX_COLORS];
|
|
90
|
+
float c1[FZ_MAX_COLORS];
|
|
91
|
+
} m;
|
|
92
|
+
struct
|
|
93
|
+
{
|
|
94
|
+
fz_matrix matrix;
|
|
95
|
+
int xdivs;
|
|
96
|
+
int ydivs;
|
|
97
|
+
float domain[2][2];
|
|
98
|
+
float *fn_vals;
|
|
99
|
+
} f;
|
|
100
|
+
} u;
|
|
101
|
+
|
|
102
|
+
fz_compressed_buffer *buffer;
|
|
103
|
+
} fz_shade;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
Increment the reference count for the shade structure. The
|
|
107
|
+
same pointer is returned.
|
|
108
|
+
|
|
109
|
+
Never throws exceptions.
|
|
110
|
+
*/
|
|
111
|
+
fz_shade *fz_keep_shade(fz_context *ctx, fz_shade *shade);
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
Decrement the reference count for the shade structure. When
|
|
115
|
+
the reference count hits zero, the structure is freed.
|
|
116
|
+
|
|
117
|
+
Never throws exceptions.
|
|
118
|
+
*/
|
|
119
|
+
void fz_drop_shade(fz_context *ctx, fz_shade *shade);
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
Bound a given shading.
|
|
123
|
+
|
|
124
|
+
shade: The shade to bound.
|
|
125
|
+
|
|
126
|
+
ctm: The transform to apply to the shade before bounding.
|
|
127
|
+
|
|
128
|
+
r: Pointer to storage to put the bounds in.
|
|
129
|
+
|
|
130
|
+
Returns r, updated to contain the bounds for the shading.
|
|
131
|
+
*/
|
|
132
|
+
fz_rect fz_bound_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm);
|
|
133
|
+
|
|
134
|
+
typedef struct fz_shade_color_cache fz_shade_color_cache;
|
|
135
|
+
|
|
136
|
+
void fz_drop_shade_color_cache(fz_context *ctx, fz_shade_color_cache *cache);
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
Render a shade to a given pixmap.
|
|
140
|
+
|
|
141
|
+
shade: The shade to paint.
|
|
142
|
+
|
|
143
|
+
override_cs: NULL, or colorspace to override the shades
|
|
144
|
+
inbuilt colorspace.
|
|
145
|
+
|
|
146
|
+
ctm: The transform to apply.
|
|
147
|
+
|
|
148
|
+
dest: The pixmap to render into.
|
|
149
|
+
|
|
150
|
+
color_params: The color rendering settings
|
|
151
|
+
|
|
152
|
+
bbox: Pointer to a bounding box to limit the rendering
|
|
153
|
+
of the shade.
|
|
154
|
+
|
|
155
|
+
eop: NULL, or pointer to overprint bitmap.
|
|
156
|
+
|
|
157
|
+
cache: *cache is used to cache color information. If *cache is NULL it
|
|
158
|
+
is set to point to a new fz_shade_color_cache. If cache is NULL it is
|
|
159
|
+
ignored.
|
|
160
|
+
*/
|
|
161
|
+
void fz_paint_shade(fz_context *ctx, fz_shade *shade, fz_colorspace *override_cs, fz_matrix ctm, fz_pixmap *dest, fz_color_params color_params, fz_irect bbox, const fz_overprint *eop, fz_shade_color_cache **cache);
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Handy routine for processing mesh based shades
|
|
165
|
+
*/
|
|
166
|
+
typedef struct
|
|
167
|
+
{
|
|
168
|
+
fz_point p;
|
|
169
|
+
float c[FZ_MAX_COLORS];
|
|
170
|
+
} fz_vertex;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
Callback function type for use with
|
|
174
|
+
fz_process_shade.
|
|
175
|
+
|
|
176
|
+
arg: Opaque pointer from fz_process_shade caller.
|
|
177
|
+
|
|
178
|
+
v: Pointer to a fz_vertex structure to populate.
|
|
179
|
+
|
|
180
|
+
c: Pointer to an array of floats used to populate v.
|
|
181
|
+
*/
|
|
182
|
+
typedef void (fz_shade_prepare_fn)(fz_context *ctx, void *arg, fz_vertex *v, const float *c);
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
Callback function type for use with
|
|
186
|
+
fz_process_shade.
|
|
187
|
+
|
|
188
|
+
arg: Opaque pointer from fz_process_shade caller.
|
|
189
|
+
|
|
190
|
+
av, bv, cv: Pointers to a fz_vertex structure describing
|
|
191
|
+
the corner locations and colors of a triangle to be
|
|
192
|
+
filled.
|
|
193
|
+
*/
|
|
194
|
+
typedef void (fz_shade_process_fn)(fz_context *ctx, void *arg, fz_vertex *av, fz_vertex *bv, fz_vertex *cv);
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
Process a shade, using supplied callback functions. This
|
|
198
|
+
decomposes the shading to a mesh (even ones that are not
|
|
199
|
+
natively meshes, such as linear or radial shadings), and
|
|
200
|
+
processes triangles from those meshes.
|
|
201
|
+
|
|
202
|
+
shade: The shade to process.
|
|
203
|
+
|
|
204
|
+
ctm: The transform to use
|
|
205
|
+
|
|
206
|
+
prepare: Callback function to 'prepare' each vertex.
|
|
207
|
+
This function is passed an array of floats, and populates
|
|
208
|
+
a fz_vertex structure.
|
|
209
|
+
|
|
210
|
+
process: This function is passed 3 pointers to vertex
|
|
211
|
+
structures, and actually performs the processing (typically
|
|
212
|
+
filling the area between the vertices).
|
|
213
|
+
|
|
214
|
+
process_arg: An opaque argument passed through from caller
|
|
215
|
+
to callback functions.
|
|
216
|
+
*/
|
|
217
|
+
void fz_process_shade(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_rect scissor,
|
|
218
|
+
fz_shade_prepare_fn *prepare,
|
|
219
|
+
fz_shade_process_fn *process,
|
|
220
|
+
void *process_arg);
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
/* Implementation details: subject to change. */
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
Internal function to destroy a
|
|
227
|
+
shade. Only exposed for use with the fz_store.
|
|
228
|
+
|
|
229
|
+
shade: The reference to destroy.
|
|
230
|
+
*/
|
|
231
|
+
void fz_drop_shade_imp(fz_context *ctx, fz_storable *shade);
|
|
232
|
+
|
|
233
|
+
#endif
|