Skip to content

Commit

Permalink
update mupdf
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Kowalczyk committed Jan 16, 2024
1 parent 2020df1 commit a6d2992
Show file tree
Hide file tree
Showing 21 changed files with 1,249 additions and 313 deletions.
60 changes: 59 additions & 1 deletion mupdf/include/mupdf/fitz/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,63 @@ int fz_lookup_blendmode(const char *name);
*/
const char *fz_blendmode_name(int blendmode);

/*
Generic function type.
Different function implementations will derive from this.
*/
typedef struct fz_function fz_function;

typedef void (fz_function_eval_fn)(fz_context *, fz_function *, const float *, float *);

enum
{
FZ_FUNCTION_MAX_N = FZ_MAX_COLORS,
FZ_FUNCTION_MAX_M = FZ_MAX_COLORS
};

struct fz_function
{
fz_storable storable;
size_t size;
int m; /* number of input values */
int n; /* number of output values */

fz_function_eval_fn *eval;
};

fz_function *fz_new_function_of_size(fz_context *ctx, int size, size_t size2, int m, int n, fz_function_eval_fn *eval, fz_store_drop_fn *drop);

#define fz_new_derived_function(CTX,TYPE,SIZE,M,N,EVAL,DROP) \
((TYPE*)Memento_label(fz_new_function_of_size(CTX,sizeof(TYPE),SIZE,M,N,EVAL,DROP), #TYPE))

/*
Evaluate a function.
Input vector = (in[0], ..., in[inlen-1])
Output vector = (out[0], ..., out[outlen-1])
If inlen or outlen do not match that expected by the function, this
routine will truncate or extend the input/output (with 0's) as
required.
*/
void fz_eval_function(fz_context *ctx, fz_function *func, const float *in, int inlen, float *out, int outlen);

/*
Keep a function reference.
*/
fz_function *fz_keep_function(fz_context *ctx, fz_function *func);

/*
Drop a function reference.
*/
void fz_drop_function(fz_context *ctx, fz_function *func);

/*
Function size
*/
size_t fz_function_size(fz_context *ctx, fz_function *func);

/**
The device structure is public to allow devices to be
implemented outside of fitz.
Expand Down Expand Up @@ -259,7 +316,7 @@ struct fz_device
void (*pop_clip)(fz_context *, fz_device *);

void (*begin_mask)(fz_context *, fz_device *, fz_rect area, int luminosity, fz_colorspace *, const float *bc, fz_color_params );
void (*end_mask)(fz_context *, fz_device *);
void (*end_mask)(fz_context *, fz_device *, fz_function *fn);
void (*begin_group)(fz_context *, fz_device *, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void (*end_group)(fz_context *, fz_device *);

Expand Down Expand Up @@ -304,6 +361,7 @@ void fz_fill_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_mat
void fz_clip_image_mask(fz_context *ctx, fz_device *dev, fz_image *image, fz_matrix ctm, fz_rect scissor);
void fz_begin_mask(fz_context *ctx, fz_device *dev, fz_rect area, int luminosity, fz_colorspace *colorspace, const float *bc, fz_color_params color_params);
void fz_end_mask(fz_context *ctx, fz_device *dev);
void fz_end_mask_tr(fz_context *ctx, fz_device *dev, fz_function *fn);
void fz_begin_group(fz_context *ctx, fz_device *dev, fz_rect area, fz_colorspace *cs, int isolated, int knockout, int blendmode, float alpha);
void fz_end_group(fz_context *ctx, fz_device *dev);
void fz_begin_tile(fz_context *ctx, fz_device *dev, fz_rect area, fz_rect view, float xstep, float ystep, fz_matrix ctm);
Expand Down
2 changes: 1 addition & 1 deletion mupdf/include/mupdf/pdf/interpret.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ struct pdf_processor
void (*op_gs_BM)(fz_context *ctx, pdf_processor *proc, const char *blendmode);
void (*op_gs_ca)(fz_context *ctx, pdf_processor *proc, float alpha);
void (*op_gs_CA)(fz_context *ctx, pdf_processor *proc, float alpha);
void (*op_gs_SMask)(fz_context *ctx, pdf_processor *proc, pdf_obj *smask, float *bc, int luminosity);
void (*op_gs_SMask)(fz_context *ctx, pdf_processor *proc, pdf_obj *smask, float *bc, int luminosity, pdf_obj *tr);
void (*op_gs_end)(fz_context *ctx, pdf_processor *proc);

/* special graphics state */
Expand Down
264 changes: 264 additions & 0 deletions mupdf/resources/cmaps/TrueType-UCS2
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
% Map the standard Macintosh glyph ordering (first 258 glyphs) to Unicode.
% This mapping used as a last resort for non-embedded fonts that use an Identity-H encoding.
% It's better than garbage, but not by much.
/CMapName /TrueType-UCS2
begincidchar
0 0
1 0
2 0
3 32
4 33
5 34
6 35
7 36
8 37
9 38
10 39
11 40
12 41
13 42
14 43
15 44
16 45
17 46
18 47
19 48
20 49
21 50
22 51
23 52
24 53
25 54
26 55
27 56
28 57
29 58
30 59
31 60
32 61
33 62
34 63
35 64
36 65
37 66
38 67
39 68
40 69
41 70
42 71
43 72
44 73
45 74
46 75
47 76
48 77
49 78
50 79
51 80
52 81
53 82
54 83
55 84
56 85
57 86
58 87
59 88
60 89
61 90
62 91
63 92
64 93
65 94
66 95
67 96
68 97
69 98
70 99
71 100
72 101
73 102
74 103
75 104
76 105
77 106
78 107
79 108
80 109
81 110
82 111
83 112
84 113
85 114
86 115
87 116
88 117
89 118
90 119
91 120
92 121
93 122
94 123
95 124
96 125
97 126
98 196
99 197
100 199
101 201
102 209
103 214
104 220
105 225
106 224
107 226
108 228
109 227
110 229
111 231
112 233
113 232
114 234
115 235
116 237
117 236
118 238
119 239
120 241
121 243
122 242
123 244
124 246
125 245
126 250
127 249
128 251
129 252
130 8224
131 176
132 162
133 163
134 167
135 8226
136 182
137 223
138 174
139 169
140 8482
141 180
142 168
143 8800
144 198
145 216
146 8734
147 177
148 8804
149 8805
150 165
151 181
152 8706
153 8721
154 8719
155 960
156 8747
157 170
158 186
159 8486
160 230
161 248
162 191
163 161
164 172
165 8730
166 402
167 8776
168 8710
169 171
170 187
171 8230
172 160
173 192
174 195
175 213
176 338
177 339
178 8211
179 8212
180 8220
181 8221
182 8216
183 8217
184 247
185 9674
186 255
187 376
188 8260
189 164
190 8249
191 8250
192 64257
193 64258
194 8225
195 183
196 8218
197 8222
198 8240
199 194
200 202
201 193
202 203
203 200
204 205
205 206
206 207
207 204
208 211
209 212
210 63743
211 210
212 218
213 219
214 217
215 305
216 710
217 732
218 175
219 728
220 729
221 730
222 184
223 733
224 731
225 711
226 321
227 322
228 352
229 353
230 381
231 382
232 166
233 208
234 240
235 221
236 253
237 222
238 254
239 8722
240 215
241 185
242 178
243 179
244 189
245 188
246 190
247 8355
248 286
249 287
250 304
251 350
252 351
253 262
254 263
255 268
256 269
257 273
endcidchar
Loading

0 comments on commit a6d2992

Please sign in to comment.