w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

appliers.cpp
Go to the documentation of this file.
1 /*
2  * appliers.cpp -- specific OutputRule implementations
3  * by pts@fazekas.hu at Sat Mar 16 14:45:02 CET 2002
4  * Blanca JAI additions at Tue May 21 13:18:26 CEST 2002
5  * TIFF output at Tue Jun 4 19:50:45 CEST 2002
6  */
7 
8 #ifdef __GNUC__
9 #ifndef __clang__
10 #pragma implementation
11 #endif
12 #endif
13 
14 #include "rule.hpp"
15 #include "error.hpp"
16 #include "encoder.hpp"
17 #include "in_jai.hpp"
18 #include "crc32.h" /* crc32() used by out_png_work() */
19 #include <string.h>
20 
21 /** Appends 4 bytes in MSB first (network) byte order */
22 static inline void mf32(char *&p, slen_t u32) {
23  p[0]=(u32>>24)&255;
24  p[1]=(u32>>16)&255;
25  p[2]=(u32>> 8)&255;
26  p[3]=(u32 )&255;
27  p+=4;
28 }
29 /** Appends 4 bytes in LSB first (PC) byte order */
30 static inline void lf32(char *&p, slen_t u32) {
31  p[0]=(u32 )&255;
32  p[1]=(u32>> 8)&255;
33  p[2]=(u32>>16)&255;
34  p[3]=(u32>>24)&255;
35  p+=4;
36 }
37 /** Appends 2 bytes in LSB first (PC) byte order */
38 static inline void lf16(char *&p, unsigned u16) {
39  p[0]=(u16 )&255;
40  p[1]=(u16>> 8)&255;
41  p+=2;
42 }
43 
44 
45 /* --- at Sat Mar 23 15:42:17 CET 2002, removed obsolete
46  * PostScript Level2 FlateEncode or LZWEncode filter, predictors supported
47  * written at Mar 16 14:48:27 CET 2002
48  */
49 
50 /* --- Sun Mar 17 15:43:20 CET 2002 */
51 
52 #if 0
53 /* l1fa85g.tte was a special .tte that is not built in to bts.ttt, but I've
54  * integrated it into bts2.ttt at Sun Sep 22 00:48:21 CEST 2002. I've also
55  * integrated _l1fa85g_ to _l1c_ that day.
56  */
57 static char *l1fa85g_tte=
58 #include "l1fa85g.tth"
59 
60 /** PostScript Level1 FlateEncode, A85, without Predictor */
61 Rule::Applier::cons_t out_l1fa85g_check_rule(Rule::OutputRule* or_) {
62  Rule::Cache *cache=&or_->cache;
63  if (!cache->isPS()
64  || cache->Compression!=Rule::Cache::CO_ZIP
65  || cache->hasPredictor()
66  || !cache->isGray()
67  || cache->TransferEncoding!=cache->TE_A85
68  || (!cache->WarningOK && !cache->isPSL3())
69  ) return Rule::Applier::DONT_KNOW;
70  return Rule::Applier::OK;
71 }
73  /* by pts@fazekas.hu at Sun Mar 17 15:52:48 CET 2002 */
74  // Imp: two other TransferEncodings [no more, since #if 0]
75  if (out_l1fa85g_check_rule(or_)!=Rule::Applier::OK) return Rule::Applier::DONT_KNOW;
76  if (!or_->cache.isPSL3())
77  Error::sev(Error::WARNING_DEFER) << "l1fa85g: /ZIP without /PSL3 will be slow" << (Error*)0;
78  or_->doSampleFormat(sf);
81  Rule::writeTTE(out, out, *cp, l1fa85g_tte, or_, sf, Rule::writeData);
82  delete bp;
83  delete cp;
84  return Rule::Applier::OK;
85 }
86 
87 Rule::Applier out_l1fa85g_applier = { "l1fa85g", out_l1fa85g_check_rule, out_l1fa85g_work, 0 };
88 #endif
89 
90 /* l2jbin --- Sun Mar 17 21:45:22 CET 2002
91  * p0jbin (integrated to p0jbin) --- Mon Apr 15 23:29:13 CEST 2002
92  */
93 
94 //static char *l2jbin_tte=
95 //#include "l2jbin.tth"
96 
97 /** PostScript Level2 DCTEncode (Baseline JPEG), Binary */
99  Rule::Cache *cache=&or_->cache;
100  if ((!cache->isPS() && !cache->isPDF())
101  || cache->Compression!=Rule::Cache::CO_JAI
102  ) return Rule::Applier::DONT_KNOW;
103  /* Dat: not unrequired anymore: cache->TransferEncoding!=cache->TE_Binary */
104  bool badp=false;
105  if (cache->isPS() && !cache->isPSL2()) {
106  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/PSL* /Compression/JAI requires /PSL2+" << (Error*)0;
107  badp=true;
108  }
109  if (cache->SampleFormat!=Image::SF_Asis) {
110  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/PSL*|PDF* /Compression/JAI requires /SampleFormat/Asis" << (Error*)0;
111  badp=true;
112  }
113  if (cache->hasPredictor()) {
114  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/PSL*|PDF* /Compression/JAI requires /Predictor 1" << (Error*)0;
115  badp=true;
116  }
118  /* ^^^ 0+: pacify g++-3.1 */
119 }
121  char const*strings[]={ (char const*)NULLP/*LanguageLevel, PDF-1.`0'*/, ""/*colorSpace*/ };
122  //, " F closefile T closefile"/*closes*/ };
123  // Error::sev(Error::WARNING_DEFER) << "l2jbin: /ZIP without /PSL3 will be slow" << (Error*)0;
125  assert(sf->getImg()->getBpc()==8);
126  or_->doSampleFormat(sf);
127  // PSEncoder *bp=PSEncoder::newASCII85Encode(out, or_->cacheHints.TransferCPL);
128  Rule::Cache *cache=&or_->cache;
129  Filter::VerbatimE outve(out); /* required since template /p0jbin is TTM */
130  GenBuffer::Writable *op=cache->isPDF() ? &outve : &out, *tp=op;
131  strings[0]=const_cast<char*>(cache->isPDF() ? (char const*)"0" : (char const*)"2");
132  if (cache->TransferEncoding==cache->TE_A85) tp=PSEncoder::newASCII85Encode (*op, or_->cacheHints.TransferCPL);
133  else if (cache->TransferEncoding==cache->TE_Hex) tp=PSEncoder::newASCIIHexEncode(*op, or_->cacheHints.TransferCPL);
134  // else strings[2]=" F closefile";
135  Rule::writeTTT(*op, *tp, *tp, !cache->isPDF()?"l2jbin":cache->isPDFB()?"p0jbb":"p0jbin", or_, sf, Rule::writePalData, strings);
136  if (tp!=op) delete tp;
137  /* Dat: outve is deleted by C++ scope */
138  // if (tp!=op) delete tp; /* BUGFIX at Thu Jan 20 15:04:47 CET 2005 */
139  return Rule::Applier::OK;
140 }
141 
143 
144 /* --- */
145 
146 #if 0 /* integrated to _l2jbin_ at Sun Sep 22 14:29:13 CEST 2002 */
147 //static char *p0jbin_ttm=
148 //#include "p0jbin.tth"
149 
150 /** PostScript Level2 DCTEncode (Baseline JPEG), Binary */
151 Rule::Applier::cons_t out_p0jbin_check_rule(Rule::OutputRule* or_) {
152  Rule::Cache *cache=&or_->cache;
153  if (!cache->isPDF()
154  || cache->Compression!=Rule::Cache::CO_JAI
155  ) return Rule::Applier::DONT_KNOW;
156  /* Dat: not unrequired anymore: cache->TransferEncoding!=cache->TE_Binary */
157  bool badp=false;
158  if (cache->SampleFormat!=Image::SF_Asis) {
159  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/PDF* /Compression/JAI requires /SampleFormat/Asis" << (Error*)0;
160  badp=true;
161  }
162  if (cache->hasPredictor()) {
163  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/PDF* /Compression/JAI requires /Predictor 1" << (Error*)0;
164  badp=true;
165  }
166  if (badp) return Rule::Applier::BAD;
167  return Rule::Applier::OK;
168 }
170  char *strings[]={ "0"/*PDF-1.`0'*/, ""/*colorSpace*/ };
171  // " F closefile"/*closes*/ };
172  if (out_p0jbin_check_rule(or_)!=Rule::Applier::OK) return Rule::Applier::DONT_KNOW;
173  assert(sf->getImg()->getBpc()==8);
174  or_->doSampleFormat(sf);
175  Rule::Cache *cache=&or_->cache;
176 
177  Filter::VerbatimE outve(out); /* required since template /p0jbin is TTM */
178  GenBuffer::Writable *tp=&outve;
179  if (cache->TransferEncoding==cache->TE_A85) tp=PSEncoder::newASCII85Encode (outve, or_->cacheHints.TransferCPL);
180  else if (cache->TransferEncoding==cache->TE_Hex) tp=PSEncoder::newASCIIHexEncode(outve, or_->cacheHints.TransferCPL);
181  else strings[2]="";
182 
183 #if 0 /* old */
184  MiniPS::VALUE ttm;
185  { Filter::FlatR flatD(p0jbin_ttm);
186  MiniPS::Parser p(&flatD);
187  ttm=p.parse1();
188  if (p.parse1(p.EOF_ALLOWED)!=MiniPS::Qundef || MiniPS::getType(ttm)!=MiniPS::T_ARRAY)
189  Error::sev(Error::EERROR) << "TTM: the TTM file should contain a single array" << (Error*)0;
190  /* ^^^ Dat: the result of the second p.parse1() doesn't get delete0(...)d */
191  }
192  Filter::VerbatimE outve(out);
193  Rule::writeTTM(outve, outve, outve, MiniPS::RARRAY(ttm), or_, sf, Rule::writePalData, strings);
194  MiniPS::delete0(ttm);
195 #else /* new */
196  Rule::writeTTT(outve, *tp, *tp, cache->isPDFB()?"p0jbb":"p0jbin", or_, sf, Rule::writePalData, strings);
197 #endif
198  if (tp!=&outve)delete tp;
199  return Rule::Applier::OK;
200 }
201 
202 Rule::Applier out_p0jbin_applier = { "PDF-JAI", out_p0jbin_check_rule, out_p0jbin_work, 0 };
203 #endif
204 
205 /* --- Fri Mar 22 11:52:53 CET 2002 */
206 /* PDF added at Sat Apr 20 20:07:34 CEST 2002 */
207 /* Integrated l23ind1 at Sat Apr 20 20:24:21 CEST 2002 */
208 
209 //static char *l23_tte=
210 //#include "l23.tth"
211 
212 /** PostScript Level2 and PDF generic non-transparent */
214  Rule::Cache *cache=&or_->cache;
215  unsigned char sf=cache->SampleFormat;
216  if (cache->hasPredictor() && cache->Compression!=Rule::Cache::CO_ZIP && cache->Compression!=Rule::Cache::CO_LZW) {
217  Error::sev(Error::WARNING_DEFER) << "check_rule: real /Predictor requires /ZIP or /LZW" << (Error*)0;
218  return Rule::Applier::BAD;
219  }
220 
221  // assert(cache->isPSL2() && (sf==Image::SF_Transparent2 || sf==Image::SF_Transparent4 || sf==Image::SF_Transparent8));
222 
223  if ((!cache->isPSL2() && !cache->isPDF())
228  && sf!=Image::SF_Mask)
229  || cache->TransferEncoding==cache->TE_ASCII
230  || !cache->isZIPOK()
231  ) return Rule::Applier::DONT_KNOW;
232  #if !HAVE_LZW
233  if (cache->Compression==Rule::Cache::CO_LZW) return Rule::Applier::DONT_KNOW;
234  #endif
235 
236  // if (cache->isDCTE() && !cache->isRGB() && !cache->isGray()) {
237  bool badp=false;
238  if (cache->isDCTE() && cache->SampleFormat!=Image::SF_Rgb8 && cache->SampleFormat!=Image::SF_Gray8 && cache->SampleFormat!=Image::SF_Indexed8) {
239  Error::sev(Error::WARNING_DEFER) << "check_rule: /DCTEncode requires /Rgb8 or /Gray8 (or /Indexed8)" << (Error*)0;
240  badp=true;
241  }
243  if (cache->isPDF()) {
244  Error::sev(Error::WARNING_DEFER) << "check_rule: unsupported /Transparent+ for /PDF*" << (Error*)0;
245  badp=true;
246  } else assert(cache->isPSL2());
247  }
249 }
252  char LanguageLevel[2]="2", closes[30];
253  SimBuffer::B colorSpace;
254  char const*strings[]={ LanguageLevel, (char*)NULLP /*colorSpace*/, closes };
255  Rule::Cache *cache=&or_->cache;
256  // assert(0);
258  or_->doSampleFormat(sf, true);
259  if (cache->Compression==Rule::Cache::CO_ZIP) {
260  if (!cache->isPDF()) LanguageLevel[0]='3';
261  } else if (cache->isPDF()) LanguageLevel[0]='0';
262  if (cache->isIndexed() || cache->isTransparentM()) {
263  unsigned ncols=PTS_dynamic_cast(Image::Indexed*,sf->getImg())->getNcols();
264  colorSpace << "[/Indexed/DeviceRGB " << ncols-1;
265  if (ncols==0) { /* Avoid writing zero bytes to the filters */
266  /* Imp: verify this in Acrobat Reader */
267  colorSpace << "()]";
268  } else if (!cache->isPDF()) { /* Insert an in-line hexdump. No better way :-( */
269  /*sprintf(colorSpace, "[/Indexed/DeviceRGB %u T %u string readstring pop]", ncols-1, ncols*3); */
270  colorSpace << " T " << ncols*3 << " string readstring pop]";
271  } else { /* Insert an in-line hexdump. No shorter way for PDF */
272 #if 0
273  colorSpace="/DeviceGray ";
274 #else
275  /* SUXX: gs5.50 & PDF & /Indexed doesn't work */
276  colorSpace << "\n<";
278  hp->vi_write(sf->getImg()->getHeadp(), ncols*3);
279  hp->vi_write(0,0);
280  colorSpace << ']'; /* Dat: '>' is appended by ASCIIHexEncode */
281 #endif
282  writeXData=Rule::writeData; /* The palette has already been written. */
283  }
284  } else if (cache->isGray()) colorSpace="/DeviceGray ";
285  else { assert(cache->isRGB()); colorSpace="/DeviceRGB "; }
286  if (cache->SampleFormat==Image::SF_Mask || cache->SampleFormat==Image::SF_Indexed1) writeXData=Rule::writeData;
287 
289  if (cache->isPDF()) vp=new Filter::VerbatimE(out); /* required since template /p02* is TTM */
290 
292  if (cache->TransferEncoding==cache->TE_A85) tp=PSEncoder::newASCII85Encode (*vp, or_->cacheHints.TransferCPL);
293  else if (cache->TransferEncoding==cache->TE_Hex) tp=PSEncoder::newASCIIHexEncode(*vp, or_->cacheHints.TransferCPL);
294 
296  switch (cache->Compression) {
297  case Rule::Cache::CO_None: break;
301  case Rule::Cache::CO_Fax: cp=PSEncoder::newCCITTFaxEncode(*tp, or_->cacheHints.K, or_->cacheHints.EncoderBPL, /*EndOfLine:*/ or_->cacheHints.K>0); break;
302  /* ^^^ getBpp() BUGFIX at Wed Jul 3 20:00:30 CEST 2002 */
303  /* ^^^ EndOfLine BUGFIX at Wed Jul 3 21:12:54 CEST 2002
304  * With EndOfLine==false, `sam2p -c:fax:1', acroread triggers the bug.
305  * With EndOfLine==false, `sam2p -c:fax:2', acroread and gs trigger the bug.
306  */
307 
309  case Rule::Cache::CO_DCT: { SimBuffer::B other_parameters;
310  or_->cacheHints.DCT->dump(other_parameters, 0, false);
312  break; }
313  default: assert(0);
314  }
315 
318 
319  #if 0 /* Sun Sep 22 20:40:51 CEST 2002 */
320  if (cp!=tp) strcpy(closes," F closefile"); else closes[0]='\0';
321  if (tp!=vp) strcpy(closes+strlen(closes)," T closefile");
322  #endif
323 
324  strings[1]=colorSpace.term0()();
325  Rule::writeTTT(*vp, *tp, *pp,
326  !cache->isPDF() ? (
327  cache->SampleFormat==Image::SF_Indexed1 ? "l23ind1" :
328  cache->SampleFormat==Image::SF_Mask ? "l23mask" :
329  cache->isTransparentM() ? "l23tran2" :
330  "l23"
331  ) : cache->isPDFB() ? (
332  cache->SampleFormat==Image::SF_Indexed1 ? "p02ind1bb" :
333  cache->SampleFormat==Image::SF_Mask ? "p02maskbb" :
334  "p02bb"
335  ) : (
336  cache->SampleFormat==Image::SF_Indexed1 ? "p02ind1" :
337  cache->SampleFormat==Image::SF_Mask ? "p02mask" :
338  "p02"
339  ), or_, sf, writeXData, strings);
340  if (pp!=cp) delete pp;
341  if (cp!=tp) delete cp;
342  if (tp!=vp) delete tp;
343  if (vp!=&out)delete vp;
344  return Rule::Applier::OK;
345 }
346 
348 
349 /* --- Fri Mar 22 17:22:40 CET 2002 -- Sat Jun 15 16:03:06 CEST 2002 */
350 
351 /* integrated l1tr at Sat Jun 15 16:03:03 CEST 2002 */
352 /* added /Bbox at Sat Jun 15 16:03:31 CEST 2002 */
353 
354 //static char *l1tr_tte=
355 //#include "l1tr.tth"
356 
357 /** PostScript Level1 or PDF Fully transparent image */
359  Rule::Cache *cache=&or_->cache;
360  if (!(cache->isPS() || cache->isPDF())
361  || (cache->SampleFormat!=Image::SF_Transparent && cache->SampleFormat!=Image::SF_Bbox && cache->SampleFormat!=Image::SF_Opaque)
362  ) return Rule::Applier::DONT_KNOW;
363  return Rule::Applier::OK;
364 }
366  char t[]="....";
368  or_->doSampleFormat(sf);
369  Rule::Cache *cache=&or_->cache;
370  Filter::VerbatimE outve(out); /* required since template /p0* is TTM */
371  if (cache->isPS()) { t[0]='l'; t[1]='1'; }
372  else { t[0]='p'; t[1]='0'; }
373  switch (cache->SampleFormat) {
374  case Image::SF_Transparent: t[2]='t'; t[3]='r'; break;
375  case Image::SF_Opaque: t[2]='o'; t[3]='p'; break;
376  case Image::SF_Bbox: t[2]='b'; t[3]='b'; break;
377  default: assert(0);
378  }
379  Rule::writeTTT(outve, outve, outve, t, or_, sf, 0/*NULLP*/);
380  return Rule::Applier::OK;
381 }
382 
384 
385 /* --- */
386 
387 /* --- l23mask Fri Mar 22 18:11:12 CET 2002
388  * --- l23ind1 Fri Mar 22 18:11:12 CET 2002
389  * removed (integrated to l23) at Sat Apr 20 20:25:57 CEST 2002
390  */
391 
392 /* --- l1mask Fri Mar 22 18:33:01 CET 2002
393  * --- l1mashex Sun Apr 14 15:25:25 CEST 2002
394  * --- l1in1 Fri Mar 22 18:33:37 CET 2002
395  * --- l1in1hex Fri Mar 22 18:33:37 CET 2002
396  * removed (integrated to l1c) at Sat Apr 20 20:25:57 CEST 2002
397  * --- lcr Sat Jun 1 17:09:57 CEST 2002
398  * removed (integrated to l1c) at Sun Jun 2 16:48:31 CEST 2002
399  * --- l1gbh
400  * removed (integrated to l1c) at Sun Jun 2 16:48:31 CEST 2002
401  * --- l1fa85g.tte: PostScript Level1 FlateEncode, A85, without Predictor
402  * removed (integrated to l1c) at Sun Sep 22 00:48:21 CEST 2002
403  */
404 
405 /* --- Sun Jun 2 16:48:44 CEST 2002 */
406 
407 //static char *l1mask_tte=
408 //#include "l1mask.tth"
409 
411  Rule::Cache *cache=&or_->cache;
412  tp=&out;
413  if (cache->TransferEncoding==cache->TE_A85) { tkey[3]='8'; tp=PSEncoder::newASCII85Encode (out, or_->cacheHints.TransferCPL); }
414  else if (cache->TransferEncoding==cache->TE_Hex) { tkey[3]='h'; tp=PSEncoder::newASCIIHexEncode(out, or_->cacheHints.TransferCPL); }
415  else tkey[3]='b';
416  cp=tp;
417  if (cache->Compression==Rule::Cache::CO_RLE) { tkey[4]='r'; cp=PSEncoder::newRunLengthEncode(*tp, or_->cacheHints.RecordSize); }
418  else if (cache->Compression==Rule::Cache::CO_ZIP) { tkey[4]='z'; cp=PSEncoder::newFlateEncode(*tp, or_->cacheHints.Effort); }
419  else if (cache->Compression==Rule::Cache::CO_LZW) { tkey[4]='l'; cp=PSEncoder::newLZWEncode(*tp); }
420  else tkey[4]='n';
421  /* vvv removed 'm' and '1' at Sun Sep 22 17:53:08 CEST 2002 */
422  tkey[2]=// cache->SampleFormat==Image::SF_Mask ? 'm' :
423  // cache->SampleFormat==Image::SF_Indexed1 ? '1' :
424  cache->SampleFormat==Image::SF_Indexed2 ? '2' :
425  cache->SampleFormat==Image::SF_Indexed4 ? '4' :
426  cache->SampleFormat==Image::SF_Indexed8 ? '8' :
427  cache->SampleFormat==Image::SF_Transparent2 ? 't' :
428  cache->SampleFormat==Image::SF_Transparent4 ? 't' :
429  cache->SampleFormat==Image::SF_Transparent8 ? 't' :
430  'g'; /* /Gray*, /Rgb*, /Mask, /Indexed1 */
431 }
432 
433 /** PostScript Level1 uncompressed binary or hex */
435  Rule::Cache *cache=&or_->cache;
436  if ((cache->FileFormat!=cache->FF_PSL1 && cache->FileFormat!=cache->FF_PSLC && cache->FileFormat!=cache->FF_PSL2)
437  || (cache->FileFormat==cache->FF_PSL2 && cache->Compression!=Rule::Cache::CO_ZIP)
438  || (cache->TransferEncoding!=cache->TE_Binary && cache->TransferEncoding!=cache->TE_Hex && cache->TransferEncoding!=cache->TE_A85)
439  || (cache->Compression!=Rule::Cache::CO_None && cache->Compression!=Rule::Cache::CO_RLE && cache->Compression!=Rule::Cache::CO_ZIP && cache->Compression!=Rule::Cache::CO_LZW)
440  || cache->hasPredictor()
441  || !(cache->isTransparentM() || cache->isIndexed() || cache->isGray() || cache->isRGB())
442  ) return Rule::Applier::DONT_KNOW;
443  bool badp=false;
444  if (cache->FileFormat==cache->FF_PSL1 && cache->SampleFormat!=Image::SF_Indexed1 && cache->isIndexed()) {
445  Error::sev(Error::WARNING_DEFER) << "check_rule: /SampleFormat/Indexed+ doesn't work with /FileFormat/PSL1 (use /PSLC or /PSL2)" << (Error*)0;
446  badp=true;
447  }
448  if (cache->FileFormat==cache->FF_PSL1 && cache->isRGB()) {
449  Error::sev(Error::WARNING_DEFER) << "check_rule: /SampleFormat/RGB* doesn't work with /FileFormat/PSL1 (use /PSLC or /PSL2)" << (Error*)0;
450  badp=true;
451  }
452  char tkey[]="l1..."; /* /l1{2,4,8,t}{8,h}{r,z,l} */
454  gen_tkey(tkey, *out, tp0, cp0, or_);
455  /* fprintf(stderr,"tkey=%s\n", tkey); */
456  if (!badp && Rule::Templates->get(tkey, strlen(tkey))==MiniPS::Qundef) return Rule::Applier::DONT_KNOW;
458  /* ^^^ Dat: 0+: pacify gcc-3.1 */
459 }
462  /* Dat: only these have been defined so far: grep '^/l1[248tg][8h][rzl]' bts2.ttt
463  * /l1thr /l1g8r /l1ghr /l128r /l12hr /l148r /l14hr /l188r /l18hr /l1g8z /l1ghz /l1g8l /l1ghl
464  */
465  or_->doSampleFormat(sf, true); /* Dat: `true': because of /Transparent+ */
466  char tkey[]="l1..."; /* /l1{2,4,8,t}{8,h}{r,z,l} */
468  gen_tkey(tkey, out, tp, cp, or_);
469  // fprintf(stderr, "tkey=(%s)\n", tkey);
470  Rule::writeTTT(out, *tp, *cp, tkey, or_, sf,
471  tkey[2]=='2' || tkey[2]=='4' || tkey[2]=='8' || tkey[2]=='t' ? Rule::writePalData : Rule::writeData
472  );
473  // Rule::writeTTT(out, *tp, *cp, tkey, or_, sf, Rule::writePalData);
474  if (cp!=tp) delete cp;
475  if (tp!=&out)delete tp;
476  return Rule::Applier::OK;
477 }
478 
480 
481 /* lcrbin (lcrb) --- Sun Apr 14 16:50:14 CEST 2002
482  * lcrhex (lcr8, lcrh) --- Sun Apr 14 16:50:22 CEST 2002
483  * removed (integrated to _l1c_) at Sat Jun 1 17:09:52 CEST 2002
484  */
485 
486 #if 0
487 /* --- Sat Jun 1 17:09:57 CEST 2002 */
488 
489 //static char *lcrbin_tte=
490 //#include "lcrbin.tth"
491 
492 /** PostScript Level1+C uncompressed RGB image */
493 Rule::Applier::cons_t out_lcr_check_rule(Rule::OutputRule* or_) {
494  Rule::Cache *cache=&or_->cache;
495  if (!cache->isPS()
496  || cache->FileFormat==cache->FF_PSL1
497  || (cache->TransferEncoding!=cache->TE_Binary && cache->TransferEncoding!=cache->TE_Hex && cache->TransferEncoding!=cache->TE_A85)
498  || cache->Compression!=Rule::Cache::CO_None
499  || cache->hasPredictor()
500  || !cache->isRGB()
501  ) return Rule::Applier::DONT_KNOW;
502  return Rule::Applier::OK;
503 }
505  Rule::Cache *cache=&or_->cache;
506  if (out_lcr_check_rule(or_)!=Rule::Applier::OK) return Rule::Applier::DONT_KNOW;
507  or_->doSampleFormat(sf);
508  char tkey[]="lcr.";
510  if (cache->TransferEncoding==cache->TE_A85) { tkey[3]='8'; tp=PSEncoder::newASCII85Encode (out, or_->cacheHints.TransferCPL); }
511  else if (cache->TransferEncoding==cache->TE_Hex) { tkey[3]='h'; tp=PSEncoder::newASCIIHexEncode(out, or_->cacheHints.TransferCPL); }
512  else tkey[3]='b';
513  Rule::writeTTT(out, *tp, *tp, tkey, or_, sf, Rule::writeData);
514  if (tp!=&out)delete tp;
515  return Rule::Applier::OK;
516 }
517 
518 Rule::Applier out_lcr_applier = { "PSLC-RGB", out_lcr_check_rule, out_lcr_work, 0 };
519 #endif
520 
521 /* --- Sat Mar 23 12:37:04 CET 2002; Tue Jul 2 10:23:44 CEST 2002 */
522 
524  Rule::Cache *cache=&or_->cache;
525  bool badp=false;
526  if (cache->FileFormat!=cache->FF_GIF89a
527  ) return Rule::Applier::DONT_KNOW;
528  if (!cache->isIndexed() && !cache->isTransparentM()) {
529  Error::sev(Error::WARNING_DEFER) << "check_rule: /GIF89a must be /Indexed*, /Mask or /Transparent+" << (Error*)0;
530  badp=true;
531  }
532  if (cache->TransferEncoding!=cache->TE_Binary) {
533  Error::sev(Error::WARNING_DEFER) << "check_rule: /GIF89a requires /Binary" << (Error*)0;
534  badp=true;
535  }
536  if (cache->Compression!=Rule::Cache::CO_None && cache->Compression!=Rule::Cache::CO_LZW) {
537  Error::sev(Error::WARNING_DEFER) << "check_rule: /GIF89a requires /LZW" << (Error*)0;
538  badp=true;
539  }
540  if (cache->hasPredictor()) {
541  Error::sev(Error::WARNING_DEFER) << "check_rule: /GIF89a requires /Predictor 1" << (Error*)0;
542  badp=true;
543  }
544  #if !USE_OUT_GIF
545  Error::sev(Error::WARNING_DEFER) << "check_rule: please `configure --enable-gif' for /GIF89a" << (Error*)0;
546  badp=true;
547  #endif
548  if (badp) return Rule::Applier::BAD;
549  or_->cache.WarningOK=true;
550  return Rule::Applier::OK;
551 }
552 #if USE_OUT_GIF
553  #if OBJDEP
554  # warning REQUIRES: out_gif.o
555  #endif
556  extern void out_gif_write(GenBuffer::Writable& out, Image::Indexed *img); /* out_gif.cpp */
560  /* ^^^ Dat: 0+: pacify gcc-3.1; (Image::sf_t): pacify VC6.0 */
561  or_->doSampleFormat(sf);
563  return Rule::Applier::OK;
564  }
565 #else
566 /*# define out_gif89a_check_rule (Rule::Applier::check_rule_t)NULLP*/
567 # define out_gif89a_work (Rule::Applier::work_t)0
568 #endif
569 
571 #if HAVE_LZW
572  "GIF89a+LZW"
573 #else
574  "GIF89a"
575 #endif
577 
578 /* --- Tue Jun 4 19:51:03 CEST 2002 */
579 
581  Rule::Cache *cache=&or_->cache;
582  bool badp=false;
583  if (cache->FileFormat!=cache->FF_XPM
584  ) return Rule::Applier::DONT_KNOW;
585  if (!cache->isIndexed() && !cache->isTransparentM()) {
586  Error::sev(Error::WARNING_DEFER) << "check_rule: /XPM must be /Indexed*, /Mask or /Transparent+" << (Error*)0;
587  badp=true;
588  }
589  if (cache->TransferEncoding!=cache->TE_ASCII && cache->TransferEncoding!=cache->TE_Binary) {
590  /* ^^^ && BUGFIX at Thu Jul 11 21:57:09 CEST 2002 */
591  Error::sev(Error::WARNING_DEFER) << "check_rule: /XPM requires /TransferEncoding/ASCII" << (Error*)0;
592  badp=true;
593  }
594  if (cache->Compression!=Rule::Cache::CO_None) {
595  Error::sev(Error::WARNING_DEFER) << "check_rule: /XPM requires /Compression/None" << (Error*)0;
596  badp=true;
597  }
598  if (cache->hasPredictor()) {
599  Error::sev(Error::WARNING_DEFER) << "check_rule: /XPM requires /Predictor 1" << (Error*)0;
600  badp=true;
601  }
602  if (badp) return Rule::Applier::BAD;
603  or_->cache.WarningOK=true;
604  return Rule::Applier::OK;
605 }
609  /* ^^^ force 8-bit; may trigger warnings... */
610  /* ^^^ Dat: 0+: pacify gcc-3.1 */
611  or_->doSampleFormat(sf);
613  /* vvv 93 useful ASCII chars (+ '\0'), missing: " and \ ; plus a hextable */
614  static char const xpmc=93;
615  static char const xpms[xpmc+1]="0123456789abcdef !#$%&'()*+,-./:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`ghijklmnopqrstuvwxyz{|}~";
616 
617  Image::Sampled::dimen_t wd=iimg->getWd(), htc=iimg->getHt();
618  bool pal2ch=iimg->getNcols()>xpmc;
619  // pal2ch=true;
620  out << "/* XPM */\nstatic char *sam2p_xpm[] = {\n"
621  "/* columns rows colors chars-per-pixel */\n\""
622  << wd << ' ' << htc << ' ' << iimg->getNcols()
623  << ' ' << (pal2ch?2:1) << "\",\n";
624  char const *p=iimg->getHeadp(), *pend=iimg->getRowbeg(), *phend;
625  char coline3[]="\".. c #ABCDEF\",\n";
626  char cotran3[]="\".. c None s None \",\n";
627  assert((pend-p)%3==0);
628  unsigned i=0;
629  bool transp=false;
630  if (iimg->getTransp()>=0) { pend-=3; assert((iimg->getTransp())*3+p==pend); transp=true; }
631  if (pal2ch) {
632  while (p!=pend) {
633  coline3[ 1]=xpms[i>>2];
634  coline3[ 2]=xpms[i++&3];
635  coline3[ 7]=xpms[*(unsigned char const*)p>>4];
636  coline3[ 8]=xpms[*(unsigned char const*)p++&15];
637  coline3[ 9]=xpms[*(unsigned char const*)p>>4];
638  coline3[10]=xpms[*(unsigned char const*)p++&15];
639  coline3[11]=xpms[*(unsigned char const*)p>>4];
640  coline3[12]=xpms[*(unsigned char const*)p++&15];
641  out << coline3;
642  }
643  if (transp) {
644  cotran3[ 1]=xpms[i>>2];
645  cotran3[ 2]=xpms[i++&3];
646  out << cotran3;
647  p+=3;
648  }
649  pend=iimg->getRowbeg()+wd*htc;
650  out << "/* Pixels */\n";
651  char *obuf=new char[4+2*wd], *op;
652  obuf[0]='"';
653  obuf[2*wd+1]='"';
654  obuf[2*wd+2]=','; /* Dat: it's OK to have a comma in the last line */
655  obuf[2*wd+3]='\n';
656  while (htc--!=0) {
657  phend=p+wd;
658  op=obuf;
659  while (p!=phend) { *++op=xpms[*p>>2]; *++op=xpms[*p++&3]; }
660  out.vi_write(obuf, 2*wd+4);
661  }
662  delete [] obuf;
663  } else {
664  coline3[1]='"';
665  while (p!=pend) {
666  coline3[ 2]=xpms[i++];
667  coline3[ 7]=xpms[*(unsigned char const*)p>>4];
668  coline3[ 8]=xpms[*(unsigned char const*)p++&15];
669  coline3[ 9]=xpms[*(unsigned char const*)p>>4];
670  coline3[10]=xpms[*(unsigned char const*)p++&15];
671  coline3[11]=xpms[*(unsigned char const*)p>>4];
672  coline3[12]=xpms[*(unsigned char const*)p++&15];
673  out << (coline3+1);
674  }
675  if (transp) {
676  cotran3[1]='"';
677  cotran3[ 2]=xpms[i];
678  out << (cotran3+1);
679  p+=3;
680  }
681  pend=iimg->getRowbeg()+wd*htc;
682  out << "/* Pixels */\n";
683  char *obuf=new char[4+wd], *op;
684  obuf[0]='"';
685  obuf[wd+1]='"';
686  obuf[wd+2]=','; /* Dat: it's OK to have a comma in the last line */
687  obuf[wd+3]='\n';
688  while (htc--!=0) {
689  phend=p+wd;
690  op=obuf;
691  while (p!=phend) *++op=xpms[0U+*p++];
692  out.vi_write(obuf, wd+4);
693  }
694  delete [] obuf;
695  }
696  assert(p==pend);
697  out << "};\n";
698  return Rule::Applier::OK;
699 }
700 
702 
703 /* --- Sat Mar 23 13:18:07 CET 2002 */
704 
706  Rule::Cache *cache=&or_->cache;
707  if (cache->FileFormat!=cache->FF_PNM
708  ) return Rule::Applier::DONT_KNOW;
709  bool badp=false;
710  // if (cache->SampleFormat!=Image::SF_Rgb8 && cache->SampleFormat!=Image::SF_Gray8 && cache->SampleFormat!=Image::SF_Gray1) {
711  if (!cache->isGray() && !cache->isRGB() && !cache->isIndexed() && !cache->isTransparentM()) {
712  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNM must be /Rgb8, /Gray8 or /Gray1" << (Error*)0;
713  badp=true;
714  }
715  if (cache->TransferEncoding!=cache->TE_Binary && cache->TransferEncoding!=cache->TE_ASCII) {
716  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNM requires /Binary or /ASCII" << (Error*)0;
717  badp=true;
718  }
719  if (cache->Compression!=Rule::Cache::CO_None) {
720  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNM requires /Compression/None" << (Error*)0;
721  badp=true;
722  }
723  if (cache->hasPredictor()) {
724  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNM requires /Predictor 1" << (Error*)0;
725  badp=true;
726  }
727  if (badp) return Rule::Applier::BAD;
728  or_->cache.WarningOK=true;
729  return Rule::Applier::OK;
730 }
732  /*static*/ char head[]={ 'P', 0, '\n', '#', ' ', 'b', 'y', ' ' };
733  /*static*/ char tmp[72];
734  Image::sf_t sfo=or_->cache.SampleFormat;
735  Image::Indexed *alphaChannel=(Image::Indexed*)NULLP;
741  } else if (or_->cache.isRGB()) {
743  } else {
744  assert(or_->cache.isIndexed() || or_->cache.isTransparentM());
745  if (or_->cache.isTransparentM()) {
746  alphaChannel=PTS_dynamic_cast(Image::Indexed*,sf->getImg())->calcAlpha();
747  sf->clearTransp(); /* BUGFIX at Tue Sep 17 10:05:47 CEST 2002 */
748  }
750  !sf->canGrayy() ? 0+Image::SF_Rgb8
751  : sf->minRGBBpcc()==1 ? 0+Image::SF_Gray1 : 0+Image::SF_Gray8);
752  /* ^^^ Dat: 0+: pacify gcc-3.1 */
753  }
756  or_->doSampleFormat(sf);
757  sfo=or_->cache.SampleFormat;
758  head[1]=(sfo==Image::SF_Rgb8 ? '3' : sfo==Image::SF_Gray8 ? '2' : '1')
759  +(or_->cache.TransferEncoding==or_->cache.TE_Binary)*3;
760  out.vi_write(head, sizeof(head));
761  out << Error::banner0;
762  Image::Sampled *img=sf->getImg();
763  out << '\n' << img->getWd() << ' ' << img->getHt();
764  out << &(" 255\n"[sfo==Image::SF_Gray1?4:0]);
765  /* ^^^ SF_Gray1 BUGFIX at Tue Jun 4 21:44:17 CEST 2002 */
766  register char *p=img->getRowbeg(), *t=(char*)NULLP;
767  slen_t len=img->getRlen()*img->getHt();
768  // fprintf(stderr, "len=%u\n", len);
769  register unsigned smallen, i;
770  switch (head[1]) {
771  case '1': /* PBM ASCII */
772  while (len>=70) {
773  smallen=70; t=tmp; while (smallen--!=0) *t++=(*p++==0)?'1':'0';
774  /* ^^^ note the swapping of '0' and '1' above */
775  *t++='\n'; out.vi_write(tmp, 71);
776  len-=70;
777  }
778  while (len--!=0) *t++=(*p++==0)?'0':'1';
779  /* Dat: xv requires a whitespace just before EOF */
780  *t++='\n'; out.vi_write(tmp, t-tmp);
781  break;
782  case '2': case '3': /* PGM ASCII, PPM ASCII */
783  while (len!=0) {
784  if (len>17) { smallen=17; len-=17; } else { smallen=len; len=0; }
785  t=tmp; while (smallen--!=0) {
786  if ((i=*(unsigned char*)p++)<10) *t++=i+'0';
787  else if (i<100) { *t++=i/10+'0'; *t++=i%10+'0'; }
788  else if (i<200) { *t++='1'; *t++=(i-100)/10+'0'; *t++=i%10+'0'; }
789  else { *t++='2'; *t++=(i-200)/10+'0'; *t++=i%10+'0'; }
790  *t++=' ';
791  }
792  /* Dat: xv requires a whitespace just before EOF */
793  t[-1]='\n'; out.vi_write(tmp, t-tmp/*-(len==0)*/);
794  }
795  break;
796  case '4': /* PBM RAWBITS */
797  /* Invert the image */
798  while (len--!=0) *p++^=-1;
799  p=img->getRowbeg();
800  len=img->getRlen()*img->getHt();
801  /* fall through */
802  default: /* PBM RAWBITS, PGM RAWBITS, PPM RAWBITS */
803  /* fwrite(p, 1, len, stdout); */
804  out.vi_write(p, len);
805  }
806  if (alphaChannel!=NULLP) {
807  /* OK: don't always output rawbits PBM file */
808  assert(alphaChannel->getBpc()==1);
809  assert(alphaChannel->getWd()==img->getWd());
810  assert(alphaChannel->getHt()==img->getHt());
811  /* write PBM RAWBITS subfile (alpha channel) */
812  if (or_->cache.TransferEncoding==or_->cache.TE_Binary) {
813  out << "P4 " << img->getWd() << ' ' << img->getHt() << '\n';
814  out.vi_write(alphaChannel->getRowbeg(), alphaChannel->getRlen()*alphaChannel->getHt());
815  /* ^^^ BUGFIX at Tue Sep 17 10:18:28 CEST 2002 */
816  } else {
817  out << "P1 " << img->getWd() << ' ' << img->getHt() << '\n';
818  alphaChannel->to8();
819  p=alphaChannel->getRowbeg(); len=alphaChannel->getRlen()*alphaChannel->getHt();
820  while (len>=70) {
821  smallen=70; t=tmp; while (smallen--!=0) *t++=(*p++!=0)?'1':'0';
822  /* ^^^ note the non-swapping of '0' and '1' above */
823  *t++='\n'; out.vi_write(tmp, 71);
824  len-=70;
825  }
826  while (len--!=0) *t++=(*p++!=0)?'0':'1';
827  /* Dat: xv requires a whitespace just before EOF */
828  *t++='\n'; out.vi_write(tmp, t-tmp);
829  }
830  delete alphaChannel;
831  }
832  return Rule::Applier::OK;
833 }
834 
836 
837 /* --- Sat Aug 10 22:18:33 CEST 2002 */
838 
840  Rule::Cache *cache=&or_->cache;
841  if (cache->FileFormat!=cache->FF_XWD
842  ) return Rule::Applier::DONT_KNOW;
843  bool badp=false;
844  if (cache->SampleFormat!=Image::SF_Rgb8 && cache->SampleFormat!=Image::SF_Gray8 && cache->SampleFormat!=Image::SF_Indexed8) {
845  Error::sev(Error::WARNING_DEFER) << "check_rule: /XWD must be /Rgb8, /Gray8 or /Indexed8" << (Error*)0;
846  return Rule::Applier::BAD;
847  }
848  if (cache->TransferEncoding!=cache->TE_Binary) {
849  Error::sev(Error::WARNING_DEFER) << "check_rule: /XWD requires /Binary" << (Error*)0;
850  badp=true;
851  }
852  if (cache->Compression!=Rule::Cache::CO_None) {
853  Error::sev(Error::WARNING_DEFER) << "check_rule: /XWD requires /Compression/None" << (Error*)0;
854  badp=true;
855  }
856  if (cache->hasPredictor()) {
857  Error::sev(Error::WARNING_DEFER) << "check_rule: /XWD requires /Predictor 1" << (Error*)0;
858  badp=true;
859  }
860  if (badp) return Rule::Applier::BAD;
861  return Rule::Applier::OK;
862 }
864  static const unsigned
865  XWD_FILE_VERSION=7,
866  ZPixmap=2,
867  MSBFirst=1,
868  DirectColor=5,
869  PseudoColor=3,
870  //GrayScale=1,
871  StaticGray=0;
872  Image::sf_t sfo=or_->cache.SampleFormat;
874  or_->doSampleFormat(sf);
875  sfo=or_->cache.SampleFormat;
876  char head[101], *p=head;
877  Image::Sampled *img=sf->getImg();
878  slen_t bits_per_pixel, bitmap_pad, bytes_per_line;
879  unsigned ncolors;
880 
881  memset(head, '\0', 101);
882  /*header_size*/ mf32(p,101);
883  /*file_version*/ (p+=4)[-1]=XWD_FILE_VERSION;
884  /*pixmap_format*/ (p+=4)[-1]=ZPixmap;
885  /*pixmap_depth*/ (p+=4)[-1]=sfo==Image::SF_Rgb8 ? 24 : 8;
886  /*pixmap_width */ mf32(p, img->getWd());
887  /*pixmap_height*/ mf32(p, img->getHt());
888  /*xoffset*/ p+=4;
889  /*byte_order*/ (p+=4)[-1]=MSBFirst;
890  /*bitmap_unit*/ (p+=4)[-1]=8; // sfo==Image::SF_Rgb8 ? 32 : 8;
891  /*bitmap_bit_order*/ (p+=4)[-1]=MSBFirst;
892  /*bitmap_pad*/ bitmap_pad=(p+=4)[-1]=8; // sfo==Image::SF_Rgb8 ? 32 : 8;
893  /* ^^^ force no padding at all */
894  /*bits_per_pixel*/ bits_per_pixel=(p+=4)[-1]=sfo==Image::SF_Rgb8 ? 24 : 8;
895  /*bytes_per_line*/ mf32(p, bytes_per_line=((bits_per_pixel*img->getWd()+bitmap_pad-1)&~(bitmap_pad-1))>>3);
896  /*visual_class*/ (p+=4)[-1]=sfo==Image::SF_Rgb8 ? DirectColor : sfo==Image::SF_Indexed8 ? PseudoColor : StaticGray;
897  /*red_mask */ (p+=4)[-3]=(char)(sfo==Image::SF_Rgb8 ? 255 : 0);
898  /*green_mask*/ (p+=4)[-2]=(char)(sfo==Image::SF_Rgb8 ? 255 : 0);
899  /*blue_mask */ (p+=4)[-1]=(char)(sfo==Image::SF_Rgb8 ? 255 : 0);
900  /*bits_per_rgb*/ (p+=4)[-1]=sfo==Image::SF_Rgb8 ? 24 : 8;
901  /*colormap_entries*/ (p+=4)[-2]=1; /*256*/
902  /*ncolors*/ mf32(p, ncolors=sfo==Image::SF_Rgb8 ? 0 : sfo==Image::SF_Indexed8 ? ((Image::Indexed*)img)->getNcols() : 256);
903  /*window_width */ mf32(p, img->getWd());
904  /*window_height*/ mf32(p, img->getHt());
905  assert(p+13==head+101);
906  /*window_x*/ /*0*/
907  /*window_y*/ /*0*/
908  /*window_bdrwidth*/ /*0*/
909  /*filename*/ /*""*/
910  out.vi_write(head, 101);
911 
912  if (sfo!=Image::SF_Rgb8) {
913  char *pal=new char[ncolors*12], *pp=pal;
914  unsigned pixel;
915  if (sfo==Image::SF_Indexed8) {
916  char const* q=img->getHeadp();
917  for (pixel=0;pixel<ncolors;pixel++) {
918  *pp++=0; *pp++=0; *pp++=0; *pp++=pixel;
919  *pp++=*q; *pp++=*q++; /* red */
920  *pp++=*q; *pp++=*q++; /* green */
921  *pp++=*q; *pp++=*q++; /* blue */
922  *pp++=7;
923  *pp++=0;
924  }
925  } else { assert(sfo==Image::SF_Gray8);
926  for (pixel=0;pixel<ncolors;pixel++) {
927  *pp++=0; *pp++=0; *pp++=0; *pp++=pixel;
928  *pp++=pixel; *pp++=pixel; /* red */
929  *pp++=pixel; *pp++=pixel; /* green */
930  *pp++=pixel; *pp++=pixel; /* blue */
931  *pp++=7;
932  *pp++=0;
933  }
934  }
935  out.vi_write(pal, ncolors*12);
936  delete [] pal;
937  }
938 
939  slen_t rlen=img->getRlen();
940  Image::Sampled::dimen_t htc=img->getHt();
941  char const* rp=img->getRowbeg();
942  unsigned scanline_pad=bytes_per_line-rlen;
943  // assert(*rp=='\xff');
944  if (scanline_pad!=0) {
945  assert(1<=scanline_pad && scanline_pad<=3);
946  while (htc--!=0) {
947  out.vi_write(rp, rlen);
948  rp+=rlen;
949  if (scanline_pad!=0) out.vi_write("\0\0", scanline_pad);
950  }
951  } else out.vi_write(rp, rlen*htc);
952 
953  return Rule::Applier::OK;
954 }
955 
957 
958 Rule::Applier out_x11_applier = { "X11", 0/*out_x11_check_rule*/, 0/*out_x11_work*/, 0 };
959 
960 /* --- Sat Apr 20 11:49:56 CEST 2002 */
961 
962 /** Baseline (lossy) JPEG */
964  Rule::Cache *cache=&or_->cache;
965  if (cache->FileFormat!=cache->FF_JPEG
966  || cache->Compression==Rule::Cache::CO_JAI
967  ) return Rule::Applier::DONT_KNOW;
968  bool badp=false;
969  if (cache->SampleFormat!=Image::SF_Rgb8 && cache->SampleFormat!=Image::SF_Gray8) {
970  Error::sev(Error::WARNING_DEFER) << "check_rule: /DCTEncode requires /Rgb8 or /Gray8" << (Error*)0;
971  badp=true;
972  }
973  if (cache->TransferEncoding!=cache->TE_Binary) {
974  Error::sev(Error::WARNING_DEFER) << "check_rule: /JPEG requires /Binary" << (Error*)0;
975  badp=true;
976  }
977  if (cache->Compression!=Rule::Cache::CO_None && cache->Compression!=Rule::Cache::CO_DCT && cache->Compression!=Rule::Cache::CO_IJG) {
978  Error::sev(Error::WARNING_DEFER) << "check_rule: /JPEG requires /DCT or /IJG" << (Error*)0;
979  badp=true;
980  }
981  if (cache->hasPredictor()) {
982  Error::sev(Error::WARNING_DEFER) << "check_rule: /JPEG requires /Predictor 1" << (Error*)0;
983  badp=true;
984  }
985  if (badp) return Rule::Applier::BAD;
986  or_->cache.WarningOK=true; /* ?? */
987  return Rule::Applier::OK;
988 }
990  Rule::Cache *cache=&or_->cache;
991  // assert(0);
993  or_->doSampleFormat(sf);
994  // GenBuffer::Writable *tp=&out; /* always binary */
996  /* SUXX: cjpeg(1) won't create a color JPEG for a grayscale image */
997  if (cache->Compression==Rule::Cache::CO_DCT) {
998  SimBuffer::B other_parameters;
999  or_->cacheHints.DCT->dump(other_parameters, 0, false);
1001  } else {
1002  assert(cache->Compression==Rule::Cache::CO_None || cache->Compression==Rule::Cache::CO_IJG);
1004  }
1006  delete cp;
1007  return Rule::Applier::OK;
1008 }
1009 
1011 
1012 /* --- Wed Apr 17 13:32:46 CEST 2002 */
1013 
1015  Rule::Cache *cache=&or_->cache;
1016  if (cache->FileFormat!=cache->FF_JPEG
1017  || cache->Compression!=Rule::Cache::CO_JAI
1018  ) return Rule::Applier::DONT_KNOW;
1019  bool badp=false;
1020  if (cache->SampleFormat!=Image::SF_Asis) {
1021  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/JPEG /Compression/JAI requires /SampleFormat/Asis" << (Error*)0;
1022  badp=true;
1023  }
1024  if (cache->TransferEncoding!=cache->TE_Binary) {
1025  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/JPEG /Compression/JAI requires /TransferEncoding/Binary" << (Error*)0;
1026  badp=true;
1027  }
1028  if (cache->hasPredictor()) {
1029  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/JPEG /Compression/JAI requires /Predictor 1" << (Error*)0;
1030  badp=true;
1031  }
1032  if (badp) return Rule::Applier::BAD;
1033  return Rule::Applier::OK;
1034 }
1036  /* This is the second simplest Applier I've ever written. */
1038  Image::Sampled *img=sf->getImg();
1039  // out.vi_write(img->getHeadp(), img->end_()-img->getHeadp());
1040  /* ^^^ end_() BUGFIX by pts@fazekas.hu at Sun Jun 2 22:24:32 CEST 2002 */
1041  /* ^^^ end_() contains 8 extra bytes */
1042  out.vi_write(img->getHeadp(), img->getRowbeg()-img->getHeadp());
1043  return Rule::Applier::OK;
1044 }
1045 
1047 
1048 /* --- Sun Jun 2 22:25:16 CEST 2002 */
1049 
1052  /** true iff little endian == LSB first */
1053  bool le;
1055  public:
1056  TIFFPrinter(GenBuffer::Writable &out_, bool le_);
1057  inline SimBuffer::B& getS() { return s; }
1058  inline SimBuffer::B const& getDir() const { return dir; }
1059  void aSHORT(SimBuffer::B &s, unsigned count, unsigned short const*val);
1060  void aLONG (SimBuffer::B &s, unsigned count, slen_t const*val);
1061  void dirSHORT(unsigned short tag, slen_t count, unsigned short const*val);
1062  void dirLONG(unsigned short tag, slen_t count, slen_t const*val);
1063  void dirSL(unsigned short tag, slen_t val);
1064  void dirLONG(unsigned short tag, slen_t val);
1065  void dirRATIONAL(unsigned short tag, slen_t count, slen_t const*val);
1066  void dirUNDEFINED(unsigned short tag, slen_t count, char const*val);
1067  void dirUNDEFINED(unsigned short tag, slen_t count, char const*val, slen_t count2, char const*val2);
1068  void dirClose();
1069  BEGIN_STATIC_ENUM1(unsigned short)
1070  EXTRASAMPLE_ASSOCALPHA=1, /* !associated alpha data */
1071  EXTRASAMPLE_UNASSALPHA=2 /* !unassociated alpha data */
1073  BEGIN_STATIC_ENUM1(unsigned short)
1074  COMPRESSION_NONE =1, /* dump mode */
1075  COMPRESSION_CCITTRLE =2, /* CCITT modified Huffman RLE; unused in sam2p */
1076  COMPRESSION_CCITTFAX3=3, /* CCITT Group 3 fax encoding */
1077  COMPRESSION_CCITTFAX4=4, /* CCITT Group 4 fax encoding */
1078  COMPRESSION_LZW =5, /* Lempel-Ziv & Welch */
1079  COMPRESSION_OJPEG =6, /* !6.0 JPEG; obsolete, unused in sam2p */
1080  COMPRESSION_JPEG =7, /* %JPEG DCT compression */
1081  COMPRESSION_CCITTRLEW=32771,/* #1 w/ word alignment; unused in sam2p */
1082  COMPRESSION_PACKBITS =32773,/* Macintosh RLE */
1083  COMPRESSION_DEFLATE =32946 /* Deflate compression */
1085  BEGIN_STATIC_ENUM1(unsigned short)
1090  PHOTOMETRIC_SEPARATED=5, /* possibly CMYK */
1093  BEGIN_STATIC_ENUM1(unsigned short)
1099  BEGIN_STATIC_ENUM1(unsigned short)
1118  InkSet=332,
1124 };
1125 
1126 TIFFPrinter::TIFFPrinter(GenBuffer::Writable &out_, bool le_) :out(out_), le(le_) {
1127  /* Directory now at unknown offset (will be set by .dirClose()) */
1128  s.vi_write(le_ ? "II*\0\0\0\0\0" : "MM\0*\0\0\0\0", 8);
1129  dir.vi_write("\0",2); /* initial number of directory entries */
1130 }
1131 
1132 void TIFFPrinter::aSHORT(SimBuffer::B &s, unsigned count, unsigned short const*val) {
1133  if (le) while (count--!=0) { s << (char)(*val) << (char)(*val>>8); val++; }
1134  else while (count--!=0) { s << (char)(*val>>8) << (char)(*val); val++; }
1135 }
1136 void TIFFPrinter::aLONG (SimBuffer::B &s, unsigned count, slen_t const*val) {
1137  /* Imp: is vi_write(..., 4); faster ? */
1138  if (le) while (count--!=0) { s << (char)(*val) << (char)(*val>>8) << (char)(*val>>16) << (char)(*val>>24); val++; }
1139  else while (count--!=0) { s << (char)(*val>>24) << (char)(*val>>16) << (char)(*val>>8) << (char)(*val); val++; }
1140 }
1141 
1142 void TIFFPrinter::dirSHORT(unsigned short const tag, slen_t const count, unsigned short const*val) {
1143  slen_t offs;
1144  aSHORT(dir, 1U, &tag);
1145  dir.vi_write(&("\0\3"[le?1:0]), 2);
1146  aLONG(dir, 1U, &count);
1147  switch (count) {
1148  case 0: dir.vi_write("\0\0\0", 4); break;
1149  case 1: aSHORT(dir, 1, val); dir.vi_write("\0", 2); break;
1150  case 2: aSHORT(dir, 2, val); break;
1151  default:offs=s.getLength(); aSHORT(s, count, val); aLONG(dir, 1, &offs);
1152  }
1153 }
1154 void TIFFPrinter::dirLONG(unsigned short const tag, slen_t const count, slen_t const*val) {
1155  slen_t offs;
1156  aSHORT(dir, 1U, &tag);
1157  dir.vi_write(&("\0\4"[le?1:0]), 2);
1158  aLONG(dir, 1U, &count);
1159  switch (count) {
1160  case 0: dir.vi_write("\0\0\0", 4); break;
1161  case 1: aLONG(dir, 1, val); break;
1162  default:offs=s.getLength(); aLONG(s, count, val); aLONG(dir, 1, &offs);
1163  }
1164 }
1165 void TIFFPrinter::dirRATIONAL(unsigned short tag, slen_t count, slen_t const*val) {
1166  slen_t offs;
1167  aSHORT(dir, 1U, &tag);
1168  dir.vi_write(&("\0\5"[le?1:0]), 2);
1169  aLONG(dir, 1U, &count);
1170  switch (count) {
1171  case 0: dir.vi_write("\0\0\0", 4); break;
1172  default:offs=s.getLength(); aLONG(s, count*2, val); aLONG(dir, 1, &offs);
1173  }
1174 }
1175 void TIFFPrinter::dirUNDEFINED(unsigned short tag, slen_t count, char const*val) {
1176  slen_t offs;
1177  aSHORT(dir, 1U, &tag);
1178  dir.vi_write(&("\0\7"[le?1:0]), 2);
1179  aLONG(dir, 1U, &count);
1180  if (count<=4) {
1181  dir.vi_write(val, count);
1182  if (count!=4) dir.vi_write("\0\0\0", 4-count);
1183  } else {
1184  offs=s.getLength(); s.vi_write(val, count); aLONG(dir, 1, &offs);
1185  }
1186 }
1187 void TIFFPrinter::dirUNDEFINED(unsigned short tag, slen_t count, char const*val, slen_t count2, char const*val2) {
1188  slen_t offs, countx=count+count2;
1189  aSHORT(dir, 1U, &tag);
1190  dir.vi_write(&("\0\7"[le?1:0]), 2);
1191  aLONG(dir, 1U, &countx);
1192  if (countx<=4) {
1193  dir.vi_write(val, count);
1194  dir.vi_write(val2, count2);
1195  if (countx!=4) dir.vi_write("\0\0\0", 4-countx);
1196  } else {
1197  offs=s.getLength();
1198  s.vi_write(val, count);
1199  s.vi_write(val2, count2);
1200  aLONG(dir, 1, &offs);
1201  }
1202 }
1203 void TIFFPrinter::dirSL(unsigned short tag, slen_t val) {
1204  unsigned short sh;
1205  if (val<1<<16U) { sh=val; dirSHORT(tag, 1, &sh); }
1206  else dirLONG(tag, 1, &val);
1207 }
1208 void TIFFPrinter::dirLONG(unsigned short tag, slen_t val) {
1209  dirLONG(tag, 1, &val);
1210 }
1212  char *ss=s.begin_();
1213  slen_t len=s.getLength();
1214  if (le) { ss[4]=len; ss[5]=len>>8; ss[6]=len>>16; ss[7]=len>>24; }
1215  else { ss[4]=len>>24; ss[5]=len>>16; ss[6]=len>>8; ss[7]=len; }
1216  /* ^^^ dir offset: end of file */
1217  out.vi_write(ss, len);
1218  assert(dir.getLength()%12==2);
1219  unsigned dirc=(dir.getLength()-2)/12;
1220  ss=dir.begin_();
1221  if (le) { ss[0]=dirc; ss[1]=dirc>>8; }
1222  else { ss[0]=dirc>>8; ss[1]=dirc; }
1223  out.vi_write(dir(), dir.getLength());
1224  out.vi_write("", 0);
1225 }
1226 
1227 /* tiffjai --- Sun Jun 2 22:25:16 CEST 2002 */
1228 
1230  Rule::Cache *cache=&or_->cache;
1231  if (cache->FileFormat!=cache->FF_TIFF
1232  || cache->Compression!=Rule::Cache::CO_JAI
1233  ) return Rule::Applier::DONT_KNOW;
1234  bool badp=false;
1235  if (cache->SampleFormat!=Image::SF_Asis) {
1236  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF /Compression/JAI requires /SampleFormat/Asis" << (Error*)0;
1237  badp=true;
1238  }
1239  if (!cache->isBinSB()) {
1240  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF /TransferEncoding/Binary|/?SBFirst" << (Error*)0;
1241  badp=true;
1242  }
1243  if (cache->hasPredictor()) {
1244  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF /Compression/JAI requires /Prediror 1" << (Error*)0;
1245  badp=true;
1246  }
1247  if (badp) return Rule::Applier::BAD;
1248  return Rule::Applier::OK;
1249 }
1252  Image::Sampled *img=sf->getImg();
1253  unsigned char cs=img->getCs(); /* color space */
1255  /* Dat: CS_YCCK is supported by JPEG, but unsupported by TIFF-JPEG */
1256  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF /Compression/JAI doesn't support this color space" << (Error*)0;
1257  return Rule::Applier::BAD;
1258  }
1259  /* Imp: test all CMYK TIFF tags */
1260  /* Imp: test with RGB and CMYK images */
1262  /* ^^^ Dat: Binary defaults to MSBfirst, beacuse QuarkXPress 3 can read only
1263  * MSBfirst TIFF files.
1264  */
1265  char const *databeg=img->getHeadp()+img->getXoffs();
1266  assert(databeg[-2]=='\xFF' && databeg[-1]=='\xC0');
1267  slen_t datalen=img->getRowbeg()-databeg;
1268  // printf("LEN=%u gl=%u datalen=%u\n", img->end_()-img->begin_(), img->getLength(), datalen);
1269  tp.getS().vi_write("\xFF\xD8\xFF\xC0", 4); /* fake-SOI SOF0 */
1270  tp.getS().vi_write(databeg, datalen); /* DataPart */
1271  // tp.getS().vi_write("\xFF\xD9", 2); /* fake-EOI */
1272  /* ^^^ there must be an EOI already */
1273 
1274  unsigned phot=0; bool inks=false, refe=false;
1275  switch (cs) {
1276  case Image::Sampled::CS_GRAYSCALE: phot=tp.PHOTOMETRIC_MINISBLACK; break;
1277  case Image::Sampled::CS_RGB: phot=tp.PHOTOMETRIC_RGB; break;
1278  case Image::Sampled::CS_YCbCr: phot=tp.PHOTOMETRIC_YCBCR; refe=true; break; /* preferred to RGB */
1279  case Image::Sampled::CS_CMYK: phot=tp.PHOTOMETRIC_SEPARATED; inks=true; break; /* preferred to RGB */
1280  default: Error::sev(Error::EERROR) << "TIFF6-JAI: color space " << (unsigned)cs << " not supported in TIFF-JPEG" << (Error*)0;
1281  }
1282 
1283  /* Dat: TIFF tags must appear in increasing numerical order */
1284  tp.dirSL(tp.ImageWidth, img->getWd());
1285  tp.dirSL(tp.ImageLength, img->getHt());
1286  unsigned short eights[]={8,8,8,8};
1287  tp.dirSHORT(tp.BitsPerSample, img->cs2cpp[cs], eights);
1288  tp.dirSL(tp.Compression, tp.COMPRESSION_JPEG); /* SHORT */
1289  tp.dirSL(tp.Photometric, phot); /* SHORT */
1290  tp.dirLONG(tp.StripOffsets, 8);
1291  tp.dirSL(tp.SamplesPerPixel, img->cs2cpp[cs]); /* SHORT */
1292  tp.dirSL(tp.RowsPerStrip, img->getHt());
1293  tp.dirLONG(tp.StripByteCounts, datalen+6);
1294  slen_t rats[]={1,1, 0,1, 255,1, 128,1, 255,1, 128,1, 255,1};
1295  tp.dirRATIONAL(tp.XResolution, 1, rats);
1296  tp.dirRATIONAL(tp.YResolution, 1, rats);
1297  tp.dirSL(tp.PlanarConfig, 1); /* SHORT, PLANARCONFIG_CONTIG */
1298  tp.dirSL(tp.ResolutionUnit, 1); /* SHORT */
1299  if (inks) tp.dirSL(tp.InkSet, 1); /* SHORT */
1300  tp.dirUNDEFINED(tp.JPEGTables, databeg-img->getHeadp()-2, img->getHeadp(), 2, "\xFF\xD9");
1301  const unsigned char hvs=img->end_()[-1];
1302  if (hvs!=0x22 && cs==Image::Sampled::CS_YCbCr) {
1303  // printf("hvs=0x%02X\n", hvs);
1304  const unsigned short horiz_vert[2]={ (unsigned short)((hvs+0U)>>4),
1305  (unsigned short)(hvs&15U) };
1306  tp.dirSHORT(tp.YCbCrSubsampling, 2, horiz_vert);
1307  }
1308  if (refe) tp.dirRATIONAL(tp.ReferenceBlackWhite, 6, rats+2);
1309  tp.dirClose();
1310  #if 0
1311  { Files::FILEW f(fopen("t.hea","wb"));
1312  f.vi_write(img->getHeadp(), databeg-img->getHeadp()-2); /* HeadPart */
1313  f.vi_write("\xFF\xD9", 2);
1314  f.close();
1315  }
1316  { Files::FILEW f(fopen("t.dat","wb"));
1317  f.vi_write("\xFF\xD8\xFF\xC0", 4); /* fake-SOI SOF0 */
1318  f.vi_write(databeg, datalen); /* DataPart */
1319  f.close();
1320  }
1321  #endif
1322  // out.vi_write(img->getHeadp(), img->getRowbeg()-img->getHeadp()); /* HeadPart */
1323  // out.vi_write(img->getRowbeg(), img->end_()-img->getRowbeg()); /* DataPart */
1324  return Rule::Applier::OK;
1325  /* SUXX: see compatibility notes in FAQ (README) */
1326 }
1327 
1329 
1330 /* tiff --- Tue Jun 4 16:23:48 CEST 2002 */
1331 
1332 /** by pts@fazekas.hu at Tue Jun 11 16:56:53 CEST 2002
1333  * Reads a JPEG Baseline (SOF0) stream on input, and drops everything before
1334  * the first SOF0 marker. Then writes an SOI marker, the SOF0 marker, and
1335  * everything after the SOI marker. The last two bytes read must be an
1336  * EOI marker (/\xFF\xD9/). The first thing to be read must be a SOI marker
1337  * (/\xFF+\xD8/). The getJPEGTables() method can be used to retrieve the
1338  * data read before the SOF0 marker. An SOS marker must be read after SOF0.
1339  * Also retains some information (hvsamples[0]) from the SOF0 marker.
1340  * Suitable for reading the output of cjpeg and Ghostscript /FlateEncode.
1341  * This encoder would be much harder if we were not allowed to read the
1342  * JPEG stream into memory.
1343  */
1344 class JPEGSOF0Encode: public PSEncoder {
1345  public:
1346  /** @param maxcpl_: maximum # hex digits per line, should be even */
1348  virtual void vi_write(char const*buf, slen_t len);
1349  SimBuffer::Flat const& getJPEGTables() const { return buf; }
1350  unsigned char getColorSpace() const { return gi.colorspace; }
1351  unsigned char getHVS() const { return gi.hvs; }
1352  protected:
1355  struct jai_gfxinfo gi;
1356 };
1357 
1359 void JPEGSOF0Encode::vi_write(char const*bufr, slen_t len) {
1360  if (len==0) {
1361  { Filter::FlatD flatd(buf(), buf.getLength());
1362  jai_parse_jpeg(&gi, &flatd);
1363  }
1364  slen_t len=buf.getLength();
1365  if (gi.bad==0 && (len<4 || buf[len-2]!='\xFF' || buf[len-1]!='\xD9')) gi.bad=10;
1366  if (gi.bad!=0)
1367  Error::sev(Error::EERROR) << "JPEGS0F0: invalid JPEG stream: " << jai_errors[gi.bad] << (Error*)0;
1368  out.vi_write("\xFF\xD8", 2); /* extra SOI */
1369  out.vi_write(buf()+gi.SOF_offs-2, len-gi.SOF_offs+2); /* SOF0 and followers */
1370  out.vi_write(0,0);
1371  assert(buf[gi.SOF_offs-2]=='\xFF'); /* BUGFIX at 2002.12.02 */
1372  buf[gi.SOF_offs-1]='\xD9'; /* extra EOI */
1373  buf.keepLeft(gi.SOF_offs); /* keep only headers */
1374  } else buf.vi_write(bufr, len);
1375 }
1376 
1377 
1379  Rule::Cache *cache=&or_->cache;
1380  if (cache->FileFormat!=cache->FF_TIFF
1381  || cache->Compression==Rule::Cache::CO_JAI
1382  ) return Rule::Applier::DONT_KNOW;
1383  bool badp=false;
1384  /* Dat: acroread TIFF predictor2 OK. (examples/fishg_lzw2_pdf.job) */
1385  /* Dat: /ZIP with /Predictor OK */
1386  if (cache->Predictor!=cache->PR_None) {
1387  if (cache->Predictor!=cache->PR_TIFF2) {
1388  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF requires /Predictor 1|2" << (Error*)0;
1389  badp=true;
1390  }
1391  if (cache->Compression!=Rule::Cache::CO_ZIP && cache->Compression!=Rule::Cache::CO_LZW) {
1392  Error::sev(Error::WARNING_DEFER) << "check_rule: real /Predictor requires /ZIP or /LZW" << (Error*)0;
1393  badp=true;
1394  }
1395  }
1396  #if !HAVE_LZW
1397  if (cache->Compression==Rule::Cache::CO_LZW) {
1398  Error::sev(Error::WARNING_DEFER) << "check_rule: `configure --enable-lzw' for /Compression/LZW with /FileFormat/TIFF" << (Error*)0;
1399  badp=true;
1400  }
1401  #endif
1402  if (cache->Compression==Rule::Cache::CO_Fax && !cache->isOneBit()) {
1403  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF /Compression/Fax requires a 1-bit /SampleFormat" << (Error*)0;
1404  badp=true;
1405  }
1406  if (!cache->isGray() && !cache->isTransparentM() && !cache->isIndexed() && !cache->isRGB()) {
1407  /* Dat: unsupported SampleFormats: /Opaque, /Transparent and /Asis. */
1408  Error::sev(Error::WARNING_DEFER) << "check_rule: unsupported /SampleFormat for /FileFormat/TIFF" << (Error*)0;
1409  badp=true;
1410  }
1411  if (!cache->isBinSB()) {
1412  Error::sev(Error::WARNING_DEFER) << "check_rule: /FileFormat/TIFF requires /TransferEncoding/Binary|/?SBFirst" << (Error*)0;
1413  badp=true;
1414  }
1415  if (cache->isDCTE() && cache->SampleFormat!=Image::SF_Rgb8 && cache->SampleFormat!=Image::SF_Gray8 && cache->SampleFormat!=Image::SF_Indexed8) {
1416  Error::sev(Error::WARNING_DEFER) << "check_rule: /DCTEncode requires /Rgb8 or /Gray8 (or /Indexed8)" << (Error*)0;
1417  badp=true;
1418  }
1419  if (!badp && cache->isTransparentM()) {
1420  cache->origSampleFormat=cache->SampleFormat;
1421  cache->SampleFormat=Image::SF_Transparent8;
1422  }
1424  /* ^^^ Dat: 0+: pacify g++-3.1 */
1425 }
1426 
1428  Rule::Cache *cache=&or_->cache;
1429  Image::sf_t origSampleFormat=cache->origSampleFormat;
1431 
1432  assert(!sf->hasTranspp() || cache->isTransparentM());
1433  /** Alpha channel or null. */
1435  if (cache->isTransparentM()) {
1436  // fprintf(stderr,"sf=%u osf=%u\n", cache->SampleFormat, origSampleFormat);
1437  alpha=PTS_dynamic_cast(Image::Indexed*,sf->getImg())->calcAlpha();
1438  PTS_dynamic_cast(Image::Indexed*,sf->getImg())->getClearTransp();
1439  assert((alpha!=NULLP) == (sf->hasTranspp()==true));
1440  sf->clearTransp();
1444  unsigned char minbpc=sf->minRGBBpcc();
1445  // fprintf(stderr,"minbpc=%u\n",minbpc);
1446  if (minbpc<8 && origSampleFormat==Image::SF_Transparent8) minbpc=8;
1447  else if (minbpc<4 && origSampleFormat==Image::SF_Transparent4) minbpc=4;
1448  else if (minbpc<2 && origSampleFormat==Image::SF_Transparent2) minbpc=2;
1449  // fprintf(stderr,"minbpc=%u\n",minbpc);
1450  // cacheHints.EncoderBPL=(slen_t)img->getWd()*img->getCpp()*img->getBpc();
1451  /* ^^^ Dat: doSampleFormat will do it correctly */
1452  // assert(saf!=Image::SF_max);
1453  cache->SampleFormat=(alpha==NULLP ? indexedtab : sf->minGrayBpcc()==0 ? rgbtab : graytab)[minbpc];
1454  }
1455 
1456  or_->doSampleFormat(sf); /* No separations */
1457  Image::Sampled *img=sf->getImg(); /* call this _after_ doSampleFormat()! */
1458 
1460  /* ^^^ Dat: Binary defaults to MSBfirst, beacuse QuarkXPress 3 can read only
1461  * MSBfirst TIFF files.
1462  */
1463  unsigned phot= cache->isRGB() ? 0+tp.PHOTOMETRIC_RGB
1464  // : cache->SampleFormat==Image::SF_Mask ? tp.PHOTOMETRIC_MASK
1465  : cache->isGray() ? 0+tp.PHOTOMETRIC_MINISBLACK
1466  // : cache->isIndexed() ? tp.PHOTOMETRIC_PALETTE
1467  : 0+tp.PHOTOMETRIC_PALETTE /* /Indexed*, /Mask, /Transparent+ */;
1468  unsigned compr=tp.COMPRESSION_NONE;
1469 
1470  Filter::VerbatimCountE vc(tp.getS());
1471  GenBuffer::Writable *cp=&vc;
1473  // Dat: g++-3.4: Rule::Cache::CO_None: `cache cannot appear in a constant expression'
1474  switch (cache->Compression) {
1475  case Rule::Cache::CO_None: break;
1476  case Rule::Cache::CO_ZIP: compr=tp.COMPRESSION_DEFLATE; cp=PSEncoder::newFlateEncode(*cp, or_->cacheHints.Effort); break;
1477  case Rule::Cache::CO_LZW: compr=tp.COMPRESSION_LZW; cp=PSEncoder::newLZWEncode(*cp); break;
1478  /* vvv Dat: RunLengthEncode EOD (char 128) is OK and ignored in TIFF PackBits streams */
1479  case Rule::Cache::CO_RLE: compr=tp.COMPRESSION_PACKBITS; cp=PSEncoder::newRunLengthEncode(*cp, or_->cacheHints.RecordSize); break;
1480  case Rule::Cache::CO_Fax:
1481  if (or_->cacheHints.K<0) compr=tp.COMPRESSION_CCITTFAX4;
1482  else if (or_->cacheHints.K==0) compr=tp.COMPRESSION_CCITTFAX3;
1483  else { compr=tp.COMPRESSION_CCITTFAX3; or_->cacheHints.K=img->getHt(); }
1484  cp=PSEncoder::newCCITTFaxEncode(*cp, or_->cacheHints.K, or_->cacheHints.EncoderBPL, /*EndOfLine:*/ compr==tp.COMPRESSION_CCITTFAX3, /*BlackIs1: !*/ true);
1485  /* Dat: libtiff enforces EndOfLine==(compr==tp.COMPRESSION_CCITTFAX3) */
1486  break;
1487  case Rule::Cache::CO_IJG:
1488  compr=tp.COMPRESSION_JPEG;
1489  jp=new JPEGSOF0Encode(vc);
1491  break;
1492  case Rule::Cache::CO_DCT: compr=tp.COMPRESSION_JPEG; {
1493  SimBuffer::B other_parameters;
1494  or_->cacheHints.DCT->dump(other_parameters, 0, false);
1495  jp=new JPEGSOF0Encode(vc);
1497  break; }
1498  default: assert(0);
1499  }
1500 
1503 
1504  slen_t rlenht=img->getRlen()*img->getHt();
1505  Image::Sampled::dimen_t wd=img->getWd();
1506  if (rlenht!=0) {
1507  /* Dat: TIFF inserts extra sample bits... */
1508  /* TIFF images with transparency are really inefficient. That's because
1509  * libtiff doesn't read or write an indexed image with transparency:
1510  * Sorry, can not handle contiguous data with PhotometricInterpretation=3,
1511  * and Samples/pixel=2.
1512  * So Indexed images are converted to RGB* or Gray* first, and then the
1513  * alpha channel is added. The result is a big and inefficiently
1514  * compressible TIFF file.
1515  */
1516 
1517  if (alpha!=NULLP) {
1518  unsigned char bpc=img->getBpc();
1519  slen_t rlen=img->getRlen();
1520  slen_t writelen;
1521  char *buf=(char*)NULLP;
1522  char const*psave=img->getRowbeg(), *p, *ppend=psave+rlenht;
1523  char const*r=alpha->getRowbeg();
1524 #ifndef NDEBUG
1525  char const*rend;
1526  Image::Sampled::dimen_t rlena=(wd+7)>>3;
1527 #endif
1528  char *t;
1529  register unsigned u;
1530 #ifndef NDEBUG
1531  assert(rlena==alpha->getRlen());
1532 #endif
1533  // printf("SF=%u\n", cache->SampleFormat);
1534  if (cache->isGray()) {
1535  /* works at Mon Dec 9 01:25:59 CET 2002 */
1536  static unsigned char const szor1[16]={2*0,2*1,2*4,2*5,2*16,2*17,2*20,2*21,2*64,2*65,2*68,2*69,2*80,2*81,2*84,2*85};
1537  static unsigned char const szor2[16]={85,84,81,80,69,68,65,64,21,20,17,16,5,4,1,0};
1538  // static unsigned char const szor2[8]={0,1,16,17,64,65,80,81};
1539  buf=new char[(writelen=((slen_t)wd*bpc+3)>>2)+24];
1540 #ifndef NDEBUG
1541  assert(rlena*8>=rlen);
1542 #endif
1543  while (psave!=ppend) {
1544  t=buf;
1545 #ifndef NDEBUG
1546  rend=r+rlena;
1547 #endif
1548  p=psave; psave+=rlen;
1549  assert(psave<=ppend);
1550  u=(1<<16);
1551  switch (bpc) {
1552  case 8:
1553  while (p!=psave) {
1554  /* Dat: works at Tue Sep 10 22:45:52 CEST 2002 */
1555  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1556  *t++=*p++; *t++=-(0==(u&128));
1557  u<<=1;
1558  } break;
1559  case 4:
1560  while (p!=psave) {
1561  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1562  *t++=(p[0]&0xF0)|(0==(u&128)?15:0);
1563  *t++=((p[0]&0xF)<<4)|(0==(u&64)?15:0);
1564  p++; u<<=2;
1565  } break;
1566  case 2:
1567  while (p!=psave) {
1568  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1569  *t++=(p[0]&0xC0 )|((u&128)!=0?0:48)|((p[0]&0x30)>>2)|((u&64)!=0?0:3);
1570  *t++=((p[0]&0xC)<<4)|((u& 32)!=0?0:48)|((p[0]&0x3 )<<2)|((u&16)!=0?0:3);
1571  p++; u<<=4;
1572  } break;
1573  case 1:
1574  while (p!=psave) {
1575  u=*(unsigned char const*)r++;
1576  *t++=szor1[*(unsigned char const*)p>>4]|szor2[u>>4];
1577  *t++=szor1[*(unsigned char const*)p&15]|szor2[u&15];
1578  p++;
1579  } break;
1580  } /* SWITCH Gray bpc */
1581  // assert(p-psave+0U==rlena*8U);
1582  assert(p>=psave);
1583  pp->vi_write(buf, writelen);
1584  }
1585  } else {
1586  /* works at Sun Dec 8 23:30:17 CET 2002 */
1587  assert(cache->isRGB());
1588  buf=new char[(writelen=((slen_t)wd*bpc+1)>>1)+24];
1589  while (psave!=ppend) {
1590  t=buf;
1591  p=psave; psave+=rlen;
1592  assert(psave<=ppend);
1593  u=(1<<16);
1594 #ifndef NDEBUG
1595  rend=r+rlena; /* superfluous */
1596 #endif
1597  switch (bpc) {
1598  case 8:
1599  while (p<psave) {
1600  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1601  *t++=*p++;
1602  *t++=*p++;
1603  *t++=*p++;
1604  *t++=-(0==(u&128));
1605  u<<=1;
1606  } break;
1607  case 4:
1608  while (p<psave) {
1609  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1610  *t++=p[0]; /* R0 and G0 */
1611  *t++=(p[1]&0xF0)|((u&128)!=0?0:15); /* B0 and A0 */
1612  *t++=(p[1]<<4)|((p[2]>>4)&15); /* R1 and G1 */
1613  *t++=(p[2]<<4)|((u&64)!=0?0:15); /* B1 and A1 */
1614  p+=3; u<<=2;
1615  } break;
1616  case 2:
1617  while (p<psave) {
1618  if (0!=(u&(1<<16))) u=*(unsigned char const*)r++|(1<<8);
1619  /* Dat: p[0]==R0G0B0R1 p[1]==G1B1R2G2 p[2]==B2R3G3B3 */
1620  *t++=(p[0]&0xFC)|((u&128)!=0?0:3); /* R0G0B0 and A0 */
1621  *t++=(p[0]<<6)|((p[1]>>2)&0x3C)|((u&64)!=0?0:3); /* R1 G1B1 A1 */
1622  *t++=(p[1]<<4)|((p[2]>>4)&0x0C)|((u&32)!=0?0:3); /* R2G1 B1 A2 */
1623  *t++=(p[2]<<2)|((u&16)!=0?0:3); /* R3G3B3 and A3 */
1624  p+=3; u<<=4;
1625  } break;
1626  default: // case 1:
1627  while (p<psave) {
1628  u=*(unsigned char const*)r++;
1629  /* Dat: p[0]==RGBRGBRG p[1]==BRGBRGBR p[2]==GBRGBRGB */
1630  *t++=(p[0]&0xE0)|((u&128)!=0?0:16)
1631  |((p[0]>>1)&0xE)|((u&64)!=0?0:1);
1632  *t++=(p[0]<<6)|((p[1]>>2)&0x80)|((u&32)!=0?0:16)
1633  |((p[1]>>3)&0xE)|((u&16)!=0?0:1);
1634  *t++=((p[1]<<4)&0xE0)|((u&8)!=0?0:16)
1635  |((p[1]<<3)&0x7)|((p[2]>>5)&0x06)|((u&4)!=0?0:1);
1636  *t++=((p[2]<<2)&0xE0)|((u&2)!=0?0:16)
1637  |((p[2]<<1)&0x0E)|((u&1)!=0?0:1);
1638  p+=3;
1639  }
1640  break;
1641  } /* SWITCH RGB bpc */
1642 #ifndef NDEBUG
1643  assert(r==rend); // r=rend;
1644 #endif
1645  pp->vi_write(buf, writelen);
1646  }
1647  }
1648  delete [] buf;
1649  } else pp->vi_write(img->getRowbeg(), rlenht);
1650  }
1651  pp->vi_write(0,0); /* flush all */
1652  if (pp!=cp) delete pp;
1653  if (cp!=&vc) delete cp;
1654 
1655  bool refe=false;
1656  if (compr==tp.COMPRESSION_JPEG) switch (jp->getColorSpace()) {
1658  assert(phot==tp.PHOTOMETRIC_MINISBLACK || phot==tp.PHOTOMETRIC_PALETTE);
1659  /* Dat: we don't change `phot' here, so JPEG compression can be applied
1660  * to the palette indexes of indexed images :-)
1661  */
1662  break;
1663  case Image::Sampled::CS_RGB: phot=tp.PHOTOMETRIC_RGB; break;
1664  case Image::Sampled::CS_YCbCr: phot=tp.PHOTOMETRIC_YCBCR; refe=true; break; /* preferred to RGB */
1665  // case Image::Sampled::CS_CMYK: phot=tp.PHOTOMETRIC_SEPARATED; inks=true; break; /* preferred to RGB */
1666  default: Error::sev(Error::EERROR) << "TIFF6: color space " << (unsigned)jp->getColorSpace() << " not supported in TIFF-JPEG" << (Error*)0;
1667  }
1668 
1669  /* Dat: TIFF tags must appear in increasing numerical order */
1670  tp.dirSL(tp.ImageWidth, wd);
1671 // tp.dirSL(tp.ImageWidth, img->getWd()/2);
1672  tp.dirSL(tp.ImageLength, img->getHt());
1673  unsigned short s4[]={img->getBpc(),img->getBpc(),img->getBpc(),img->getBpc()};
1674  /* ^^^ these values may be different according to the TIFF6 spec, but
1675  * libtiff can read TIFF files only with same BitsPerSamples.
1676  */
1677  unsigned sppa=img->getCpp()+(alpha!=NULLP ? 1:0);
1678  tp.dirSHORT(tp.BitsPerSample, sppa, s4);
1679  tp.dirSL(tp.Compression, compr); /* SHORT */
1680  tp.dirSL(tp.Photometric, phot); /* SHORT */
1681  if (cache->Compression==Rule::Cache::CO_Fax) tp.dirSL(tp.FillOrder, 1); /* byte abcdefgh is (a<<7)+...+h */
1682  tp.dirLONG(tp.StripOffsets, 8);
1683  if (!cache->isIndexed())
1684  tp.dirSL(tp.SamplesPerPixel, sppa); /* SHORT */
1685 // tp.dirSL(tp.SamplesPerPixel, 2); /* SHORT */
1686  tp.dirSL(tp.RowsPerStrip, img->getHt());
1687  tp.dirLONG(tp.StripByteCounts, vc.getCount());
1688  slen_t rats[]={1,1, 0,1, 255,1, 128,1, 255,1, 128,1, 255,1};
1689  tp.dirRATIONAL(tp.XResolution, 1, rats);
1690  tp.dirRATIONAL(tp.YResolution, 1, rats);
1691  tp.dirSL(tp.PlanarConfig, 1); /* SHORT, PLANARCONFIG_CONTIG */
1692  if (compr==tp.COMPRESSION_CCITTFAX3) tp.dirLONG(tp.Group3Options, (tp.GROUP3OPT_UNCOMPRESSED)|(or_->cacheHints.K!=0?tp.GROUP3OPT_2DENCODING:0));
1693  if (compr==tp.COMPRESSION_CCITTFAX4) tp.dirLONG(tp.Group4Options, tp.GROUP4OPT_UNCOMPRESSED);
1694  tp.dirSL(tp.ResolutionUnit, 1); /* SHORT */
1695  if (cache->Predictor!=cache->PR_None) {
1696  tp.dirSL(tp.Predictor, cache->Predictor); /* 1|2 */
1697  if (img->getBpc()!=8)
1698  Error::sev(Error::WARNING) << "TIFF6: libtiff supports /Predictor only with bpc=8 and bpc=16" << (Error*)0;
1699  }
1700 
1701  if (cache->isIndexed() || cache->isTransparentM()) {
1702  unsigned colorlen=(1<<img->getBpc()), i=0;
1703  unsigned short *r=new unsigned short[3*colorlen], *g=r+colorlen, *b=g+colorlen;
1704  memset(r, '\0', 3*colorlen);
1705  /** Image palette data */
1706  char const *p=img->getHeadp(), *pend=img->getRowbeg();
1707  assert((pend-p)%3==0);
1708  assert(3*colorlen>=(unsigned)(pend-p));
1709  while (p<pend) {
1710  r[i ]=*(unsigned char const*)p++*257;
1711  g[i ]=*(unsigned char const*)p++*257;
1712  b[i++]=*(unsigned char const*)p++*257;
1713  }
1714  /* ^^^ In a TIFF palette (ColorMap) 0 is black, 65535 is lightest */
1715  tp.dirSHORT(tp.ColorMap, colorlen*3, r);
1716  delete [] r;
1717  }
1718  if (alpha!=NULLP) {
1719  /* vvv Dat: GIMP 1.0 load fails with tp.EXTRASAMPLE_UNASSALPHA */
1720  tp.dirSL(tp.ExtraSamples, tp.EXTRASAMPLE_ASSOCALPHA); /* SHORT */
1721  delete alpha;
1722  }
1723  /* no tp.InkSet, because no CMYK */
1724 
1725  if (compr==tp.COMPRESSION_JPEG) {
1726  tp.dirUNDEFINED(tp.JPEGTables, jp->getJPEGTables().getLength(), jp->getJPEGTables()() /* , 2, "\xFF\xD9" */);
1727  const unsigned char hvs=jp->getHVS();
1728  if (hvs!=0x22 && phot==tp.PHOTOMETRIC_YCBCR) {
1729  const unsigned short horiz_vert[2]={ (unsigned short)((hvs+0U)>>4),
1730  (unsigned short)(hvs&15U) };
1731  tp.dirSHORT(tp.YCbCrSubsampling, 2, horiz_vert);
1732  }
1733  if (refe) tp.dirRATIONAL(tp.ReferenceBlackWhite, 6, rats+2);
1734  delete jp;
1735  }
1736 
1737  tp.dirClose();
1738  return Rule::Applier::OK;
1739 }
1740 
1742 
1743 
1744 /* --- Sat Apr 20 11:32:42 CEST 2002 -- Sat Apr 20 16:48:25 CEST 2002 */
1745 
1746 #if OBJDEP
1747 # warning REQUIRES: crc32.o
1748 # warning REQUIRES: crc32.o
1749 #endif
1750 /** Encodes 32-bit (data.length-minus), data, crc32. */
1751 class LenCRC32Encode: public PSEncoder {
1752  public:
1753  /** @param maxcpl_: maximum # hex digits per line, should be even */
1754  LenCRC32Encode(GenBuffer::Writable &out_, unsigned minus_);
1755  virtual void vi_write(char const*buf, slen_t len);
1756 
1757  protected:
1759  unsigned minus;
1760  /** The length is not known in advance, so we have to buffer the whole output
1761  * in memory.
1762  */
1764 };
1765 
1766 LenCRC32Encode::LenCRC32Encode(GenBuffer::Writable &out_, unsigned minus_): out(out_), minus(minus_), sofar("1234") {}
1768  if (len==0) {
1769  char *s=const_cast<char*>(sofar());
1771  unsigned PTS_INT32_T crc=crc32(CRC32_INITIAL, s+4, slen-4);
1772  slen-=minus+4;
1773  s[0]=slen>>24; s[1]=slen>>16; s[2]=slen>>8; s[3]=slen;
1774  s=sofar.vi_mkend(4);
1775  s[0]=crc >>24; s[1]=crc>>16; s[2]=crc>>8; s[3]=crc;
1777  out.vi_write(0,0);
1778  } else sofar.vi_write(buf, len);
1779 }
1780 
1781 /** PNG output (RFC 2083) */
1783  /* Supported PNG types: /Gray1, /Gray2, /Gray4, /Gray8, /Rgb8,
1784  * /Indexed1, /Indexed2, /Indexed4, /Indexed8.
1785  * Unsupported PNG types: /Gray16, /Rgb16, /GrayA8, /GrayA16, /RgbA8,
1786  * /RgbA16.
1787  * /Indexed* supports transparency (via PNG chunk tRNS).
1788  */
1789  Rule::Cache *cache=&or_->cache;
1790  if (cache->FileFormat!=cache->FF_PNG
1791  ) return Rule::Applier::DONT_KNOW;
1792  bool badp=false;
1793  /* Dat: (by policy) we don't support /Transparent or /Opaque here; the
1794  * user should not specify such SampleFormat in the .job file.
1795  */
1796  if (!cache->isGray()
1797  && !cache->isTransparentM()
1798  && !cache->isIndexed()
1799  && cache->SampleFormat!=Image::SF_Rgb8) {
1800  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNG requires /Gray*, /Indexed*, /Mask, /Transparent+ or /Rgb8" << (Error*)0;
1801  badp=true;
1802  }
1803  if (cache->TransferEncoding!=cache->TE_Binary) {
1804  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNG requires /Binary" << (Error*)0;
1805  badp=true;
1806  }
1807  if (cache->Compression!=Rule::Cache::CO_None && cache->Compression!=Rule::Cache::CO_ZIP) {
1808  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNG requires /Compression/None or /ZIP" << (Error*)0;
1809  badp=true;
1810  }
1811  if (cache->Predictor==cache->PR_TIFF2) {
1812  Error::sev(Error::WARNING_DEFER) << "check_rule: /PNG requires /Predictor >=10" << (Error*)0;
1813  badp=true;
1814  }
1815  if (badp) return Rule::Applier::BAD;
1816  /* Now we are sure about Rule::Applier::OK. */
1817  or_->cache.WarningOK=true; /* ?? */
1818  return Rule::Applier::OK;
1819 }
1821  Rule::Cache *cache=&or_->cache;
1822  char tmp[64], colortype; register char*p;
1823  unsigned PTS_INT32_T crc;
1824 
1825  // assert(0);
1827  or_->doSampleFormat(sf);
1828  Image::Sampled *img=sf->getImg();
1829  unsigned char bpc=img->getBpc(); /* set _after_ doSampleFormat */
1830  Image::Sampled::dimen_t wd=img->getWd(), ht=img->getHt();
1831 
1834 
1835  /* Dat: PredictorColumns, PredictorBPC and PredictorColors are forced to
1836  * match the image, because PNG requires it.
1837  */
1839  *cp,
1840  cache->Predictor==cache->PR_None ? cache->PR_PNGNone : cache->Predictor,
1841  bpc, /*or_->cacheHints.PredictorBPC*/
1842  wd, /*or_->cacheHints.PredictorColumns*/
1843  img->getCpp() /*or_->cacheHints.PredictorColors*/
1844  );
1845 
1846  /* Critical PNG chunks (capital 1st letter) and ancillary PNG chunks:
1847  *
1848  * -: zero, 1: exactly one, ?: 0 or 1, *: 0 or more, +: 1 or more
1849  * Name Nr sam2p Ordering constraints
1850  * IHDR 1 1 Must be first
1851  * cHRM ? - Before PLTE and IDAT
1852  * gAMA ? - Before PLTE and IDAT
1853  * sBIT ? - Before PLTE and IDAT
1854  * PLTE ? ? Before IDAT
1855  * hIST ? - After PLTE; before IDAT
1856  * tRNS ? ? After PLTE; before IDAT
1857  * bKGD ? ? After PLTE; before IDAT
1858  * pHYs ? - Before IDAT
1859  * tIME ? - None
1860  * tEXt * - None
1861  * zTXt * - None
1862  * IDAT + 1 After IHDR and PLTE, multiple IDATs must be consecutive
1863  * IEND 1 1 Must be last
1864  */
1865 
1866  /* 0..3: PNG header */
1867  /* 8..11: IHDR chunk length */
1868  /* 12..15: IHDR chunk name */
1869  memcpy(tmp,"\211PNG\r\n\032\n\0\0\0\015IHDR",16); /* ASCII charset is assumed. */
1870  p=tmp+16;
1871  *p++=wd>>24; *p++=wd>>16; *p++=wd>>8; *p++=wd; /* 16: Width */
1872  *p++=ht>>24; *p++=ht>>16; *p++=ht>>8; *p++=ht; /* 20: Height */
1873  *p++=bpc; /* 24: Bit depth */
1874  colortype=*p++=cache->isGray()?0:cache->isRGB()?2:3; /* 25: Color type */
1875  *p++=0; /* 26: Compression method: deflate/32K (forced by PNG spec), overcoming with Effort==0 */
1876  *p++=0; /* 27: Filter type: adaptive filtering with 5 basic PNG filter types */
1877  *p++=0; /* 28: Non-interlaced */
1878  crc=crc32(CRC32_INITIAL, tmp+12, 17);
1879  *p++=crc>>24;*p++=crc>>16;*p++=crc>>8;*p++=crc; /* 29: IHDR CRC */
1880  out.vi_write(tmp, 33);
1881  if (colortype==3) {
1882  bool transp=cache->isTransparentM() && PTS_dynamic_cast(Image::Indexed*,img)->getTransp()>=0;
1883  /* unsigned ncols=PTS_dynamic_cast(Image::Indexed*,img)->getNcols(); */
1884  unsigned ncols3=img->getRowbeg()-img->getHeadp();
1885 
1886  p=tmp;
1887  *p++=0; *p++=0; *p++=ncols3>>8; *p++=ncols3; /* 0: PLTE chunk length */
1888  *p++='P'; *p++='L'; *p++='T'; *p++='E'; /* 4: PLTE chunk name */
1889  out.vi_write(tmp, 8);
1890  if (transp) {
1891  PTS_dynamic_cast(Image::Indexed*,img)->makeTranspZero();
1892  p=img->getHeadp(); p[0]=p[1]=p[2]=(char)0; /* force black backround (for consistency) */
1893  }
1894  out.vi_write(img->getHeadp(), ncols3);
1895  crc=crc32(crc32(CRC32_INITIAL,tmp+4,4), img->getHeadp(), ncols3);
1896  p=tmp; *p++=crc>>24;*p++=crc>>16;*p++=crc>>8;*p++=crc; /* 0: PLTE CRC */
1897  out.vi_write(tmp, 4);
1898  if (transp) {
1899  out.vi_write("\0\0\0\1tRNS\0@\346\330f", 13); /* color 0 is transparent */
1900  //fprintf(stderr, "tRNS: 0x%08lx", (unsigned long)crc32(CRC32_INITIAL,"tRNS\0",5)); /* 0x40e6d866 */
1901  out.vi_write("\0\0\0\1bKGD\0\210\5\35H", 13); /* color 0 is background color */
1902  //out.vi_write("\0\0\0\1bKGD\2\x66\x0b\x7c\x64", 13); /* color 2 is background color */
1903  //fprintf(stderr, "bKGD: 0x%08lx", (unsigned long)crc32(CRC32_INITIAL,"bKGD\2",5)); /* 0x88051d48 */
1904  }
1905  }
1906 
1907  slen_t rlenht=img->getRlen()*img->getHt();
1908  #if 0 /* Calculates _bad_ CRC (before compression etc.) */
1909  p=tmp;
1910  *p++=rlenht>>24; *p++=rlenht>>16; *p++=rlenht>>8; *p++=rlenht; /* 0: IDAT chunk length */
1911  *p++='I'; *p++='D'; *p++='A'; *p++='T'; /* 4: IDAT chunk name */
1912  out.vi_write(tmp, 8);
1913  if (rlenht!=0) pp->vi_write(img->getRowbeg(), rlenht);
1914  pp->vi_write(0,0); /* flush all, write CRC */
1915  crc=crc32(crc32(CRC32_INITIAL,tmp+4,4), img->getRowbeg(), rlenht);
1916  p=tmp; *p++=crc>>24;*p++=crc>>16;*p++=crc>>8;*p++=crc; /* 0: IDAT CRC */
1917  out.vi_write(tmp, 4);
1918  #else
1919  rp->vi_write("IDAT",4);
1920  if (rlenht!=0) pp->vi_write(img->getRowbeg(), rlenht);
1921  pp->vi_write(0,0); /* flush all, write CRC */
1922  #endif
1923 
1924  out.vi_write("\0\0\0\0IEND\256B`\202",12); /* IEND chunk */
1925  delete pp;
1926  delete cp;
1927  delete rp;
1928 
1929  return Rule::Applier::OK;
1930 }
1931 
1933 
1934 /* --- Sat Jun 15 19:30:41 CEST 2002 */
1935 
1936 /** BMP RLE compression, type 1. Seems to be optimal.
1937  * @param dst buffer with enough place for compressed data. The caller must
1938  * pre-allocate >=(send-sbeg)+(send-sbeg+128)*2/255.
1939  * @param sbeg first raw data char to compress
1940  * @param send char to finish compression just before
1941  * @return dst+(number of characters occupied by compressed data)
1942  *
1943  * in-memory implementation Sun Jun 23 20:02:41 CEST 2002
1944  */
1945 
1946 static char *bmp_compress1_row(char *dst, char const *sbeg, char const *send) {
1947  #if 0
1948  # define BMP_ASSERT(x) assert(x)
1949  #else
1950  # define BMP_ASSERT(x)
1951  #endif
1952  #undef BUF
1953  #define BUF(x) (*(x))
1954  #undef PUTCH__
1955  #define PUTCH__(c) (*dst++=(c))
1956  char c, c2;
1957  char const *beg, *end, *rend, *q, *r, *best;
1958  signed bestca, rca; /* both must fit into -255..255 */
1959  slen_t frl, efrl;
1960  int ci;
1961  // bool oddp;
1962 
1963  beg=sbeg;
1964  end=(send-sbeg>255) ? beg+255 : send;
1965 
1966  while (beg!=end) { /* there is still unprocessed data in the buffer */
1967  c=BUF(beg++);
1968  if (beg==end) { PUTCH__(1); PUTCH__(c); break; } /* last char */
1969  if (c==BUF(beg)) { /* sure r chunk */
1970  ci=2; beg++;
1971  rep:
1972  while (beg!=end && c==BUF(beg)) { beg++; ci++; }
1973  PUTCH__(ci); PUTCH__(c); /* r chunk */
1974  } else { /* possible c chunk */
1975  rend=end;
1976  BMP_ASSERT(end-beg<=254);
1977  if (end!=send) { /* read an extra char as the terminator of the last run-length of c, buf:0..254 */
1978  end++;
1979  BMP_ASSERT(end-beg==255); /* buffer is full (255 chars) */
1980  }
1981 
1982  best=r=beg;
1983  bestca=rca=-1; /* best and current advantage of c over r */
1984 
1985  while (r!=rend) { /* c chunk should stop only at run-length boundaries */
1986  BMP_ASSERT(-255<=rca && rca<=255);
1987  BMP_ASSERT(-255<=bestca && bestca<=255);
1988  q=r; r=q+1; ci=1; while (r!=end && BUF(r)==BUF(q)) { r++; ci++; }
1989  if (r==end && end!=rend) break;
1990  if (((r-beg)&1)==0) { /* odd (!) copy length */
1991  rca+=3-ci;
1992  if (rca<=bestca-1) { r--; break; } /* fix-5 (instead of rule-4): `xyz|bbbbb|xyz|', `abcdef|gggggggg|abababababab|', `abcdef|ggg|hhh|ggg|hhh|ggg|hhh|ggg|hhh|abababababab|' */
1993  if (bestca<rca) { bestca=rca; best=r-1; } /* make c as short as possible */
1994  rca--;
1995  } else { /* even copy length */
1996  rca+=2-ci;
1997  if (rca<=bestca-2) break; /* fix-5 (instead of rule-4): `xyz|bbbbb|xyz|', `abcdef|gggggggg|abababababab|', `abcdef|ggg|hhh|ggg|hhh|ggg|hhh|ggg|hhh|abababababab|' */
1998  if (bestca<rca) { bestca=rca; best=r; } /* make c as short as possible */
1999  }
2000  }
2001  BMP_ASSERT(-255<=rca && rca<=255);
2002  BMP_ASSERT(-255<=bestca && bestca<=255);
2003  if (bestca<=0 /* no possible positive advantage */
2004  || best-beg<=1 /* 1: c is one char, plus 1 char in buf. Imp: ==1?! */
2005  ) { ci=1; goto rep; }
2006  r=best; /* Imp: get rid of this assignment */
2007  BMP_ASSERT(beg!=r);
2008  BMP_ASSERT(((r-beg)&1)==1); /* even copy length */
2009 
2010  if (end==r) { /* no followers, last chunk */
2011  /* BMP_ASSERT(had_eof); */
2012  // oddp=(1+(r-beg)&1)==1;
2013  PUTCH__(0);
2014  PUTCH__((r-beg)+1);
2015  PUTCH__(c);
2016  while (beg!=r) { PUTCH__(BUF(beg)); beg++; } /* emit c chunk */
2017  // if (oddp) PUTCH__(0); /* Imp: padding breaks optimality */
2018  } else {
2019  BMP_ASSERT(r!=end);
2020  /* BMP_ASSERT(r!=rend); */ /* r==rend is possible here */
2021  c2=BUF(r); frl=1; q=r+1;
2022  while (q!=end && c2==BUF(q)) { q++; frl++; } /* count follower run length */
2023  efrl=frl; ci=-2; if (q==end) { /* Imp: get rid of -2 (-2 -> -1) */
2024  BMP_ASSERT(q==end);
2025  while ((ci=(q==send)?-1:(unsigned char)*q++)!=-1 && (char)ci==c2) efrl++;
2026  }
2027 
2028  /* printf("clen=%u\n", clen); */
2029  if (1+(r>beg ? r-beg : 256+beg-r)<255 && efrl>=256 && efrl%255==1) { r++; efrl--; } /* make the c chunk one char longer if appropriate */
2030 
2031  // oddp=(1+(r-beg)&1)==1;
2032  PUTCH__(0);
2033  PUTCH__(1+(r-beg));
2034  PUTCH__(c);
2035  while (beg!=r) { PUTCH__(BUF(beg)); beg++; } /* emit c chunk */
2036  // if (oddp) PUTCH__(0); /* Imp: padding breaks optimality */
2037 
2038  beg=q; /* remove beginning of the r chunk from the buffer */
2039  if (ci>=0) { beg--; BMP_ASSERT((unsigned char)BUF(beg)==ci); }
2040 
2041  while (efrl>=255) { PUTCH__('\377'); PUTCH__(c2); efrl-=255; } /* emit full r chunks */
2042  if (efrl>=2) { /* emit last r chunk */
2043  PUTCH__(efrl); PUTCH__(c2);
2044  } else if (efrl!=0) {
2045  BMP_ASSERT(efrl==1);
2046  beg--; /* leave a single instance of c2 in beginning of the buffer */
2047  BMP_ASSERT(BUF(beg)==c2);
2048  }
2049  } /* IF c chunk has followers */
2050  } /* IF r or c chunk */
2051  end=(send-beg>255) ? beg+255 : send;
2052  } /* WHILE main loop */
2053  return dst;
2054  #undef BUF
2055  #undef PUTCH__
2056 }
2057 
2058 
2059 /** Windows Bitmap BMP output */
2061  /* Supported BMP types: /Rgb8,
2062  * /Indexed1, /Indexed4, /Indexed8.
2063  */
2064  Rule::Cache *cache=&or_->cache;
2065  if (cache->FileFormat!=cache->FF_BMP
2066  ) return Rule::Applier::DONT_KNOW;
2067  bool badp=false;
2068  /* Dat: (by policy) we don't support /Transparent or /Opaque here; the
2069  * user should not specify such SampleFormat in the .job file.
2070  */
2071  if (cache->SampleFormat!=Image::SF_Indexed1
2072  /* Dat: /Indexed2 is not supported by /BMP */
2073  && cache->SampleFormat!=Image::SF_Indexed4
2074  && cache->SampleFormat!=Image::SF_Indexed8
2075  && cache->SampleFormat!=Image::SF_Rgb8) {
2076  Error::sev(Error::WARNING_DEFER) << "check_rule: /BMP requires /Indexed1, /Indexed4, /Indexed8 or /Rgb8" << (Error*)0;
2077  badp=true;
2078  }
2079  if (cache->TransferEncoding!=cache->TE_Binary) {
2080  Error::sev(Error::WARNING_DEFER) << "check_rule: /BMP requires /Binary" << (Error*)0;
2081  badp=true;
2082  }
2083  if (cache->Compression!=Rule::Cache::CO_None && cache->Compression!=Rule::Cache::CO_RLE) {
2084  Error::sev(Error::WARNING_DEFER) << "check_rule: /BMP requires /Compression/None or /RLE" << (Error*)0;
2085  badp=true;
2086  }
2087  if (cache->Compression==Rule::Cache::CO_RLE && cache->SampleFormat!=Image::SF_Indexed8) {
2088  /* !! Imp: Implement compr==2 for /Indexed4 */
2089  Error::sev(Error::WARNING_DEFER) << "check_rule: /BMP/RLE requires /Indexed8" << (Error*)0;
2090  badp=true;
2091  }
2092  if (cache->hasPredictor()) {
2093  Error::sev(Error::WARNING_DEFER) << "check_rule: /BMP requires /Predictor 1" << (Error*)0;
2094  badp=true;
2095  }
2096  if (badp) return Rule::Applier::BAD;
2097  /* Now we are sure about Rule::Applier::OK. */
2098  return Rule::Applier::OK;
2099 }
2102  or_->doSampleFormat(sf);
2103  Image::Sampled *img=sf->getImg();
2104  Image::Sampled::dimen_t wd=img->getWd(), ht=img->getHt(), htc=ht;
2105  slen_t rlen=img->getRlen();
2106  char const*pend=img->getRowbeg()+rlen*ht;
2107  char const*palbeg=img->getHeadp(), *palend=img->getRowbeg();
2108  slen_t ncols4=(palend-palbeg)/3*4;
2109  unsigned biCompr=or_->cache.Compression!=or_->cache.CO_RLE ? 0
2110  : or_->cache.SampleFormat==Image::SF_Indexed4 ? 2 : 1;
2111 
2113  slen_t crowsize=2+ rlen+(rlen+128)*2/255; /* !! Imp: real upper bound? */
2114  char *crow=new char[crowsize];
2115  /* !! GIMP compatibility */
2116  if (or_->cache.Compression==or_->cache.CO_RLE) {
2117  /* Imp: bmp_compress2_row */
2118  char *crow2;
2119  while (htc--!=0) { /* BMP stores rows from down */
2120  crow2=bmp_compress1_row(crow, pend-rlen, pend);
2121 #if 0
2122  crow2=crow;
2123  *crow2++=10;
2124  *crow2++=1;
2125  *crow2++=10;
2126  *crow2++=2;
2127  *crow2++=10;
2128  *crow2++=3;
2129  *crow2++=10;
2130  *crow2++=4;
2131  *crow2++=10;
2132  *crow2++=5;
2133  *crow2++=10;
2134  *crow2++=6;
2135 #endif
2136 
2137  assert((slen_t)(crow2-crow)<=crowsize-2);
2138  pend-=rlen;
2139  *crow2++='\0'; *crow2++='\0'; /* signal end of compressed data row */
2140  /* fprintf(stderr, "htc=%u cl=%u\n", htc, crow2-crow); */
2141  data.vi_write(crow, crow2-crow);
2142  }
2143  data.vi_write("\0\1", 2); /* signal end of bitmap */
2144  } else {
2145  unsigned pad=(4-(rlen&3))&3; /* Dat: pad rows to 32 bits */
2146  if (or_->cache.SampleFormat==Image::SF_Rgb8) { /* SWAP RGB values */
2147  /* BUGFIX at Thu Dec 12 21:36:57 CET 2002 */
2148  char *buf=new char[rlen];
2149  while (htc--!=0) { /* BMP stores rows from down */
2150  char const*pxend=pend, *px=pend-=rlen;
2151  char *q=buf;
2152  while (px!=pxend) {
2153  *q++=px[2];
2154  *q++=px[1];
2155  *q++=px[3];
2156  px+=3;
2157  }
2158  data.vi_write(buf, rlen);
2159  if (pad!=0) data.vi_write("\0\0\0", pad);
2160  }
2161  delete [] buf;
2162  } else {
2163  while (htc--!=0) { /* BMP stores rows from down */
2164  data.vi_write(pend-=rlen, rlen);
2165  if (pad!=0) data.vi_write("\0\0\0", pad);
2166  }
2167  }
2168  }
2169  assert(pend==img->getRowbeg());
2170  delete [] crow;
2171  /* Now data is ready. */
2172 
2173  char *bmphead=new char[54+ncols4+data.getLength()], *p=bmphead;
2174  *p++='B'; *p++='M'; /* magic number header */
2175  lf32(p, 54+ncols4+data.getLength()); /* bfSize */
2176  lf32(p, 0); /* zzHotX, zzHotY */
2177  lf32(p, 54+ncols4); /* bfOffs */
2178  lf32(p, 40); /* biSize==40 => Windows 3.x style BMP file */
2179  lf32(p, wd); /* biWidth */
2180  lf32(p, ht); /* biHeight */
2181  lf16(p, 1); /* biPlanes, must be 1 */
2182  lf16(p, img->getBpc()*img->getCpp()); /* biBitCnt: bits per pixel (1, 4, 8: /Indexed*; 24: /Rgb8) */
2183  lf32(p, biCompr); /* biCompr */
2184  lf32(p, 0); /* biSizeIm */
2185  lf32(p, 0); /* biXPels */
2186  lf32(p, 0); /* biYPels */
2187  lf32(p, (palend-palbeg)/3); /* biClrUsed */
2188  lf32(p, (palend-palbeg)/3); /* biClrImp */
2189  /* vvv Now comes the palette (zero length for /Rgb) */
2190  while (palbeg!=palend) {
2191  *p++=palbeg[2]; *p++=palbeg[1]; *p++=palbeg[0]; *p++='\0';
2192  palbeg+=3;
2193  }
2194  assert((slen_t)(p-bmphead)==54+ncols4);
2195 
2196  out.vi_write(bmphead, p-bmphead); delete [] bmphead;
2197 #if 0
2198  out.vi_write("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
2199  100);
2200  out.vi_write("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
2201  100);
2202  out.vi_write("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
2203  100);
2204  out.vi_write("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
2205  100);
2206  out.vi_write("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
2207  100);
2208 #endif
2209  out << data;
2210  out.vi_write(0,0); /* signal EOF */
2211 
2212  return Rule::Applier::OK;
2213 }
2214 
2216 
2217 /* --- Sun Mar 24 13:48:57 CET 2002 */
2218 
2219 /** The Empty applier produces an empty output file. */
2221  Rule::Cache *cache=&or_->cache;
2222  if (cache->FileFormat!=cache->FF_Empty
2223  ) return Rule::Applier::DONT_KNOW;
2224  return Rule::Applier::OK;
2225 }
2227  (void)out;
2228  (void)sf;
2230  return Rule::Applier::OK;
2231 }
2232 
2234 
2235 /* --- Sun Mar 24 13:48:57 CET 2002 */
2236 
2237 /** The Meta applier writes some meta-information into the output file */
2239  Rule::Cache *cache=&or_->cache;
2240  if (cache->FileFormat!=cache->FF_Meta
2241  ) return Rule::Applier::DONT_KNOW;
2242  // return Rule::Applier::OK; /* Imp: implement the applier */
2243  return Rule::Applier::BAD;
2244 }
2246  (void)out;
2247  (void)sf;
2249  /* Imp: real content here */
2250  return Rule::Applier::OK;
2251 }
2252 
2254 
2255 /* __END__ */
return _Result< 0 ? -1 :_Result;} #line 1069 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnwprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1091 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, va_list _ArgList) { return _vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1108 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format, va_list _ArgList) { return _vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1133 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1179 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1196 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __vswprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1212 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf(wchar_t *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1227 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1243 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1264 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1281 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1283 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1312 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, va_list _ArgList) { return _vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1347 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_l(_Format,((void *) 0), _ArgList);} #line 1361 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vswprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1380 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vscwprintf_p(wchar_t const *const _Format, va_list _ArgList) { return _vscwprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1394 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl __swprintf_l(wchar_t *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1414 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1435 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf(wchar_t *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__vswprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1454 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1474 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "__swprintf_l_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __swprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vswprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl __vswprintf_l(wchar_t *_Buffer, wchar_t const *_Format, _locale_t _Locale, va_list _Args);__declspec(deprecated("This function or variable may be unsafe. Consider using " "swprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swprintf(wchar_t *_Buffer, wchar_t const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vswprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vswprintf(wchar_t *_Buffer, wchar_t const *_Format, va_list _Args);__inline int __cdecl _swprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1511 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1532 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1534 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1562 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_p(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1582 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1603 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swprintf_c(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1623 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwprintf_l(wchar_t *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1646 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf(wchar_t *_Buffer, size_t _BufferCount, wchar_t const *_Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1668 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s_l(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwprintf_s(wchar_t *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1711 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1737 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1755 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p_l(wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1774 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _scwprintf_p(wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscwprintf_p_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1792 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #pragma warning(push) #pragma warning(disable:4141 6054) #pragma warning(pop) #line 1856 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" int __cdecl __stdio_common_vswscanf(unsigned __int64 _Options, wchar_t const *_Buffer, size_t _BufferCount, wchar_t const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vswscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1897 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf(wchar_t const *_Buffer, wchar_t const *_Format, va_list _ArgList) { return _vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vswscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl vswscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format, va_list _ArgList) { return _vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 1947 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 1949 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1976 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _vsnwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vswscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);} #line 1995 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_swscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _swscanf_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2015 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "swscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl swscanf(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2034 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _swscanf_s_l(wchar_t const *const _Buffer, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2054 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl swscanf_s(wchar_t const *const _Buffer, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vswscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" #line 2077 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2100 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snwscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snwscanf(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2122 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s_l(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2143 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __inline int __cdecl _snwscanf_s(wchar_t const *const _Buffer, size_t const _BufferCount, wchar_t const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnwscanf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2163 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstdio.h" __pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) typedef __int64 fpos_t;errno_t __cdecl _get_stream_buffer_pointers(FILE *_Stream, char ***_Base, char ***_Pointer, int **_Count);errno_t __cdecl clearerr_s(FILE *_Stream);errno_t __cdecl fopen_s(FILE **_Stream, char const *_FileName, char const *_Mode);size_t __cdecl fread_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);errno_t __cdecl freopen_s(FILE **_Stream, char const *_FileName, char const *_Mode, FILE *_OldStream);char *__cdecl gets_s(char *_Buffer, rsize_t _Size);errno_t __cdecl tmpfile_s(FILE **_Stream);errno_t __cdecl tmpnam_s(char *_Buffer, rsize_t _Size);#line 145 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl clearerr(FILE *_Stream);int __cdecl fclose(FILE *_Stream);int __cdecl _fcloseall(void);FILE *__cdecl _fdopen(int _FileHandle, char const *_Mode);int __cdecl feof(FILE *_Stream);int __cdecl ferror(FILE *_Stream);int __cdecl fflush(FILE *_Stream);int __cdecl fgetc(FILE *_Stream);int __cdecl _fgetchar(void);int __cdecl fgetpos(FILE *_Stream, fpos_t *_Position);char *__cdecl fgets(char *_Buffer, int _MaxCount, FILE *_Stream);int __cdecl _fileno(FILE *_Stream);int __cdecl _flushall(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "fopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl fopen(char const *_FileName, char const *_Mode);int __cdecl fputc(int _Character, FILE *_Stream);int __cdecl _fputchar(int _Character);int __cdecl fputs(char const *_Buffer, FILE *_Stream);size_t __cdecl fread(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);__declspec(deprecated("This function or variable may be unsafe. Consider using " "freopen_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl freopen(char const *_FileName, char const *_Mode, FILE *_Stream);FILE *__cdecl _fsopen(char const *_FileName, char const *_Mode, int _ShFlag);int __cdecl fsetpos(FILE *_Stream, fpos_t const *_Position);int __cdecl fseek(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl ftell(FILE *_Stream);__int64 __cdecl _ftelli64(FILE *_Stream);size_t __cdecl fwrite(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl getc(FILE *_Stream);int __cdecl getchar(void);int __cdecl _getmaxstdio(void);int __cdecl _getw(FILE *_Stream);void __cdecl perror(char const *_ErrorMessage);int __cdecl _pclose(FILE *_Stream);FILE *__cdecl _popen(char const *_Command, char const *_Mode);#line 344 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl putc(int _Character, FILE *_Stream);int __cdecl putchar(int _Character);int __cdecl puts(char const *_Buffer);int __cdecl _putw(int _Word, FILE *_Stream);int __cdecl remove(char const *_FileName);int __cdecl rename(char const *_OldFileName, char const *_NewFileName);int __cdecl _unlink(char const *_FileName);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_unlink" ". See online help for details.")) int __cdecl unlink(char const *_FileName);#line 391 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" void __cdecl rewind(FILE *_Stream);int __cdecl _rmtmp(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "setvbuf" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) void __cdecl setbuf(FILE *_Stream, char *_Buffer);int __cdecl _setmaxstdio(int _Maximum);int __cdecl setvbuf(FILE *_Stream, char *_Buffer, int _Mode, size_t _Size);__declspec(allocator) char *__cdecl _tempnam(char const *_DirectoryName, char const *_FilePrefix);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpfile_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) FILE *__cdecl tmpfile(void);__declspec(deprecated("This function or variable may be unsafe. Consider using " "tmpnam_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl tmpnam(char *_Buffer);int __cdecl ungetc(int _Character, FILE *_Stream);void __cdecl _lock_file(FILE *_Stream);void __cdecl _unlock_file(FILE *_Stream);int __cdecl _fclose_nolock(FILE *_Stream);int __cdecl _fflush_nolock(FILE *_Stream);int __cdecl _fgetc_nolock(FILE *_Stream);int __cdecl _fputc_nolock(int _Character, FILE *_Stream);size_t __cdecl _fread_nolock(void *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);size_t __cdecl _fread_nolock_s(void *_Buffer, size_t _BufferSize, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _fseek_nolock(FILE *_Stream, long _Offset, int _Origin);int __cdecl _fseeki64_nolock(FILE *_Stream, __int64 _Offset, int _Origin);long __cdecl _ftell_nolock(FILE *_Stream);__int64 __cdecl _ftelli64_nolock(FILE *_Stream);size_t __cdecl _fwrite_nolock(void const *_Buffer, size_t _ElementSize, size_t _ElementCount, FILE *_Stream);int __cdecl _getc_nolock(FILE *_Stream);int __cdecl _putc_nolock(int _Character, FILE *_Stream);int __cdecl _ungetc_nolock(int _Character, FILE *_Stream);int *__cdecl __p__commode(void);#line 596 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfprintf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_s(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vfprintf_p(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vfprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 648 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 662 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_s((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 677 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfprintf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 693 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 695 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfprintf_p((*__local_stdio_printf_options()), _Stream, _Format, _Locale, _ArgList);} #line 710 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfprintf_p(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);} #line 724 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 738 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf(char const *const _Format, va_list _ArgList) { return _vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 751 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 765 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vprintf_s(char const *const _Format, va_list _ArgList) { return _vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 780 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);} #line 796 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vprintf_p(char const *const _Format, va_list _ArgList) { return _vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);} #line 809 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 828 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 846 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl _set_printf_count_output(int _Value);int __cdecl _get_printf_count_output(void);__inline int __cdecl _fprintf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 871 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fprintf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 891 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 893 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 912 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fprintf_p(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 930 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 948 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 965 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 983 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl printf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_s_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1002 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1004 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1022 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _printf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfprintf_p_l((__acrt_iob_func(1)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1039 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vfscanf(unsigned __int64 _Options, FILE *_Stream, char const *_Format, _locale_t _Locale, va_list _Arglist);__inline int __cdecl _vfscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options()), _Stream, _Format, _Locale, _ArgList);} #line 1070 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1084 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vfscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vfscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Stream, _Format, _Locale, _ArgList);} #line 1101 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vfscanf_s(FILE *const _Stream, char const *const _Format, va_list _ArgList) { return _vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);} #line 1118 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1120 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1134 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf(char const *const _Format, va_list _ArgList) { return _vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1147 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscanf_s_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);} #line 1161 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vscanf_s(char const *const _Format, va_list _ArgList) { return _vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);} #line 1176 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1178 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_fscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _fscanf_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1197 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "fscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl fscanf(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1215 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _fscanf_s_l(FILE *const _Stream, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1234 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl fscanf_s(FILE *const _Stream, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l(_Stream, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1254 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_scanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _scanf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1274 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "scanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl scanf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1291 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scanf_s_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1309 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl scanf_s(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vfscanf_s_l((__acrt_iob_func(0)), _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1328 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1330 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsprintf(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsnprintf_s(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, size_t _MaxCount, char const *_Format, _locale_t _Locale, va_list _ArgList);int __cdecl __stdio_common_vsprintf_p(unsigned __int64 _Options, char *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsnprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1399 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1415 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);return _Result< 0 ? -1 :_Result;} #line 1446 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _vsprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 1462 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl vsprintf(char *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsnprintf_l(_Buffer,(size_t) -1, _Format,((void *) 0), _ArgList);} #line 1477 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1498 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1516 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1526 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1547 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1563 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsnprintf_s((*__local_stdio_printf_options()), _Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1585 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1602 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsnprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);} #line 1630 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1641 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1659 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf(char const *const _Format, va_list _ArgList) { return _vscprintf_l(_Format,((void *) 0), _ArgList);} #line 1672 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p_l(char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf_p((*__local_stdio_printf_options())|(1ULL<< 1),((void *) 0), 0, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1690 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vscprintf_p(char const *const _Format, va_list _ArgList) { return _vscprintf_p_l(_Format,((void *) 0), _ArgList);} #line 1703 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { int const _Result=__stdio_common_vsprintf((*__local_stdio_printf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);return _Result< 0 ? -1 :_Result;} #line 1723 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsnprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format, va_list _ArgList) { return _vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);} #line 1739 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sprintf_l(char *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1761 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf(char *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1782 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl sprintf(char *_Buffer, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "vsprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl vsprintf(char *_Buffer, char const *_Format, va_list _Args);__inline int __cdecl _sprintf_s_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1810 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sprintf_s(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_s_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1832 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 1834 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1862 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sprintf_p(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsprintf_p_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1882 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snprintf_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1905 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1936 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf(_Buffer, _BufferCount, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1956 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _snprintf(char *_Buffer, size_t _BufferCount, char const *_Format,...);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_vsnprintf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) int __cdecl _vsnprintf(char *_Buffer, size_t _BufferCount, char const *_Format, va_list _Args);__inline int __cdecl _snprintf_c_l(char *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 1986 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_c(char *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_c_l(_Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2006 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s_l(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2028 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snprintf_s(char *const _Buffer, size_t const _BufferCount, size_t const _MaxCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsnprintf_s_l(_Buffer, _BufferCount, _MaxCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2049 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2075 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_l(_Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2092 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p_l(char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p_l(_Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2110 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _scprintf_p(char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vscprintf_p(_Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2127 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" int __cdecl __stdio_common_vsscanf(unsigned __int64 _Options, char const *_Buffer, size_t _BufferCount, char const *_Format, _locale_t _Locale, va_list _ArgList);__inline int __cdecl _vsscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2158 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl vsscanf(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2172 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _vsscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale, va_list _ArgList) { return __stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer,(size_t) -1, _Format, _Locale, _ArgList);} #line 2189 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __inline int __cdecl vsscanf_s(char const *const _Buffer, char const *const _Format, va_list _ArgList) { return _vsscanf_s_l(_Buffer, _Format,((void *) 0), _ArgList);} #line 2208 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) #line 2219 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_sscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _sscanf_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2238 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "sscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl sscanf(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_l(_Buffer, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2256 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _sscanf_s_l(char const *const _Buffer, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=_vsscanf_s_l(_Buffer, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2275 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl sscanf_s(char const *const _Buffer, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=vsscanf_s(_Buffer, _Format, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2297 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #line 2299 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(push) #pragma warning(disable:6530) __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2326 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "_snscanf_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) __inline int __cdecl _snscanf(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options()), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2349 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s_l(char const *const _Buffer, size_t const _BufferCount, char const *const _Format, _locale_t const _Locale,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Locale))+((sizeof(_Locale)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format, _Locale, _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2374 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" __inline int __cdecl _snscanf_s(char const *const _Buffer, size_t const _BufferCount, char const *const _Format,...) { int _Result;va_list _ArgList;((void)(_ArgList=(va_list)(&(_Format))+((sizeof(_Format)+sizeof(int) - 1) &~(sizeof(int) - 1)))) ;_Result=__stdio_common_vsscanf((*__local_stdio_scanf_options())|(1ULL<< 0), _Buffer, _BufferCount, _Format,((void *) 0), _ArgList);((void)(_ArgList=(va_list) 0)) ;return _Result;} #line 2397 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h" #pragma warning(pop) __declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_tempnam" ". See online help for details.")) char *__cdecl tempnam(char const *_Directory, char const *_FilePrefix);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fcloseall" ". See online help for details.")) int __cdecl fcloseall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fdopen" ". See online help for details.")) FILE *__cdecl fdopen(int _FileHandle, char const *_Format);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fgetchar" ". See online help for details.")) int __cdecl fgetchar(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fileno" ". See online help for details.")) int __cdecl fileno(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_flushall" ". See online help for details.")) int __cdecl flushall(void);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_fputchar" ". See online help for details.")) int __cdecl fputchar(int _Ch);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_getw" ". See online help for details.")) int __cdecl getw(FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_putw" ". See online help for details.")) int __cdecl putw(int _Ch, FILE *_Stream);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_rmtmp" ". See online help for details.")) int __cdecl rmtmp(void);#line 2441 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\stdio.h"__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma once#pragma once#pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int *__cdecl _errno(void);errno_t __cdecl _set_errno(int _Value);errno_t __cdecl _get_errno(int *_Value);unsigned long *__cdecl __doserrno(void);errno_t __cdecl _set_doserrno(unsigned long _Value);errno_t __cdecl _get_doserrno(unsigned long *_Value);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) void *__cdecl memchr(void const *_Buf, int _Val, size_t _MaxCount);int __cdecl memcmp(void const *_Buf1, void const *_Buf2, size_t _Size);void *__cdecl memcpy(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memmove(void *_Dst, void const *_Src, size_t _Size);void *__cdecl memset(void *_Dst, int _Val, size_t _Size);char *__cdecl strchr(char const *_Str, int _Val);char *__cdecl strrchr(char const *_Str, int _Ch);char *__cdecl strstr(char const *_Str, char const *_SubStr);wchar_t *__cdecl wcschr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsrchr(wchar_t const *_Str, wchar_t _Ch);wchar_t *__cdecl wcsstr(wchar_t const *_Str, wchar_t const *_SubStr);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) static __inline errno_t __cdecl memcpy_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;if(_Source==((void *) 0)||_DestinationSize< _SourceSize) { memset(_Destination, 0, _DestinationSize);{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;return 22 ;} memcpy(_Destination, _Source, _SourceSize);return 0;} static __inline errno_t __cdecl memmove_s(void *const _Destination, rsize_t const _DestinationSize, void const *const _Source, rsize_t const _SourceSize) { if(_SourceSize==0) { return 0;} { int _Expr_val=!!(_Destination !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_Source !=((void *) 0));if(!(_Expr_val)) {(*_errno())=22;_invalid_parameter_noinfo();return 22;} } ;{ int _Expr_val=!!(_DestinationSize >=_SourceSize);if(!(_Expr_val)) {(*_errno())=34;_invalid_parameter_noinfo();return 34;} } ;memmove(_Destination, _Source, _SourceSize);return 0;}#pragma warning(pop) __pragma(pack(pop))#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) int __cdecl _memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);int __cdecl _memicmp_l(void const *_Buf1, void const *_Buf2, size_t _Size, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memccpy" ". See online help for details.")) void *__cdecl memccpy(void *_Dst, void const *_Src, int _Val, size_t _Size);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_memicmp" ". See online help for details.")) int __cdecl memicmp(void const *_Buf1, void const *_Buf2, size_t _Size);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl wcscat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcscpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source);errno_t __cdecl wcsncat_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);errno_t __cdecl wcsncpy_s(wchar_t *_Destination, rsize_t _SizeInWords, wchar_t const *_Source, rsize_t _MaxCount);wchar_t *__cdecl wcstok_s(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);__declspec(allocator) wchar_t *__cdecl _wcsdup(wchar_t const *_String);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscat(wchar_t *_Destination, wchar_t const *_Source);int __cdecl wcscmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcscpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcscpy(wchar_t *_Destination, wchar_t const *_Source);size_t __cdecl wcscspn(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcslen(wchar_t const *_String);size_t __cdecl wcsnlen(wchar_t const *_Source, size_t _MaxCount);static __inline size_t __cdecl wcsnlen_s(wchar_t const *_Source, size_t _MaxCount) { return(_Source==0) ? 0 :wcsnlen(_Source, _MaxCount);}__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncat(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);int __cdecl wcsncmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcsncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcsncpy(wchar_t *_Destination, wchar_t const *_Source, size_t _Count);wchar_t *__cdecl wcspbrk(wchar_t const *_String, wchar_t const *_Control);size_t __cdecl wcsspn(wchar_t const *_String, wchar_t const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl wcstok(wchar_t *_String, wchar_t const *_Delimiter, wchar_t **_Context);#line 237 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\corecrt_wstring.h" __declspec(deprecated("This function or variable may be unsafe. Consider using " "wcstok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) static __inline wchar_t *__cdecl _wcstok(wchar_t *const _String, wchar_t const *const _Delimiter) { return wcstok(_String, _Delimiter, 0);} __declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcserror(int _ErrorNumber);errno_t __cdecl _wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, int _ErrorNumber);__declspec(deprecated("This function or variable may be unsafe. Consider using " "__wcserror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl __wcserror(wchar_t const *_String);errno_t __cdecl __wcserror_s(wchar_t *_Buffer, size_t _SizeInWords, wchar_t const *_ErrorMessage);int __cdecl _wcsicmp(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicmp_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicmp_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);errno_t __cdecl _wcsnset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);wchar_t *__cdecl _wcsrev(wchar_t *_String);errno_t __cdecl _wcsset_s(wchar_t *_Destination, size_t _SizeInWords, wchar_t _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsset(wchar_t *_String, wchar_t _Value);errno_t __cdecl _wcslwr_s(wchar_t *_String, size_t _SizeInWords);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr(wchar_t *_String);errno_t __cdecl _wcslwr_s_l(wchar_t *_String, size_t _SizeInWords, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcslwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcslwr_l(wchar_t *_String, _locale_t _Locale);errno_t __cdecl _wcsupr_s(wchar_t *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr(wchar_t *_String);errno_t __cdecl _wcsupr_s_l(wchar_t *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_wcsupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) wchar_t *__cdecl _wcsupr_l(wchar_t *_String, _locale_t _Locale);size_t __cdecl wcsxfrm(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount);size_t __cdecl _wcsxfrm_l(wchar_t *_Destination, wchar_t const *_Source, size_t _MaxCount, _locale_t _Locale);int __cdecl wcscoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcscoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsicoll(wchar_t const *_String1, wchar_t const *_String2);int __cdecl _wcsicoll_l(wchar_t const *_String1, wchar_t const *_String2, _locale_t _Locale);int __cdecl _wcsncoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsncoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _wcsnicoll(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);int __cdecl _wcsnicoll_l(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsdup" ". See online help for details.")) wchar_t *__cdecl wcsdup(wchar_t const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicmp" ". See online help for details.")) int __cdecl wcsicmp(wchar_t const *_String1, wchar_t const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnicmp" ". See online help for details.")) int __cdecl wcsnicmp(wchar_t const *_String1, wchar_t const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsnset" ". See online help for details.")) wchar_t *__cdecl wcsnset(wchar_t *_String, wchar_t _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsrev" ". See online help for details.")) wchar_t *__cdecl wcsrev(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsset" ". See online help for details.")) wchar_t *__cdecl wcsset(wchar_t *_String, wchar_t _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcslwr" ". See online help for details.")) wchar_t *__cdecl wcslwr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsupr" ". See online help for details.")) wchar_t *__cdecl wcsupr(wchar_t *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_wcsicoll" ". See online help for details.")) int __cdecl wcsicoll(wchar_t const *_String1, wchar_t const *_String2);__pragma(pack(pop))#pragma warning(pop) #pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) __pragma(pack(push, 8)) errno_t __cdecl strcpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strcat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source);errno_t __cdecl strerror_s(char *_Buffer, size_t _SizeInBytes, int _ErrorNumber);errno_t __cdecl strncat_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);errno_t __cdecl strncpy_s(char *_Destination, rsize_t _SizeInBytes, char const *_Source, rsize_t _MaxCount);char *__cdecl strtok_s(char *_String, char const *_Delimiter, char **_Context);void *__cdecl _memccpy(void *_Dst, void const *_Src, int _Val, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcat(char *_Destination, char const *_Source);int __cdecl strcmp(char const *_Str1, char const *_Str2);int __cdecl _strcmpi(char const *_String1, char const *_String2);int __cdecl strcoll(char const *_String1, char const *_String2);int __cdecl _strcoll_l(char const *_String1, char const *_String2, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strcpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strcpy(char *_Destination, char const *_Source);size_t __cdecl strcspn(char const *_Str, char const *_Control);__declspec(allocator) char *__cdecl _strdup(char const *_Source);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strerror(char const *_ErrorMessage);errno_t __cdecl _strerror_s(char *_Buffer, size_t _SizeInBytes, char const *_ErrorMessage);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strerror_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strerror(int _ErrorMessage);int __cdecl _stricmp(char const *_String1, char const *_String2);int __cdecl _stricoll(char const *_String1, char const *_String2);int __cdecl _stricoll_l(char const *_String1, char const *_String2, _locale_t _Locale);int __cdecl _stricmp_l(char const *_String1, char const *_String2, _locale_t _Locale);size_t __cdecl strlen(char const *_Str);errno_t __cdecl _strlwr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr(char *_String);errno_t __cdecl _strlwr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strlwr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strlwr_l(char *_String, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncat_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncat(char *_Destination, char const *_Source, size_t _Count);int __cdecl strncmp(char const *_Str1, char const *_Str2, size_t _MaxCount);int __cdecl _strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicmp_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strnicoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strnicoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);int __cdecl _strncoll(char const *_String1, char const *_String2, size_t _MaxCount);int __cdecl _strncoll_l(char const *_String1, char const *_String2, size_t _MaxCount, _locale_t _Locale);size_t __cdecl __strncnt(char const *_String, size_t _Count);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strncpy_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strncpy(char *_Destination, char const *_Source, size_t _Count);size_t __cdecl strnlen(char const *_String, size_t _MaxCount);static __inline size_t __cdecl strnlen_s(char const *_String, size_t _MaxCount) { return _String==0 ? 0 :strnlen(_String, _MaxCount);} errno_t __cdecl _strnset_s(char *_String, size_t _SizeInBytes, int _Value, size_t _MaxCount);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strnset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strnset(char *_Destination, int _Value, size_t _Count);char *__cdecl strpbrk(char const *_Str, char const *_Control);char *__cdecl _strrev(char *_Str);errno_t __cdecl _strset_s(char *_Destination, size_t _DestinationSize, int _Value);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strset_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strset(char *_Destination, int _Value);size_t __cdecl strspn(char const *_Str, char const *_Control);__declspec(deprecated("This function or variable may be unsafe. Consider using " "strtok_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl strtok(char *_String, char const *_Delimiter);errno_t __cdecl _strupr_s(char *_String, size_t _Size);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr(char *_String);errno_t __cdecl _strupr_s_l(char *_String, size_t _Size, _locale_t _Locale);__declspec(deprecated("This function or variable may be unsafe. Consider using " "_strupr_s_l" " instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. " "See online help for details.")) char *__cdecl _strupr_l(char *_String, _locale_t _Locale);size_t __cdecl strxfrm(char *_Destination, char const *_Source, size_t _MaxCount);size_t __cdecl _strxfrm_l(char *_Destination, char const *_Source, size_t _MaxCount, _locale_t _Locale);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strdup" ". See online help for details.")) char *__cdecl strdup(char const *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strcmpi" ". See online help for details.")) int __cdecl strcmpi(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_stricmp" ". See online help for details.")) int __cdecl stricmp(char const *_String1, char const *_String2);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strlwr" ". See online help for details.")) char *__cdecl strlwr(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnicmp" ". See online help for details.")) int __cdecl strnicmp(char const *_String1, char const *_String2, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strnset" ". See online help for details.")) char *__cdecl strnset(char *_String, int _Value, size_t _MaxCount);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strrev" ". See online help for details.")) char *__cdecl strrev(char *_String);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strset" ". See online help for details.")) char *__cdecl strset(char *_String, int _Value);__declspec(deprecated("The POSIX name for this item is deprecated. Instead, use the ISO C " "and C++ conformant name: " "_strupr" ". See online help for details.")) char *__cdecl strupr(char *_String);__pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4514 4820) __pragma(pack(push, 8)) __pragma(pack(pop))#pragma warning(pop) #pragma once#pragma warning(push)#pragma warning(disable:4324 4514 4574 4710 4793 4820 4995 4996 28719 28726 28727) typedef unsigned short _ino_t;typedef _ino_t ino_t;#line 24 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef unsigned int _dev_t;typedef _dev_t dev_t;#line 36 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h" typedef long _off_t;typedef _off_t off_t;#line 48 "C:/Program Files (x86)/Windows Kits/10/include/10.0.19041.0/ucrt\\sys/types.h"#pragma warning(pop) typedef char *sds;#pragma pack(push, 1) struct sdshdr5 { unsigned char flags;char buf[];};struct sdshdr8 { uint8_t len;uint8_t alloc;unsigned char flags;char buf[];};struct sdshdr16 { uint16_t len;uint16_t alloc;unsigned char flags;char buf[];};struct sdshdr32 { uint32_t len;uint32_t alloc;unsigned char flags;char buf[];};struct sdshdr64 { uint64_t len;uint64_t alloc;unsigned char flags;char buf[];};#pragma pack(pop) static inline size_t sdslen(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :return((flags) >> 3) ;case 1 :return((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len;case 2 :return((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len;case 3 :return((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) ->len;case 4 :return((struct sdshdr64 *)((s) -(sizeof(struct sdshdr64)))) ->len;} return 0;}static inline size_t sdsavail(const sds s) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ return 0;} case 1 :{ struct sdshdr8 *sh=(void *)((s) -(sizeof(struct sdshdr8)));;return sh->alloc - sh->len;} case 2 :{ struct sdshdr16 *sh=(void *)((s) -(sizeof(struct sdshdr16)));;return sh->alloc - sh->len;} case 3 :{ struct sdshdr32 *sh=(void *)((s) -(sizeof(struct sdshdr32)));;return sh->alloc - sh->len;} case 4 :{ struct sdshdr64 *sh=(void *)((s) -(sizeof(struct sdshdr64)));;return sh->alloc - sh->len;} } return 0;}static inline void sdssetlen(sds s, size_t newlen) { unsigned char flags=s[-1];switch(flags &7) { case 0 :{ unsigned char *fp=((unsigned char *) s) - 1;*fp=0|(newlen<< 3);} break;case 1 :((struct sdshdr8 *)((s) -(sizeof(struct sdshdr8)))) ->len=(uint8_t) newlen;break;case 2 :((struct sdshdr16 *)((s) -(sizeof(struct sdshdr16)))) ->len=(uint16_t) newlen;break;case 3 :((struct sdshdr32 *)((s) -(sizeof(struct sdshdr32)))) -> len
Definition: CPAL.d:15583
rp
Definition: action.c:992
bp
Definition: action.c:1035
cp
Definition: action.c:1035
q
Definition: afm2pl.c:2287
Rule::Applier out_gif89a_applier
Definition: appliers.cpp:570
Rule::Applier out_tiffjai_applier
Definition: appliers.cpp:1328
Rule::Applier::cons_t out_jpeg_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:989
Rule::Applier out_l23_applier
Definition: appliers.cpp:347
Rule::Applier::cons_t out_l1c_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:460
static void gen_tkey(char *tkey, GenBuffer::Writable &out, GenBuffer::Writable *&tp, GenBuffer::Writable *&cp, Rule::OutputRule *or_)
Definition: appliers.cpp:410
Rule::Applier::cons_t out_l1tr_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:358
Rule::Applier::cons_t out_pnm_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:731
static void lf16(char *&p, unsigned u16)
Definition: appliers.cpp:38
Rule::Applier out_empty_applier
Definition: appliers.cpp:2233
Rule::Applier::cons_t out_bmp_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:2060
Rule::Applier out_tiff_applier
Definition: appliers.cpp:1741
Rule::Applier::cons_t out_png_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:1782
Rule::Applier::cons_t out_xwd_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:839
Rule::Applier::cons_t out_tiff_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:1427
Rule::Applier out_pnm_applier
Definition: appliers.cpp:835
Rule::Applier::cons_t out_meta_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:2245
Rule::Applier::cons_t out_xpm_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:580
Rule::Applier out_meta_applier
Definition: appliers.cpp:2253
Rule::Applier out_bmp_applier
Definition: appliers.cpp:2215
static void mf32(char *&p, slen_t u32)
Definition: appliers.cpp:22
Rule::Applier::cons_t out_pnm_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:705
Rule::Applier out_xwd_applier
Definition: appliers.cpp:956
Rule::Applier::cons_t out_l23_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:213
Rule::Applier::cons_t out_tiffjai_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:1250
#define BUF(x)
Rule::Applier::cons_t out_tiff_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:1378
Rule::Applier::cons_t out_l23_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:250
Rule::Applier::cons_t out_png_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:1820
Rule::Applier::cons_t out_gif89a_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:523
Rule::Applier::cons_t out_bmp_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:2100
Rule::Applier out_xpm_applier
Definition: appliers.cpp:701
void out_gif_write(GenBuffer::Writable &out, Image::Indexed *img)
Definition: out_gif.cpp:239
Rule::Applier out_png_applier
Definition: appliers.cpp:1932
Rule::Applier::cons_t out_l1c_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:434
Rule::Applier::cons_t out_l1tr_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:365
Rule::Applier::cons_t out_empty_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:2226
Rule::Applier out_jpeg_applier
Definition: appliers.cpp:1010
Rule::Applier::cons_t out_gif89a_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:557
Rule::Applier out_x11_applier
Definition: appliers.cpp:958
Rule::Applier out_l1tr_applier
Definition: appliers.cpp:383
Rule::Applier::cons_t out_empty_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:2220
static void lf32(char *&p, slen_t u32)
Definition: appliers.cpp:30
Rule::Applier::cons_t out_tiffjai_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:1229
Rule::Applier::cons_t out_jpegjai_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:1035
Rule::Applier::cons_t out_xwd_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:863
#define PUTCH__(c)
Rule::Applier out_jpegjai_applier
Definition: appliers.cpp:1046
Rule::Applier::cons_t out_meta_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:2238
Rule::Applier::cons_t out_jpegjai_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:1014
Rule::Applier out_l1c_applier
Definition: appliers.cpp:479
#define BMP_ASSERT(x)
Rule::Applier::cons_t out_jpeg_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:963
Rule::Applier::cons_t out_l2jbin_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:120
Rule::Applier::cons_t out_xpm_work(GenBuffer::Writable &out, Rule::OutputRule *or_, Image::SampledInfo *sf)
Definition: appliers.cpp:606
static char * bmp_compress1_row(char *dst, char const *sbeg, char const *send)
Definition: appliers.cpp:1946
Rule::Applier out_l2jbin_applier
Definition: appliers.cpp:142
Rule::Applier::cons_t out_l2jbin_check_rule(Rule::OutputRule *or_)
Definition: appliers.cpp:98
#define head
Definition: aptex-macros.h:513
#define count(a)
Definition: aptex-macros.h:781
#define x4
void send(char *str)
Definition: axohelp.c:1054
static int bits_per_pixel(cairo_xlib_surface_t *surface)
Definition: error.hpp:20
static GenBuffer::Writable & sev(level_t level)
Definition: error.cpp:58
static char const * banner0
Definition: error.hpp:22
@ EERROR
Definition: error.hpp:29
@ WARNING
Definition: error.hpp:31
@ WARNING_DEFER
Definition: error.hpp:32
slen_t getCount() const
Definition: gensio.hpp:123
virtual void vi_write(char const *, slen_t)=0
virtual void to8()
Definition: image.cpp:616
signed short getTransp() const
Definition: image.hpp:194
unsigned short getNcols() const
Definition: image.hpp:158
slen_t getXoffs() const
Definition: image.hpp:129
char * getRowbeg() const
Definition: image.hpp:122
unsigned char getBpc() const
Definition: image.hpp:126
unsigned int dimen_t
Definition: image.hpp:40
char * getHeadp() const
Definition: image.hpp:132
dimen_t getWd() const
Definition: image.hpp:123
dimen_t getHt() const
Definition: image.hpp:124
static const unsigned char cs2cpp[6]
Definition: image.hpp:61
unsigned char getCpp() const
Definition: image.hpp:127
rlen_t getRlen() const
Definition: image.hpp:130
unsigned char getCs() const
Definition: image.hpp:128
sf_t
Definition: image.hpp:313
@ SF_Indexed2
Definition: image.hpp:322
@ SF_Asis
Definition: image.hpp:333
@ SF_Indexed1
Definition: image.hpp:318
@ SF_Opaque
Definition: image.hpp:315
@ SF_Rgb1
Definition: image.hpp:324
@ SF_Indexed8
Definition: image.hpp:330
@ SF_Gray4
Definition: image.hpp:325
@ SF_None
Definition: image.hpp:314
@ SF_Mask
Definition: image.hpp:319
@ SF_Transparent
Definition: image.hpp:316
@ SF_Rgb4
Definition: image.hpp:331
@ SF_Rgb2
Definition: image.hpp:328
@ SF_Transparent8
Definition: image.hpp:327
@ SF_Rgb8
Definition: image.hpp:332
@ SF_Transparent2
Definition: image.hpp:320
@ SF_Bbox
Definition: image.hpp:334
@ SF_Gray8
Definition: image.hpp:329
@ SF_Gray1
Definition: image.hpp:317
@ SF_Gray2
Definition: image.hpp:321
@ SF_Transparent4
Definition: image.hpp:323
@ SF_Indexed4
Definition: image.hpp:326
virtual void vi_write(char const *buf, slen_t len)
Definition: appliers.cpp:1359
SimBuffer::Flat const & getJPEGTables() const
Definition: appliers.cpp:1349
struct jai_gfxinfo gi
Definition: appliers.cpp:1355
SimBuffer::B buf
Definition: appliers.cpp:1354
unsigned char getColorSpace() const
Definition: appliers.cpp:1350
GenBuffer::Writable & out
Definition: appliers.cpp:1353
JPEGSOF0Encode(GenBuffer::Writable &out_)
Definition: appliers.cpp:1358
unsigned char getHVS() const
Definition: appliers.cpp:1351
virtual void vi_write(char const *buf, slen_t len)
Definition: appliers.cpp:1767
LenCRC32Encode(GenBuffer::Writable &out_, unsigned minus_)
Definition: appliers.cpp:1766
unsigned minus
Definition: appliers.cpp:1759
SimBuffer::B sofar
Definition: appliers.cpp:1763
GenBuffer::Writable & out
Definition: appliers.cpp:1758
void dump(GenBuffer::Writable &out_, unsigned indent, bool dump_delimiters=((bool) 1))
Definition: minips.cpp:522
@ Qundef
Definition: minips.hpp:71
static void delete0(VALUE v)
Definition: minips.cpp:217
static unsigned getType(VALUE v)
Definition: minips.cpp:206
@ T_ARRAY
Definition: minips.hpp:74
static Array * RARRAY(VALUE v)
Definition: minips.hpp:217
ii_t VALUE
Definition: minips.hpp:69
static PSEncoder * newFlateEncode(GenBuffer::Writable &out_, signed Effort=-1)
Definition: encoder.cpp:1183
static Encoder * newPredictor(GenBuffer::Writable &out_, unsigned char type, unsigned char bpc_, slen_t columns_, unsigned char cpp_)
Definition: encoder.cpp:1745
static PSEncoder * newASCII85Encode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:1127
static PSEncoder * newRunLengthEncode(GenBuffer::Writable &out_, slen_t RecordSize=0)
Definition: encoder.cpp:1203
static PSEncoder * newASCIIHexEncode(GenBuffer::Writable &out_, unsigned maxcpl_)
Definition: encoder.cpp:1119
static PSEncoder * newCCITTFaxEncode(GenBuffer::Writable &out_, slendiff_t K, slen_t Columns, bool EndOfLine=((bool) 0), bool BlackIs1=((bool) 0))
Definition: encoder.cpp:1135
static PSEncoder * newLZWEncode(GenBuffer::Writable &out_)
Definition: encoder.cpp:1153
static PSEncoder * newDCTEncode(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, unsigned char Colors, unsigned char ColorTransform, SimBuffer::Flat const &other_parameters)
Definition: encoder.cpp:1279
static PSEncoder * newDCTIJGEncode(GenBuffer::Writable &out_, slen_t Columns, slen_t Rows, unsigned char Colors, unsigned char quality)
Definition: encoder.cpp:1212
static void writeData(GenBuffer::Writable &out, GenBuffer::Writable &outstream, Image::SampledInfo *sf)
Definition: rule.cpp:711
static void writeTTE(GenBuffer::Writable &out, GenBuffer::Writable &outpal, GenBuffer::Writable &outstream, char const *template_, Rule::OutputRule *or_, Image::SampledInfo *sf, stream_writer_t stream_writer, char const *const *strings=(char **)((void *) 0))
Definition: rule.cpp:797
static MiniPS::Dict * Templates
Definition: rule.hpp:299
static void writePalData(GenBuffer::Writable &out, GenBuffer::Writable &outstream, Image::SampledInfo *sf)
Definition: rule.cpp:731
static void writeTTM(Filter::VerbatimE &outve, GenBuffer::Writable &outpal, GenBuffer::Writable &outstream, MiniPS::Array *chunkArray, Rule::OutputRule *or_, Image::SampledInfo *sf, stream_writer_t stream_writer, char const *const *strings=(char **)((void *) 0))
Definition: rule.cpp:1022
void(* stream_writer_t)(GenBuffer::Writable &out, GenBuffer::Writable &outstream, Image::SampledInfo *sf)
Definition: rule.hpp:269
static void writeTTT(GenBuffer::Writable &out, GenBuffer::Writable &outpal, GenBuffer::Writable &outstream, char const *template_key, Rule::OutputRule *or_, Image::SampledInfo *sf, stream_writer_t stream_writer, char const *const *strings=(char **)((void *) 0))
Definition: rule.cpp:1078
virtual void vi_write(char const *, slen_t)
Definition: gensi.cpp:866
B & term0()
Definition: gensi.cpp:768
char * begin_() const
Definition: gensi.hpp:503
char const * end_() const
Definition: gensi.hpp:263
virtual slen_t getLength() const
Definition: gensi.hpp:253
void keepLeft(slen_t howmuch)
Definition: gensi.cpp:526
virtual char * vi_mkend(slen_t howmuch)
Definition: gensi.hpp:398
@ ReferenceBlackWhite
Definition: appliers.cpp:1122
@ EXTRASAMPLE_UNASSALPHA
Definition: appliers.cpp:1071
@ EXTRASAMPLE_ASSOCALPHA
Definition: appliers.cpp:1070
void dirSL(unsigned short tag, slen_t val)
Definition: appliers.cpp:1203
@ PHOTOMETRIC_SEPARATED
Definition: appliers.cpp:1090
@ PHOTOMETRIC_PALETTE
Definition: appliers.cpp:1088
@ PHOTOMETRIC_MINISBLACK
Definition: appliers.cpp:1086
@ GROUP3OPT_2DENCODING
Definition: appliers.cpp:1094
@ GROUP3OPT_UNCOMPRESSED
Definition: appliers.cpp:1095
@ GROUP3OPT_FILLBITS
Definition: appliers.cpp:1096
@ GROUP4OPT_UNCOMPRESSED
Definition: appliers.cpp:1097
SimBuffer::B const & getDir() const
Definition: appliers.cpp:1058
void dirRATIONAL(unsigned short tag, slen_t count, slen_t const *val)
Definition: appliers.cpp:1165
SimBuffer::B s
Definition: appliers.cpp:1054
SimBuffer::B dir
Definition: appliers.cpp:1054
void dirUNDEFINED(unsigned short tag, slen_t count, char const *val)
Definition: appliers.cpp:1175
GenBuffer::Writable & out
Definition: appliers.cpp:1051
void dirClose()
Definition: appliers.cpp:1211
@ COMPRESSION_CCITTFAX3
Definition: appliers.cpp:1076
@ COMPRESSION_PACKBITS
Definition: appliers.cpp:1082
@ COMPRESSION_CCITTFAX4
Definition: appliers.cpp:1077
@ COMPRESSION_CCITTRLEW
Definition: appliers.cpp:1081
@ COMPRESSION_DEFLATE
Definition: appliers.cpp:1083
@ COMPRESSION_CCITTRLE
Definition: appliers.cpp:1075
void dirSHORT(unsigned short tag, slen_t count, unsigned short const *val)
Definition: appliers.cpp:1142
TIFFPrinter(GenBuffer::Writable &out_, bool le_)
Definition: appliers.cpp:1126
void aSHORT(SimBuffer::B &s, unsigned count, unsigned short const *val)
Definition: appliers.cpp:1132
void dirLONG(unsigned short tag, slen_t count, slen_t const *val)
Definition: appliers.cpp:1154
SimBuffer::B & getS()
Definition: appliers.cpp:1057
void aLONG(SimBuffer::B &s, unsigned count, slen_t const *val)
Definition: appliers.cpp:1136
Definition: Endian.h:81
#define PTS_INT32_T
Definition: config-vc6.h:49
#define BEGIN_STATIC_ENUM1(type)
Definition: config2.h:128
unsigned int slen_t
Definition: config2.h:37
#define NULLP
Definition: config2.h:66
#define END_STATIC_ENUM()
Definition: config2.h:129
#define PTS_dynamic_cast(ptrtype, ptr)
Definition: config2.h:293
#define b
Definition: jpegint.h:372
#define fopen
Definition: xxstdio.h:21
char * strcpy()
char * strings
Definition: dvidvi.c:141
struct rect data
Definition: dvipdfm.c:64
static void
Definition: fpif.c:118
mpz_t * f
Definition: gen-fib.c:34
mpz_t pp
Definition: gen-psqr.c:108
#define tp
#define s
Definition: afcover.h:80
#define t
Definition: afcover.h:96
#define c(n)
Definition: gpos-common.c:150
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
#define slen
Definition: hpcdtoppm.c:1329
char const * jai_errors[]
Definition: in_jai.cpp:309
void jai_parse_jpeg(struct jai_gfxinfo *result, DecoderTeller *fp, bool must_be_baseline)
Definition: in_jai.cpp:174
pinfo pal
Definition: in_pcx.cpp:145
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
pad
Definition: in_pcx.cpp:455
#define u16
Definition: jbig2arith.cc:25
#define u32
Definition: jbig2arith.cc:24
small capitals from c petite p scientific f u
Definition: afcover.h:88
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
png_uint_32 crc
Definition: png.c:2247
unsigned long crc32(unsigned long crc, unsigned char *buf, uInt len)
Definition: crc32.c:237
#define buf
#define CRC32_INITIAL
Definition: crc32.h:15
static UHashtable * cache
static bool transp
Definition: pdftocairo.cc:118
unsigned long pixel
Definition: png22pnm.c:123
static enum alpha_handling alpha
Definition: pngtopnm.c:70
int g
Definition: ppmqvga.c:68
int r
Definition: ppmqvga.c:68
bstring c int memset(void *s, int c, int length)
#define x1
#define x2
static uint8_t obuf[8192]
Definition: buildvm_lib.c:13
mp_ptr hp
Definition: sec_pi1_div.c:86
static int get(const char **sp)
Definition: sscanffuns.c:91
unsigned TransferCPL
Definition: rule.hpp:150
unsigned char EncoderColors
Definition: rule.hpp:141
slen_t RecordSize
Definition: rule.hpp:146
slen_t EncoderBPL
Definition: rule.hpp:139
slen_t PredictorColumns
Definition: rule.hpp:142
MiniPS::Dict * DCT
Definition: rule.hpp:153
signed Effort
Definition: rule.hpp:145
slendiff_t K
Definition: rule.hpp:147
slen_t EncoderRows
Definition: rule.hpp:139
unsigned char PredictorColors
Definition: rule.hpp:143
unsigned char Quality
Definition: rule.hpp:149
slen_t EncoderColumns
Definition: rule.hpp:139
unsigned char PredictorBPC
Definition: rule.hpp:143
unsigned ColorTransform
Definition: rule.hpp:144
bool isRGB() const
Definition: rule.cpp:53
Image::sf_t SampleFormat
Definition: rule.hpp:51
bool WarningOK
Definition: rule.hpp:22
@ TE_Binary
Definition: rule.hpp:59
@ TE_ASCII
Definition: rule.hpp:60
@ TE_LSBfirst
Definition: rule.hpp:64
bool isIndexed() const
Definition: rule.cpp:22
bool isTransparentM() const
Definition: rule.cpp:28
te_t TransferEncoding
Definition: rule.hpp:66
bool isPSL3() const
Definition: rule.cpp:70
co_t Compression
Definition: rule.hpp:80
@ CO_Fax
Definition: rule.hpp:74
@ CO_ZIP
Definition: rule.hpp:72
@ CO_IJG
Definition: rule.hpp:76
@ CO_LZW
Definition: rule.hpp:71
@ CO_DCT
Definition: rule.hpp:75
@ CO_RLE
Definition: rule.hpp:73
@ CO_JAI
Definition: rule.hpp:77
@ CO_None
Definition: rule.hpp:70
CacheHints cacheHints
Definition: rule.hpp:168
void doSampleFormat(Image::SampledInfo *info, bool separate=((bool) 0))
Definition: rule.cpp:460
Definition: pst1form.c:310
Definition: ttf.h:354
unsigned char bad
Definition: in_jai.hpp:23
slen_t SOF_offs
Definition: in_jai.hpp:32
unsigned char bpc
Definition: in_jai.hpp:23
unsigned char hvs
Definition: in_jai.hpp:27
Definition: sh.h:1226
Definition: ppm.h:33
Definition: tfmaux.c:31
Definition: dvips.h:235
Definition: xmlparse.c:179
Definition: strexpr.c:21
#define c2
Definition: t1io.c:53
*job_name strlen((char *) job_name) - 4)
val
Definition: tex4ht.c:3227
op
Definition: tex4ht.c:3129
#define s4
Definition: tokst.h:125
#define U(a)
Definition: twiddle.h:1
#define ZPixmap
Definition: x11wd.h:16
@ MSBFirst
Definition: x11wd.h:7
@ PseudoColor
Definition: x11wd.h:18
@ StaticGray
Definition: x11wd.h:18
#define end(cp)
Definition: zic.c:71