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)  

image.cpp
Go to the documentation of this file.
1 /*
2  * image.cpp (formerly sampled.cpp)
3  * by pts@fazekas.hu at Wed Feb 27 09:26:05 CET 2002
4  */
5 
6 #ifdef __GNUC__
7 #ifndef __clang__
8 #pragma implementation
9 #endif
10 #endif
11 
12 #include "image.hpp"
13 #include "error.hpp"
14 #include <string.h> /* strlen() */
15 #include "gensio.hpp"
16 
17 /* --- 4-byte hashing */
18 
19 #if SIZEOF_INT>=4
20 typedef unsigned int u32_t;
21 typedef signed int s32_t;
22 #else
23 typedef unsigned long u32_t;
24 typedef signed long s32_t;
25 #endif
26 
27 /* vvv Dat: moved these out of Hash46 to pacify VC6.0 */
28  const unsigned M=1409;
29  /** Number of _value_ data bytes (they are not hashed) */
30  const unsigned D=2;
31  /** Size of each tuple in the array `t' */
32  const unsigned HD=4+D;
33  /** A tuple is considered free iff its first byte equals FREE */
34  const unsigned char FREE=255;
35 
36 
37 /**
38  * M=1409
39  * h(K)=K%1409
40  * h(i,K)=-i*(1+(K%1408)) (i in 0..1408)
41  * K=[a,r,g,b]=(a<<24)+(r<<16)+(g<<8)+b (4 bytes)
42  * h(K)=(253*a+722*r+(g<<8)+b)%1409
43  * h(i,K)=-i*(1+(896*a+768*r+(g<<8)+b)%1408)
44  *
45  * -- No dynamic growing or re-hashing. Useful for hashing colormap palettes
46  * with a maximum size of 256.
47  * -- Deleting not supported.
48  *
49  * Implementation: Use 32 bit integers for calculation.
50  *
51  * Imp: remove unused attr `size'
52  */
53 class Hash46 {
54  public:
55  /** Creates an empty hash. */
56  Hash46();
57  inline unsigned getSize() const { return size; }
58  inline unsigned getLength() const { return size; }
59  inline unsigned getMaxSize() const { return M; }
60  inline bool isFull() const { return size==M; }
61  /** @return NULLP or the pointer to a tuple */
62  inline unsigned char* lookup(unsigned char k[4]) {
63  unsigned char *ret=walk(k);
64  return ret==NULLP || *ret==FREE ? (unsigned char*)NULLP : ret;
65  }
66  /** Can be called only if !isFull()
67  * @return NULL if isFull() and not found; otherwise: pointer to the tuple
68  * found or the place to which the insert can take place.
69  */
70  unsigned char* walk(unsigned char k[4]);
71  protected:
72  /** Number of non-free tuples in the hash. */
73  unsigned size;
74  unsigned char t[M*HD];
75 };
76 
78  memset(t, FREE, sizeof(t));
79 }
80 
81 unsigned char *Hash46::walk(unsigned char k[4]) {
82  u32_t hk, hik;
83  hk=HD*(((((u32_t)1<<24)%M)*k[0]+(((u32_t)1<<16)%M)*k[1]+
84  (((u32_t)1<< 8)%M)*k[2]+k[3])%M);
85  hik=HD*(1+((((u32_t)1<<24)%(M-1))*k[0]+(((u32_t)1<<16)%(M-1))*k[1]+
86  (((u32_t)1<< 8)%(M-1))*k[2]+k[3])%(M-1));
87  /* fprintf(stderr, "hk=%u hik=%u\n", hk, hik); */
88  register unsigned char *p=t+hk;
89  unsigned i=M;
90  /* fprintf(stderr, "?? %02x %02x %02x %02x\n", k[0], k[1], k[2], k[3]); */
91  do {
92  /* fprintf(stderr, "examining %02x %02x %02x %02x %d\n", p[0], p[1], p[2], p[3], (k[0]=p[0] && k[1]==p[1] && k[2]==p[2])); */
93  if (*p==FREE || (k[0]==p[0] && k[1]==p[1] && k[2]==p[2] && k[3]==p[3])) return p;
94  /* ^^^ huge == BUGFIX at Sun Apr 14 00:16:59 CEST 2002 */
95  if (hk>=hik) { hk-=hik; p-=hik; }
96  else { hk+=M*HD-hik; p+=M*HD-hik; }
97  } while (--i!=0);
98  /* fprintf(stderr, "full\n"); */
99  return (unsigned char*)NULLP;
100 }
101 
102 /* --- */
103 
104 const unsigned char Image::Sampled::cs2cpp[6]= { 0, 1, 3, 3, 4, 4 };
105 char const *Image::Sampled::cs2devcs(unsigned char cs) {
106  static const char *names[]={ (char*)NULLP, "Gray", "RGB", "RGB", "CMYK", "CMYK" };
107  return cs>=1 && cs<=5 ? names[cs] : (char*)NULLP;
108 }
109 
110 static void fatal_image_too_large() {
111  Error::sev(Error::EERROR) << "Image: Image too large." << (Error*)0;
112 }
113 
115  const slen_t result = a * b;
116  /* Check for overflow. Works only if everything is unsigned. */
117  if (result / a != b) fatal_image_too_large();
118  return result;
119 }
120 
122  return multiply_check(multiply_check(a, b), c);
123 }
124 
126  /* Check for overflow. Works only if everything is unsigned. */
127  if (b > (slen_t)-1 - a) fatal_image_too_large();
128  return a + b;
129 }
130 
131 #if 0
132 static slen_t add_check(slen_t a, slen_t b, slen_t c) {
133  return add_check(add_check(a, b), c);
134 }
135 #endif
136 
138  return add_check(add_check(a, b), add_check(c, d));
139 }
140 
141 void Image::Sampled::init(slen_t l_comment, slen_t l_header, dimen_t wd_, dimen_t ht_,
142  /* ^^^ 24 is required for /Transparent in out_tiff_work */
143  unsigned char bpc_, unsigned char ty_, unsigned char cpp_) {
144  /* Even if we continue from here, most probably we'll reach
145  * ``sam2p.yes: Error: applyProfile: invalid combination, no applicable OutputRule''.
146  * So more work is needed to support output images of size 0.
147  */
148  if (wd_ <= 0 || ht_ <= 0) Error::sev(Error::EERROR) << "Image: Image of size 0." << (Error*)0;
149  bpc=bpc_;
150  ty=ty_;
151  wd=wd_;
152  ht=ht_;
153  cpp=cpp_;
154  // pred=1;
155  transpc=0x1000000UL; /* Dat: this means: no transparent color */
156  const slen_t rlens = add_check(multiply_check(bpc_, cpp_, wd_), 7) >> 3;
157  rlen = rlens;
158  if (rlen != rlens) fatal_image_too_large();
159  beg=new char[len=add_check(l_comment, l_header, multiply_check(rlen, ht_), bpc)];
160  rowbeg=(headp=const_cast<char*>(beg)+l_comment)+l_header;
161  trail=const_cast<char*>(beg)+len-bpc;
162  memset(trail, 0, bpc);
163 }
164 
165 Image::Gray* Image::Sampled::toGray0(unsigned char bpc_) {
166  unsigned char *crow=new unsigned char[wd*3+7*3], *p, *pend;
167  Image::Gray *img=new Image::Gray(wd, ht, bpc_);
168  unsigned char *outp=(unsigned char*)img->getRowbeg();
169  dimen_t htc;
170  memset(crow+wd*3, '\0', 7*3); /* *3 BUGFIX at Tue Jan 18 17:04:15 CET 2005 */
171  unsigned i;
172  /* Dat: not optimising for minimal rounding error since caller should ensure
173  * that there is no such error at all.
174  */
175  if (bpc_==1) {
176  assert(img->getBpc()==1);
177  for (htc=0;htc<ht;htc++) {
178  copyRGBRow((char*)crow, htc);
179  for (p=crow-3,pend=p+wd*3; p<pend; ) {
180  i =(*(p+=3)!=0)<<7; i|=(*(p+=3)!=0)<<6; i|=(*(p+=3)!=0)<<5; i|=(*(p+=3)!=0)<<4;
181  i|=(*(p+=3)!=0)<<3; i|=(*(p+=3)!=0)<<2; i|=(*(p+=3)!=0)<<1; i|=(*(p+=3)!=0);
182  *outp++=i;
183  }
184  }
185  } else if (bpc_==2) {
186  for (htc=0;htc<ht;htc++) {
187  copyRGBRow((char*)crow, htc);
188  for (p=crow-3,pend=p+wd*3; p<pend; ) {
189  i =(*(p+=3)/85)<<6; i|=(*(p+=3)/85)<<4; i|=(*(p+=3)/85)<<2; i|=(*(p+=3)/85);
190  *outp++=i;
191  }
192  }
193  } else if (bpc_==4) {
194  for (htc=0;htc<ht;htc++) {
195  copyRGBRow((char*)crow, htc);
196  for (p=crow-3,pend=p+wd*3; p<pend; ) {
197  i =(*(p+=3)/17)<<4; i|=(*(p+=3)/17);
198  *outp++=i;
199  }
200  }
201  } else if (bpc_==8) {
202  for (htc=0;htc<ht;htc++) {
203  copyRGBRow((char*)crow, htc);
204  for (p=crow-3,pend=p+wd*3; p!=pend; ) {
205  *outp++=*(p+=3);
206  }
207  }
208  } else assert(0);
209  delete [] crow;
210  return img;
211 }
212 Image::RGB* Image::Sampled::toRGB0(unsigned char bpc_) {
213  unsigned char *crow=new unsigned char[wd*3+7], *p, *pend;
214  Image::RGB *img=new Image::RGB(wd, ht, bpc_);
215  unsigned char *outp=(unsigned char*)img->getRowbeg();
216  dimen_t htc;
217  memset(crow+wd*3, '\0', 7);
218  unsigned i;
219  /* Dat: not optimising for minimal rounding error since caller should ensure
220  * that there is no such error at all.
221  */
222  if (bpc_==1) {
223  for (htc=0;htc<ht;htc++) {
224  copyRGBRow((char*)crow, htc);
225  for (p=crow,pend=crow+wd*3; p<pend; ) {
226  i =(*p++!=0)<<7; i|=(*p++!=0)<<6; i|=(*p++!=0)<<5; i|=(*p++!=0)<<4;
227  i|=(*p++!=0)<<3; i|=(*p++!=0)<<2; i|=(*p++!=0)<<1; i|=(*p++!=0);
228  *outp++=i;
229  }
230  }
231  } else if (bpc_==2) {
232  for (htc=0;htc<ht;htc++) {
233  copyRGBRow((char*)crow, htc);
234  for (p=crow,pend=crow+wd*3; p<pend; ) {
235  i =(*p++/85)<<6; i|=(*p++/85)<<4; i|=(*p++/85)<<2; i|=(*p++/85);
236  *outp++=i;
237  }
238  }
239  } else if (bpc_==4) {
240  for (htc=0;htc<ht;htc++) {
241  copyRGBRow((char*)crow, htc);
242  for (p=crow,pend=crow+wd*3; p<pend; ) {
243  i =(*p++/17)<<4; i|=(*p++/17);
244  *outp++=i;
245  }
246  }
247  } else if (bpc_==8) {
248  for (htc=0;htc<ht;htc++) {
249  copyRGBRow((char*)outp, htc);
250  outp+=wd*3;
251  }
252  } else assert(0);
253  delete [] crow;
254  return img;
255 }
256 
258  unsigned char *crow=new unsigned char[wd*3], k[6], *p, *pend, *w;
259  Image::Indexed *img=new Image::Indexed(wd, ht, 256, 8);
260  dimen_t htc;
261  unsigned char *pal=(unsigned char*)img->getHeadp(), *outp=(unsigned char*)img->getRowbeg();
262  unsigned ncols=0;
263  Hash46 h;
264  k[0]=0;
265  for (htc=0;htc<ht;htc++) {
266  copyRGBRow((char*)crow, htc);
267  for (p=crow,pend=crow+wd*3; p!=pend; p+=3) {
268  memcpy(k+1, p, 3);
269  w=h.walk(k);
270  assert(w!=NULL); /* Hash cannot be full since h.M>=256. */
271  /* fprintf(stderr, "w=%p\n", w); */
272  if (*w==/*h.*/FREE) {
273  if (ncols==256) { delete img; delete [] crow; return (Image::Indexed*)NULLP; }
274  /* ^^^ too many colors; cannot convert image to indexed */
275  memcpy(w,k,4);
276  memcpy(pal,k+1,3);
277  /* fprintf(stderr,"newcol=%02x #%02x%02x%02x\n", k[0], k[1], k[2], k[3]); */
278  /* fprintf(stderr,"newcol=pal #%02x%02x%02x\n", pal[0], pal[1], pal[2]); */
279  pal+=3;
280  *outp++=w[4]=ncols++;
281  } else { /* a color that we have already seen */
282  *outp++=w[4];
283  }
284  }
285  }
286  img->setNcolsMove(ncols);
287  delete [] crow;
288 
289  /* Now img is ready. The user should call packPal() to make it even tighter. */
290  return img;
291 }
292 
294  if (bpc==8) return;
295  if (wd==0 || ht==0) { bpc=8; return; }
296 
297  unsigned oldBpc=bpc;
298  slen_t wdcpp=wd*cpp;
299  const char *oldBeg=beg;
300  unsigned char *p=(unsigned char*)rowbeg;
301 
302  bpc=8;
303  rlen=wd;
304  beg=new char[len=rowbeg-oldBeg+rlen*ht+bpc];
305  headp= const_cast<char*>(beg)+(headp-oldBeg);
306  rowbeg=const_cast<char*>(beg)+(rowbeg-oldBeg);
307  trail= const_cast<char*>(beg)+len-bpc;
308  memcpy(const_cast<char*>(beg), oldBeg, rowbeg-beg);
309 
310  unsigned char *to=(unsigned char*)rowbeg, *toend;
311  unsigned int i, j;
313  if (oldBpc==1) {
314  htc=ht; while (htc--!=0) {
315  toend=to+((wdcpp)&~7);
316  while (to!=toend) {
317  i=*p++;
318  *to++=(i>>7)*255;
319  *to++=((i>>6)&1)*255;
320  *to++=((i>>5)&1)*255;
321  *to++=((i>>4)&1)*255;
322  *to++=((i>>3)&1)*255;
323  *to++=((i>>2)&1)*255;
324  *to++=((i>>1)&1)*255;
325  *to++=( i&1)*255;
326  }
327  if (0!=(j=(wdcpp)&7)) {
328  i=*p; /* No mem overrun, even if (wd&7)==0 */
329  while (j--!=0) { *to++=(i>>7)*255; i<<=1; }
330  }
331  }
332  } else if (oldBpc==2) {
333  htc=ht; while (htc--!=0) {
334  toend=to+((wdcpp)&~3);
335  while (to!=toend) {
336  i=*p++;
337  *to++=(i>>6)*85;
338  *to++=((i>>4)&3)*85;
339  *to++=((i>>2)&3)*85;
340  *to++=( i&3)*85;
341  }
342  if (0!=(j=(wdcpp)&3)) {
343  i=*p; /* No mem overrun, even if (wd&7)==0 */
344  while (j--!=0) { *to++=(i>>6)*85; i<<=2; }
345  }
346  }
347  } else if (oldBpc==4) {
348  htc=ht; while (htc--!=0) {
349  toend=to+((wdcpp)&~1);
350  while (to!=toend) {
351  i=*p++;
352  *to++=(i>>4)*17;
353  *to++=( i&15)*17;
354  }
355  if (0!=((wdcpp)&1)) *to++=(*p++>>4)*17;
356  }
357  } else assert(0 && "invalid bpc");
358 
359  delete [] const_cast<char*>(oldBeg);
360 }
361 
363  if (bpc==8) return;
364  if (wd==0 || ht==0) { bpc=8; return; }
365 
366  unsigned oldBpc=bpc;
367  slen_t wdcpp=wd*cpp;
368  const char *oldBeg=beg;
369  unsigned char *p=(unsigned char*)rowbeg;
370 
371  bpc=8;
372  rlen=wd;
373  beg=new char[len=rowbeg-oldBeg+rlen*ht+bpc];
374  headp= const_cast<char*>(beg)+(headp-oldBeg);
375  rowbeg=const_cast<char*>(beg)+(rowbeg-oldBeg);
376  trail= const_cast<char*>(beg)+len-bpc;
377  memcpy(const_cast<char*>(beg), oldBeg, rowbeg-beg);
378 
379  unsigned char *to=(unsigned char*)rowbeg, *toend;
380  unsigned int i, j;
382  if (oldBpc==1) {
383  htc=ht; while (htc--!=0) {
384  toend=to+((wdcpp)&~7);
385  while (to!=toend) {
386  i=*p++;
387  *to++=(i>>7);
388  *to++=((i>>6)&1);
389  *to++=((i>>5)&1);
390  *to++=((i>>4)&1);
391  *to++=((i>>3)&1);
392  *to++=((i>>2)&1);
393  *to++=((i>>1)&1);
394  *to++=( i&1);
395  }
396  if (0!=(j=(wdcpp)&7)) {
397  i=*p++; /* No mem overrun, even if (wd&7)==0 */
398  while (j--!=0) { *to++=(i>>7); i<<=1; }
399  }
400  }
401  } else if (oldBpc==2) {
402  // assert(0);
403  htc=ht; while (htc--!=0) {
404  toend=to+((wdcpp)&~3);
405  while (to!=toend) {
406  i=*p++;
407  *to++=(i>>6);
408  *to++=((i>>4)&3);
409  *to++=((i>>2)&3);
410  *to++=( i&3);
411  }
412  if (0!=(j=(wdcpp)&3)) {
413  i=*p++;
414  // fprintf(stderr,"j=%d\n",j);
415  while (j--!=0) { *to++=(i>>6); i<<=2; }
416  }
417  }
418  assert((slen_t)((char*)to-rowbeg)==(slen_t)wd*cpp*ht);
419  } else if (oldBpc==4) {
420  htc=ht; while (htc--!=0) {
421  toend=to+((wdcpp)&~1);
422  while (to!=toend) {
423  i=*p++;
424  *to++=(i>>4);
425  *to++=( i&15);
426  }
427  if (0!=((wdcpp)&1)) *to++=(*p++>>4);
428  }
429  } else assert(0 && "invalid bpc");
430 
431  delete [] const_cast<char*>(oldBeg);
432 }
433 
434 unsigned char Image::Sampled::minRGBBpc() const {
435  unsigned char *crow=new unsigned char[wd*3], *p, *pend=crow+wd*3;
436  register unsigned minbpb=0;
437  dimen_t htc;
438  for (htc=0;htc<ht;htc++) {
439  copyRGBRow((char*)crow, htc);
440  for (p=crow; p!=pend; p++) {
441  if ((*p&15)*17!=*p) { delete [] crow; return 8; } /* 4 bits are not enough */
442  else if ((*p&3)*85!=*p) minbpb=3; /* 2 bits are not enough */
443  else if ((*p&1)*255!=*p) minbpb|=1; /* 1 bit is not enough */
444  }
445  }
446  delete [] crow;
447  return 1+minbpb;
448 }
449 
451  /* by pts@fazekas.hu at Sat Jan 8 13:24:19 CET 2005 */
452  /* Dat: this dumb implementation will be overridden */
453  if (rgb>0xffffffUL) return false;
454  unsigned char *crow=new unsigned char[wd*3], *p, *pend=crow+wd*3, t[3];
455  dimen_t htc;
456  t[0]=(rgb>>16)&255; t[1]=(rgb>>8)&255; t[2]=rgb&255;
457  for (htc=0;htc<ht;htc++) {
458  copyRGBRow((char*)crow, htc);
459  for (p=crow; p!=pend; p+=3) {
460  if (t[0]==p[0] && t[1]==p[1] && t[2]==p[2]) { delete [] crow; return true; }
461  }
462  }
463  delete [] crow;
464  return false;
465 }
466 
468  /* by pts@fazekas.hu at Sat Jan 8 13:24:19 CET 2005 */
469  /* Dat: faster than Image::Sampled::hasPixelRGB */
470  if (rgb>0xffffffUL) return false;
471  unsigned char t[3];
472  t[0]=(rgb>>16)&255; t[1]=(rgb>>8)&255; t[2]=rgb&255;
473  if (t[0]!=t[1] || t[0]!=t[2]) return false;
474  if (bpc==8) {
475  unsigned char *p=(unsigned char*)rowbeg, *pend=p+wd*ht;
476  /* Imp: use memchr() if available */
477  while (p!=pend && t[0]!=p[0]) p++;
478  return p!=pend;
479  }
480  unsigned char *crow=new unsigned char[wd*3], *p, *pend=crow+wd*3;
481  dimen_t htc;
482  for (htc=0;htc<ht;htc++) {
483  copyRGBRow((char*)crow, htc); /* Imp: avoid this if bpp==8 */
484  p=crow; while (p!=pend && t[0]!=p[0]) p+=3;
485  if (p!=pend) { delete [] crow; return true; }
486  }
487  delete [] crow;
488  return false;
489 }
490 
492  if (iimg==NULLP) Error::sev(Error::EERROR) << "addAlpha: too many colors, transparency impossible" << (Error*)0;
493  iimg->to8();
494  unsigned ncols;
495  if ((ncols=iimg->getNcols()) == 256) {
496  iimg->packPal(); // TODO: Do a more lightweight palette packing if there are only 2 colors (such as PNG import through PNM).
497  if ((ncols=iimg->getNcols())==256) Error::sev(Error::EERROR) << "addAlpha: too many colors, transparency impossible" << (Error*)0;
498  }
499  iimg->setNcolsMove(ncols+1);
500  /* fprintf(stderr,"old ncols=%u\n", ncols); */
501  iimg->setPal(ncols,0); /* black */
502  iimg->setTransp(ncols);
503  assert(iimg->getRlen()==iimg->getWd());
504  assert(iimg->getWd()==al->getWd());
505  char *p=iimg->getRowbeg(), *pend=p+iimg->getRlen()*iimg->getHt(), *alq=al->getRowbeg();
506  while (p!=pend) {
507  if ((unsigned char)*alq++!=255) *p=ncols; /* make it transparent */
508  p++;
509  }
510  return iimg;
511 }
512 
513 /* --- */
514 
515 Image::Indexed::Indexed(Image::Sampled::dimen_t wd_, Image::Sampled::dimen_t ht_, unsigned short ncols_, unsigned char bpc_) {
516  param_assert(ncols_<=256);
517  /* vvv Dat: `3' is here for an extra palette entry */
518  init(3,3*ncols_,wd_,ht_,bpc_,TY_INDEXED,1);
519  transp=-1;
521 }
522 void Image::Indexed::setNcols(unsigned short ncols_) {
523  headp=rowbeg-ncols_*3;
524 }
525 void Image::Indexed::setNcolsMove(unsigned short ncols_) {
526  param_assert(ncols_<=256);
527  unsigned ncols=getNcols();
528  if (ncols_==ncols) return;
529  if (ncols_<ncols || (slen_t)(headp-beg)>=(ncols_-ncols)*3) {
530  memmove(rowbeg-ncols_*3, headp, (ncols_<ncols ? ncols_ : ncols)*3);
531  /* ^^^ *3 BUGFIX at Sun Apr 14 00:50:34 CEST 2002 */
532  } else { /* Imp: test this routine */
533  /* Tue Jun 11 16:22:52 CEST 2002 */
534  assert(ncols_>ncols);
535  const char *oldBeg=beg, *oldHeadp=headp, *oldRowbeg=rowbeg, *oldEnd=beg+len;
536  slen_t delta=(ncols_-ncols)*3;
537  // substr_grow(headp-oldBeg, ncols*3, ncols_*3); /* no such method */
538  beg=new char[len+delta];
539  headp= const_cast<char*>(beg)+(headp-oldBeg);
540  rowbeg=const_cast<char*>(beg)+(rowbeg-oldBeg)+delta;
541  trail= const_cast<char*>(beg)+(trail-oldBeg)+delta;
542  assert(beg+(headp-oldBeg)==rowbeg-ncols_*3);
543  /* Dat: this->xoffs is left unchanged */
544  memcpy(headp, oldHeadp, oldRowbeg-oldHeadp);
545  memcpy(rowbeg, oldRowbeg, oldEnd-oldRowbeg);
546  delete [] const_cast<char*>(oldBeg);
547  }
548  headp=rowbeg-ncols_*3;
549 }
551  assert(color<(rowbeg-headp)/3);
552  unsigned char *p=(unsigned char*)headp+3*color;
553  *p++=rgb>>16;
554  *p++=rgb>>8;
555  *p=rgb;
556 }
557 void Image::Indexed::setTransp(unsigned char color) {
558  // param_assert(color>=0); /* always */
559  assert(transp==-1);
560  transp=color;
561  unsigned char *p=(unsigned char*)headp+3*color;
562  transpc=((Image::Sampled::rgb_t)p[0]<<16)+(p[1]<<8)+p[2];
563 }
564 
566  if (color!=0x1000000UL && color!=transpc) {
567  char t[3];
568  t[0]=color>>16; t[1]=color>>8; t[2]=color;
569  char *p=headp, *pend=rowbeg;
570  while (p!=pend) { /* Examine the palette. */
571  if (p[0]==t[0] && p[1]==t[1] && p[2]==t[2]) {
572  transpc=color;
573  transp=(p-headp)/3; /* destroy old transparency */
574  }
575  p+=3;
576  }
577  }
578  return transp!=-1;
579 }
580 
582  if (transp!=-1) return true;
583  if (color!=0x1000000UL && color!=transpc) {
584  char t[3];
585  t[0]=color>>16; t[1]=color>>8; t[2]=color;
586  char *p=headp, *pend=rowbeg;
587  while (p!=pend) { /* Examine the palette. */
588  if (p[0]==t[0] && p[1]==t[1] && p[2]==t[2]) return true;
589  p+=3;
590  }
591  }
592  return false;
593 }
594 
596  if (!(color!=0x1000000UL && color!=transpc)) return;
597  char t[3];
598  t[0]=color>>16; t[1]=color>>8; t[2]=color;
599  char *p=headp, *pend=rowbeg;
600  bool need_repack = false;
601  while (p!=pend) { /* Examine the palette. */
602  if (p[0]==t[0] && p[1]==t[1] && p[2]==t[2]) {
603  transpc=color;
604  transp=(p-headp)/3; /* destroy old transparency */
605  need_repack = true;
606  }
607  p+=3;
608  }
609  if (need_repack) {
610  const unsigned char old_bpc = bpc;
611  packPal(); /* May change bpc. */
612  setBpc(old_bpc);
613  }
614 }
615 
616 void Image::Indexed::to8() { to8nomul(); }
617 Image::Indexed* Image::Indexed::toIndexed()/* const*/ { return this; }
618 Image::RGB* Image::Indexed::toRGB(unsigned char bpc_)/* const*/ { return toRGB0(bpc_); }
619 Image::Gray* Image::Indexed::toGray(unsigned char bpc_)/* const*/ { return toGray0(bpc_); }
621  char *p=headp, *pend=rowbeg, *tp=p+transp*3;
622  /* ignore transparent color at Sat Jun 15 15:18:24 CEST 2002 */
623  if (transp!=-1 && tp!=pend-3) {
624  while (p!=pend) { /* Examine the palette. */
625  if (p!=tp && (p[0]!=p[1] || p[1]!=p[2])) return false; /* Found a non-gray color. */
626  p+=3;
627  }
628  } else {
629  if (transp!=-1 && tp==pend-3) pend-=3; /* both conditions are important */
630  while (p!=pend) { /* Examine the palette. */
631  if (p[0]!=p[1] || p[1]!=p[2]) return false; /* Found a non-gray color. */
632  p+=3;
633  }
634  }
635  return true;
636 }
637 unsigned char Image::Indexed::minRGBBpc() const {
638  unsigned char *p=(unsigned char*)headp, *pend=(unsigned char*)rowbeg;
639  unsigned char *tp=p+transp*3;
640  /* ignore transparent color at Sat Jun 15 15:18:24 CEST 2002 */
641  register unsigned minbpb=0;
642  while (p!=pend) { /* Examine the palette. */
643  if (p==tp) { p+=3; continue; } /* ignore transparent color */
644  if ((*p&15)*17!=*p) return 8; /* 4 bits are not enough */
645  else if ((*p&3)*85!=*p) minbpb=3; /* 2 bits are not enough */
646  else if ((*p&1)*255!=*p) minbpb|=1; /* 1 bit is not enough */
647  p++;
648  }
649  return 1+minbpb;
650 }
652  param_assert(whichrow<ht);
653  if (wd==0) return;
654  unsigned char *p=(unsigned char*)rowbeg+rlen*whichrow;
655  char *r, *toend=to+3*wd;
656  unsigned int i, j;
657 
658  if (bpc==1) {
659  toend-=3*(wd&7);
660  while (to!=toend) {
661  i=*p++;
662  r=headp+3*(i>>7); *to++=*r++; *to++=*r++; *to++=*r++;
663  r=headp+3*((i>>6)&1); *to++=*r++; *to++=*r++; *to++=*r++;
664  r=headp+3*((i>>5)&1); *to++=*r++; *to++=*r++; *to++=*r++;
665  r=headp+3*((i>>4)&1); *to++=*r++; *to++=*r++; *to++=*r++;
666  r=headp+3*((i>>3)&1); *to++=*r++; *to++=*r++; *to++=*r++;
667  r=headp+3*((i>>2)&1); *to++=*r++; *to++=*r++; *to++=*r++;
668  r=headp+3*((i>>1)&1); *to++=*r++; *to++=*r++; *to++=*r++;
669  r=headp+3*( i&1); *to++=*r++; *to++=*r++; *to++=*r++;
670  }
671  i=*p; /* No mem overrun, even if (wd&7)==0 */
672  j=wd&7;
673  while (j--!=0) { r=headp+3*(i>>7); *to++=*r++; *to++=*r++; *to++=*r++; i<<=1; }
674  } else if (bpc==2) {
675  toend-=3*(wd&3);
676  while (to!=toend) {
677  i=*p++;
678  r=headp+3*(i>>6); *to++=*r++; *to++=*r++; *to++=*r++;
679  r=headp+3*((i>>4)&3); *to++=*r++; *to++=*r++; *to++=*r++;
680  r=headp+3*((i>>2)&3); *to++=*r++; *to++=*r++; *to++=*r++;
681  r=headp+3*( i&3); *to++=*r++; *to++=*r++; *to++=*r++;
682  }
683  i=*p; /* No mem overrun, even if (wd&7)==0 */
684  j=wd&3;
685  while (j--!=0) { r=headp+3*(i>>6); *to++=*r++; *to++=*r++; *to++=*r++; i<<=2; }
686  } else if (bpc==4) {
687  toend-=3*(wd&1);
688  while (to!=toend) {
689  i=*p++;
690  r=headp+3*(i>>4); *to++=*r++; *to++=*r++; *to++=*r++;
691  r=headp+3*( i&15); *to++=*r++; *to++=*r++; *to++=*r++;
692  }
693  if (0!=(wd&1)) { r=headp+3*(*p>>4); *to++=*r++; *to++=*r++; *to++=*r++; }
694  } else if (bpc==8) {
695  // fprintf(stderr, "p=%u pp=%u ppp=%u\n", p[0], p[1], p[2]);
696  while (to!=toend) {
697  r=headp+3**p++; *to++=*r++; *to++=*r++; *to++=*r++;
698  }
699  } else assert(0 && "invalid bpc");
700 }
702  /* Convert samples, make bpc=8. */
703  to8();
704 
705  unsigned oldNcols=getNcols();
706  unsigned char *p, *pend;
707  assert((rowbeg-headp)%3==0);
708  assert(transp>=-1);
709  assert(transp<(int)oldNcols);
710  if (oldNcols<=1) return; /* Cannot optimize further. */
711 
712  /* Find unused colors. old2new[c]=(is c used at least once)?1:0 */
713  unsigned char old2new[256], newpal[768];
714  memset(old2new, 0, sizeof(old2new));
715  for (p=(unsigned char*)rowbeg, pend=p+wd*ht; p!=pend; p++) old2new[*p]=1;
716 
717  /* Find and eliminate duplicate colors. Build the new palette in the
718  * beginning of newpal. Use a Hash46 for a quick lookup of colors already
719  * seen. Use the previously computed old2new, but also overwrite it.
720  */
721  Hash46 h;
722  int newTransp=-1;
723  unsigned char *op=old2new, *opend=op+oldNcols, *w, k[6],
724  *ptransp=(unsigned char*)headp+3*transp; /* ==p-3 if no transparent color */
725  /* ^^^ headp BUGFIX at Fri Mar 22 18:02:18 CET 2002 */
726  p=(unsigned char*)headp;
727  // fprintf(stderr, "oldNcols=%d\n", (int)oldNcols);
728  unsigned newNcols=0;
729  while (op!=opend) {
730  // fprintf(stderr, "color=%d %d\n", (int)(op-old2new), p-ptransp);
731  if (0!=*op) { /* Map the color only if it is used in the image. */
732  // fprintf(stderr, "used=%d\n", (int)(op-old2new));
733  if (p==ptransp) { k[0]=1; k[1]=k[2]=k[3]=0; newTransp=newNcols; }
734  else { k[0]=0; memcpy(k+1,p,3); }
735  w=h.walk(k);
736  assert(w!=NULL); /* Hash cannot be full since h.M>=256. */
737  if (*w==/*h.*/FREE) {
738  memcpy(newpal+3*newNcols, p /* k+1 */, 3);
739  /* ^^^ side effect: make the transparent color black */
740  memcpy(w,k,4); w[4]=newNcols; *op=newNcols++;
741  } else *op=w[4];
742  }
743  p+=3; op++;
744  }
745  // fprintf(stderr,"newTransp=%d transp=%d\n", newTransp, transp);
746 
747  // assert((newTransp==-1) == (transp==-1));
748  assert(newTransp==-1 || transp!=-1);
749  /* ^^^ BUGFIX: == not true, because image may have transparency, but no
750  * transparent pixels.
751  */
752  assert((char*)p==headp+oldNcols*3);
753  if (newNcols==oldNcols && transp==newTransp) {
754  /* Could not change # colors. */
755  if (transp==-1) goto done;
756  if ((unsigned)transp==oldNcols-1) { setPal(transp, 0); goto done; }
757  }
758 
759  /* Make the transparent color last. */
760  if (newTransp!=-1 && newTransp!=(int)newNcols-1) {
761  assert(transp!=-1);
762  unsigned newLast=newNcols-1;
763  memcpy(newpal+3*newTransp, newpal+3*newLast, 3);
764  memset(newpal+3*newLast, 0, 3); transpc=0; /* make it black */
765  for (op=old2new; op!=opend; op++) if (*op==newLast) *op=newTransp;
766  old2new[transp]=newLast;
767  transp=newTransp=newLast;
768  p=newpal+newTransp*3;
769  }
770 
771  /* Update the image. */
772  for (p=(unsigned char*)rowbeg, pend=p+wd*ht; p!=pend; p++) {
773  assert(*p<oldNcols);
774  *p=old2new[*p];
775  }
776 
777  /* Update the palette. */
778  headp=rowbeg-3*newNcols; /* public method getNcols() uses rowbeg-headp */
779  memcpy(headp, newpal, 3*newNcols);
780  transp=newTransp;
781  /* vvv BUGFIX at Tue May 21 13:10:30 CEST 2002 */
782  if (newTransp==-1) transpc=0x1000000UL; /* Dat: this means: no transparent color */
783  else { transp=-1; setTransp(newTransp); }
784 
785  done:
786  sortPal();
787 }
789  /* Run packPal() first (but it's recursive!) if transp is in the middle. */
790  unsigned ncols = getNcols(), i;
791  assert(transp == -1 || transp + 0U == ncols - 1);
792  assert(ncols <= 256);
793  if (ncols == 0) return; /* Safe if ncols == 0 and transp == -1. */
794  if (transp + 0U == ncols - 1) --ncols;
795  if (ncols <= 1) return;
796  #if SIZEOF_SHORT>=4
797  typedef unsigned short d_t;
798  #elif SIZEOF_INT>=4
799  typedef unsigned d_t;
800  #else
801  typedef unsigned long d_t;
802  #endif
803  d_t d[256];
804  unsigned char *p, *pend;
805  for (i = 0, p = (unsigned char*)headp; i < ncols; ++i, p += 3) {
806  d[i] = (d_t)p[0] << 24 | (d_t)p[1] << 16 | (d_t)p[2] << 8 | i;
807  /*printf("c[%d]=0x%08x\n", i, d[i]);*/
808  }
809  for (i = 1; i < ncols; ++i) {
810  if (d[i] < d[i - 1]) break;
811  }
812  if (i >= ncols) return; /* Palette already sorted. */
813 
814  /* Heap sort (unstable). Based on Knuth's TAOCP 5.2.3.H .
815  * Although heap sort is unstable, sortPal implements a stable sort, because
816  * the color index (i) is included in the sorted number (d[i]).
817  */
818  { unsigned k;
819  d_t tmp, *i, *j, *l=d+(ncols>>1), *r=d+ncols-1;
820  while (1) { /* h2: */
821  k=l-d;
822  if (k!=0) {
823  tmp=*--l;
824  } else {
825  tmp=*r; *r=d[0];
826  if (--r==d) { d[0]=tmp; break; }
827  k++;
828  }
829  i=j=l;
830  while ((j+=k)<=r) { /* h4: */
831  k<<=1;
832  if (j<r && j[0]<j[1]) {
833  if (!(tmp<*++j)) break;
834  k++;
835  } else if (!(tmp<*j)) break;
836  *i=*j; i=j;
837  }
838  /* h8: */
839  *i=tmp;
840  }
841  }
842 
843  unsigned char old2new[256];
844  for (i = 0, p = (unsigned char*)headp; i < ncols; ++i) {
845  d_t di = d[i];
846  /*printf("d[%d]=0x%08x\n", i, di);*/
847  assert((i == 0 || di >= d[i - 1]) && "bug in sorting palette");
848  old2new[di & 255] = i;
849  *p++ = di >> 24; *p++ = di >> 16; *p++ = di >> 8;
850  }
851 
852  /* Update the image. */
853  for (p=(unsigned char*)rowbeg, pend=p+wd*ht; p!=pend; p++) {
854  *p=old2new[*p];
855  }
856 }
857 
859  while (*p!=NULLP) delete *p++;
860 }
862  assert(getNcols()>=1);
863  unsigned char ncols1=getNcols()-1;
864  signed nncols=getNcols()-(transp==-1 ? 0 : 1);
865  register unsigned char curcol;
866  Indexed **ret=new Indexed*[nncols+1], **curimg=ret;
868  assert(cpp==1);
869  slen_t wdcpp=wd/* *cpp*/;
870  register unsigned char *p;
871  char *to, *toend;
872  register unsigned int i;
873 
874  ret[nncols]=(Indexed*)NULLP;
875  to8();
876  for (curcol=0; curcol<=ncols1; curcol++) {
877  if (transp==(signed int)curcol) continue;
878  curimg[0]=new Indexed(wd, ht, /*ncols:*/2, /*bpc:*/1);
879  memcpy(curimg[0]->headp, headp+3*curcol, 3); /* copy the color value */
880  curimg[0]->setTransp(1);
881  to=curimg[0]->rowbeg; p=(unsigned char*)rowbeg;
882  htc=ht; while (htc--!=0) {
883  toend=to+((wdcpp+7)>>3);
884  while (to!=toend) {
885  i =(*p++!=curcol)<<7; i|=(*p++!=curcol)<<6;
886  i|=(*p++!=curcol)<<5; i|=(*p++!=curcol)<<4;
887  i|=(*p++!=curcol)<<3; i|=(*p++!=curcol)<<2;
888  i|=(*p++!=curcol)<<1; i|=(*p++!=curcol);
889  *to++=i;
890  }
891  if (0!=(wdcpp&7)) p+=(wdcpp&7)-8; /* negative */
892  }
893  curimg++;
894  }
895  assert(curimg==ret+nncols);
896  return ret;
897 }
898 
900  /* by pts@fazekas.hu at Tue Jun 4 21:27:29 CEST 2002 */
901  assert(getNcols()>=1);
902  packPal(); /* removes transparency if no transparent pixel */
903  if (transp==-1) return (Image::Indexed*)NULLP;
904  to8();
905  Indexed *ret=new Indexed(wd, ht, /*ncols:*/2, /*bpc:*/1);
907  assert(cpp==1);
908  slen_t wdcpp=wd/* *cpp*/;
909  register unsigned char *p;
910  char *to, *toend;
911  register unsigned int i, i8, i7;
912  unsigned char transpx=transp;
913 
914  ret->headp[0]=ret->headp[1]=ret->headp[2]='\xFF'; /* white */
915  ret->headp[3]=ret->headp[4]=ret->headp[5]='\x00'; /* black, transparent */
916  ret->setTransp(1);
917  to=ret->rowbeg; p=(unsigned char*)rowbeg;
918  assert(transpx!=0);
919  #if 0
920  printf("tx=%u\n", transpx);
921  printf("%u %u %u\n", headp[0], headp[1], headp[2]);
922  #endif
923  htc=ht; while (htc--!=0) {
924  // putchar('.'); printf("mod=%d\n",(to-ret->rowbeg)%ret->rlen);
925  // assert((to-ret->rowbeg)%ret->rlen==0);
926  toend=to+(wdcpp>>3); /* ((wdcpp+7)>>3)-1; */
927  /* ^^^ BUGFIX at Tue Sep 17 11:08:46 CEST 2002 */
928  assert(toend>=to);
929  while (to!=toend) {
930  #if 1 /* add ->pal[0] funcitonality at Sat Jun 15 14:24:25 CEST 2002 */
931  i=0; i8=256;
932  /* vvv p[-1]=0 BUGFIX at Sun Dec 8 23:21:47 CET 2002 */
933  while ((i8>>=1)!=0) if (*p++==transpx) { p[-1]=0; i|=i8; }
934  #else
935  i =(*p++==transpx)<<7; i|=(*p++==transpx)<<6;
936  i|=(*p++==transpx)<<5; i|=(*p++==transpx)<<4;
937  i|=(*p++==transpx)<<3; i|=(*p++==transpx)<<2;
938  i|=(*p++==transpx)<<1; i|=(*p++==transpx);
939  #endif
940  *to++=i;
941  }
942  #if 1 /* This works even when p gets modified; this puts fixed 0 pads at EOLs */
943  if ((wdcpp&7)!=0) {
944  i7=1<<(7-(wdcpp&7)); i8=256; i=0;
945  /* vvv p[-1]=0 BUGFIX at Sun Dec 8 23:21:47 CET 2002 */
946  while ((i8>>=1)!=i7) if (*p++==transpx) { p[-1]=0; i|=i8; }
947  *to++=i;
948  }
949  #else
950  if (0!=(wdcpp&7)) p+=(wdcpp&7)-8; /* negative */
951  #endif
952  }
953  assert(ret->rlen==((wd+7)>>3));
954  /* printf("rlen=%d %d\n", ret->rlen, to-ret->rowbeg); */
955  assert(to==ret->rowbeg+ht*ret->rlen);
956  return ret;
957 }
958 
959 void Image::Indexed::setBpc(unsigned char bpc_) {
960  unsigned ncols=getNcols();
961  if (bpc_==0) {
962  if (ncols<=2) bpc_=1;
963  else if (ncols<=4) bpc_=2;
964  else if (ncols<=16) bpc_=4;
965  else bpc_=8;
966  } else {
967  if (bpc_==1) assert(ncols<=2);
968  else if (bpc_==2) assert(ncols<=4);
969  else if (bpc_==4) assert(ncols<=16);
970  else if (bpc_!=8) param_assert(0 && "invalid bpc_");
971  }
972  // fprintf(stderr, "bpc: %u -> %u\n", bpc, bpc_);
973  if (bpc==bpc_) return;
974  to8(); /* Imp: make the transition without the intermediate 8-bits... */
975  if (bpc_==8) return;
976  if (ht==0 || wd==0) { bpc=bpc_; return; }
977 
978  const char *oldBeg=beg;
979  unsigned char *p=(unsigned char*)rowbeg;
980  assert(cpp==1);
981  slen_t wdcpp=wd/* *cpp*/;
982  bpc=bpc_;
983  rlen=(((rlen_t)bpc_)*wd+7)>>3;
984  beg=new char[len=rowbeg-oldBeg+rlen*ht+bpc];
985  headp= const_cast<char*>(beg)+(headp-oldBeg);
986  rowbeg=const_cast<char*>(beg)+(rowbeg-oldBeg);
987  trail= const_cast<char*>(beg)+len-bpc;
988  memcpy(const_cast<char*>(beg), oldBeg, rowbeg-beg);
989 
990  unsigned char *to=(unsigned char*)rowbeg, *toend;
991  unsigned int i;
993  if (bpc_==1) {
994  // This reads bytes from trail.
995  htc=ht; while (htc--!=0) {
996  toend=to+((wdcpp+7)>>3);
997  while (to!=toend) {
998  i =*p++<<7; i|=*p++<<6; i|=*p++<<5; i|=*p++<<4;
999  i|=*p++<<3; i|=*p++<<2; i|=*p++<<1; i|=*p++;
1000  *to++=i;
1001  }
1002  if (0!=(wdcpp&7)) p+=(wdcpp&7)-8; /* negative */
1003  }
1004  } else if (bpc_==2) {
1005  // This reads bytes from trail.
1006  htc=ht; while (htc--!=0) {
1007  toend=to+((wdcpp+3)>>2);
1008  while (to!=toend) {
1009  i =*p++<<6; i|=*p++<<4; i|=*p++<<2; i|=*p++;
1010  *to++=i;
1011  }
1012  if (0!=(wdcpp&3)) p+=(wdcpp&3)-4;
1013  }
1014  } else if (bpc_==4) {
1015  // This reads bytes from trail.
1016  htc=ht; while (htc--!=0) {
1017  toend=to+((wdcpp+1)>>1);
1018  while (to!=toend) {
1019  i =*p++<<4; i|=*p++;
1020  *to++=i;
1021  }
1022  if (0!=(wdcpp&1)) p--;
1023  }
1024  } else assert(0 && "invalid bpc");
1025  delete [] const_cast<char*>(oldBeg);
1026 }
1028  unsigned char *p=(unsigned char*)headp+3*color;
1029  return ((Image::Sampled::rgb_t)p[0]<<16)+(p[1]<<8)+p[2];
1030 }
1031 
1033  gw <<"% ncols=" << getNcols()
1034  << " rlen=" << rlen
1035  << " ht=" << ht
1036  << " wd=" << wd
1037  << " cpp=" << (unsigned)cpp
1038  << " bpc=" << (unsigned)bpc
1039  << " transp=" << transp
1040  << " transpc=" << (transp==-1?"none":rgb2webhash(getPal(transp)))
1041  << " ty=" << (unsigned)ty
1042  //<< " pred=" << (unsigned)pred
1043  << '\n';
1044  unsigned char *p=(unsigned char*)headp;
1045  while (p!=(unsigned char*)rowbeg) {
1046  gw << rgb2webhash(((Image::Sampled::rgb_t)p[0]<<16)+(p[1]<<8)+p[2]) << '\n';
1047  p+=3;
1048  }
1049  gw << '\n';
1050  gw.vi_write(rowbeg,rlen*ht);
1051 }
1052 
1054  // Error::sev(Error::WARNING) << "Indexed: alpha channel ignored" << (Error*)0; return this;
1055  if (al->getHt()!=ht || al->getWd()!=wd) Error::sev(Error::EERROR) << "addAlpha: image dimension mismatch" << (Error*)0;
1056  bool ign_mid=false;
1057  unsigned char lightest, darkest;
1058  al->to8();
1059  al->calcExtrema(lightest, darkest);
1060  if (darkest==255) return this; /* no transparent pixels at all */
1061  to8();
1062  if (transp>=0) { /* Already have a transparent index. Join. */
1063  register char *p=rowbeg;
1064  register unsigned char transp_=transp;
1065  char *pend=rowbeg+rlen*ht, *alq=al->getRowbeg();
1066  /* Imp: choose an image color instead of black... */
1067  /* Dat: 0..254: transparent, 255: opaque */
1068  while (p!=pend) {
1069  if ((unsigned char)(*alq+1)>1) ign_mid=true;
1070  /* fprintf(stderr,"alq=%u\n", (unsigned char)*alq); */
1071  if ((unsigned char)*alq++!=255) p[0]=transp_; /* black out transparent-wannabe pixels */
1072  p++;
1073  }
1074  } else { /* No transparent color yet. */
1075  packPal();
1076  unsigned ncols=getNcols();
1077  char *p=rowbeg, *pend=rowbeg+rlen*ht, *alq=al->getRowbeg();
1078  /* Imp: choose an image color instead of black... */
1079  /* Dat: 0..254: transparent, 255: opaque */
1080  while (p!=pend) {
1081  if ((unsigned char)(*alq+1)>1) ign_mid=true;
1082  /* fprintf(stderr,"alq=%u\n", (unsigned char)*alq); */
1083  if ((unsigned char)*alq++!=255) p[0]=ncols; /* may set to 0 if ncols==256 */
1084  p++;
1085  }
1086  if (ncols==256) { /* Try again, probably now we have fewer colors */
1087  packPal();
1088  if ((ncols=getNcols())==256) Error::sev(Error::EERROR) << "Indexed::addAlpha: too many colors, transparency impossible" << (Error*)0;
1089  for (p=rowbeg,alq=al->getRowbeg(); p!=pend; p++)
1090  if ((unsigned char)*alq++!=255) *p=ncols;
1091  }
1092  setNcolsMove(ncols+1);
1093  setPal(ncols,0); /* black */
1094  setTransp(ncols);
1095  }
1096  if (ign_mid) Error::sev(Error::WARNING) << "addAlpha: half-transparent pixels made transparent" << (Error*)0;
1097  return this;
1098 }
1100  if (transp<1) return; /* no transparency or already 0 */
1101  unsigned char oldBpc=bpc;
1102  register unsigned char transpch=transp;
1103  /* Imp: make this faster by not converting to 8 bits */
1104  if (oldBpc!=8) to8();
1105 
1106  /* Update the image. */
1107  register unsigned char *p; unsigned char *pend;
1108  for (p=(unsigned char*)rowbeg, pend=p+wd*ht; p!=pend; p++) {
1109  if (*p==0) *p=transp;
1110  else if (*p==transpch) *p=0;
1111  }
1112  rgb_t rzero=getPal(0), rtransp=getPal(transp);
1113  setPal(transp, rzero); setPal(0, rtransp);
1114  transp=0;
1115  if (oldBpc!=8) setBpc(oldBpc);
1116 }
1117 
1118 /* --- */
1119 
1121  init(0,0,wd_,ht_,bpc_,TY_GRAY,1);
1122  cs=CS_GRAYSCALE;
1123 }
1124 void Image::Gray::to8() { to8mul(); }
1125 Image::RGB * Image::Gray::toRGB(unsigned char bpc_)/* const*/ { return toRGB0(bpc_); }
1126 Image::Gray* Image::Gray::toGray(unsigned char bpc_)/* const*/ { return bpc==bpc_ ? this : toGray0(bpc_); }
1128  Image::Indexed *img=new Image::Indexed(wd, ht, (1<<bpc), bpc);
1129  unsigned i;
1130  rgb_t rgb;
1131  if (bpc==1) {
1132  img->setPal(0,0);
1133  img->setPal(1,0xffffffL);
1134  } else if (bpc==2) {
1135  img->setPal(0,0);
1136  img->setPal(1,0x555555L);
1137  img->setPal(2,0xaaaaaaL);
1138  img->setPal(3,0xffffffL);
1139  } else if (bpc==4) {
1140  for (i=0,rgb=0;i<16;i++,rgb+=(rgb_t)0x111111L) img->setPal(i,rgb);
1141  } else if (bpc==8) {
1142  for (i=0,rgb=0;i<256;i++,rgb+=(rgb_t)0x010101L) img->setPal(i,rgb);
1143  }
1144  memcpy(img->getRowbeg(), rowbeg, rlen*ht);
1145  return img;
1146 }
1147 bool Image::Gray::canGray() const { return true; }
1149  param_assert(whichrow<ht);
1150  if (wd==0) return;
1151  unsigned char *p=(unsigned char*)rowbeg+rlen*whichrow;
1152  char *toend=to+3*wd;
1153  unsigned int i, j, k;
1154 
1155  if (bpc==1) {
1156  toend-=3*(wd&7);
1157  while (to!=toend) {
1158  i=*p++;
1159  k=(i>>7)*255; *to++=k; *to++=k; *to++=k;
1160  k=((i>>6)&1)*255; *to++=k; *to++=k; *to++=k;
1161  k=((i>>5)&1)*255; *to++=k; *to++=k; *to++=k;
1162  k=((i>>4)&1)*255; *to++=k; *to++=k; *to++=k;
1163  k=((i>>3)&1)*255; *to++=k; *to++=k; *to++=k;
1164  k=((i>>2)&1)*255; *to++=k; *to++=k; *to++=k;
1165  k=((i>>1)&1)*255; *to++=k; *to++=k; *to++=k;
1166  k=( i&1)*255; *to++=k; *to++=k; *to++=k;
1167  }
1168  i=*p; /* No mem overrun, even if (wd&7)==0 */
1169  j=wd&7;
1170  while (j--!=0) { k=(i>>7)*255; *to++=k; *to++=k; *to++=k; i<<=1; }
1171  } else if (bpc==2) {
1172  toend-=3*(wd&3);
1173  while (to!=toend) {
1174  i=*p++;
1175  k=(i>>6)*85; *to++=k; *to++=k; *to++=k;
1176  k=((i>>4)&3)*85; *to++=k; *to++=k; *to++=k;
1177  k=((i>>2)&3)*85; *to++=k; *to++=k; *to++=k;
1178  k=( i&3)*85; *to++=k; *to++=k; *to++=k;
1179  }
1180  i=*p; /* No mem overrun, even if (wd&7)==0 */
1181  j=wd&3;
1182  while (j--!=0) { k=(i>>6)*85; *to++=k; *to++=k; *to++=k; i<<=2; }
1183  } else if (bpc==4) {
1184  toend-=3*(wd&1);
1185  while (to!=toend) {
1186  i=*p++;
1187  k=(i>>4)*17; *to++=k; *to++=k; *to++=k;
1188  k=( i&15)*17; *to++=k; *to++=k; *to++=k;
1189  }
1190  if (0!=(wd&1)) { k=(*p>>4)*17; *to++=k; *to++=k; *to++=k; }
1191  } else if (bpc==8) {
1192  while (to!=toend) { *to++=*p; *to++=*p; *to++=*p++; }
1193  } else assert(0 && "invalid bpc");
1194 }
1195 #if 0
1196 void Image::Gray::setBpc(unsigned char bpc_) {
1197  (void)bpc_;
1198  assert(0 && "unimplemented"); /* unimplemented */
1199 }
1200 #endif
1201 
1203  // Error::sev(Error::WARNING) << "Gray: alpha channel ignored" << (Error*)0; return this;
1204  if (al->getHt()!=ht || al->getWd()!=wd) Error::sev(Error::EERROR) << "addAlpha: image dimension mismatch" << (Error*)0;
1205  bool ign_mid=false;
1206  unsigned char lightest, darkest;
1207  al->to8();
1208  al->calcExtrema(lightest, darkest);
1209  if (darkest==255) return this; /* no transparent pixels at all */
1210  char *p=rowbeg, *pend=rowbeg+rlen*ht, *alq=al->getRowbeg();
1211  /* Imp: choose an image color instead of black... */
1212  /* Dat: 0..254: transparent, 255: opaque */
1213  while (p!=pend) {
1214  if ((unsigned char)(*alq+1)>1) ign_mid=true;
1215  /* fprintf(stderr,"alq=%u\n", (unsigned char)*alq); */
1216  if ((unsigned char)*alq++!=255) *p=0; /* black out transparent-wannabe pixels */
1217  p++;
1218  }
1219  if (ign_mid) Error::sev(Error::WARNING) << "addAlpha: half-transparent pixels made transparent" << (Error*)0;
1220  return addAlpha0(toIndexed(), al);
1221 }
1222 
1223 void Image::Gray::calcExtrema(unsigned char &lightest, unsigned char &darkest) {
1224  to8();
1225  unsigned l=0, d=255, val;
1226  char *p=rowbeg, *pend=rowbeg+ht*wd;
1227  while (p!=pend) {
1228  val=*(unsigned char*)p++;
1229  if (val>l) l=val;
1230  if (val<d) d=val;
1231  }
1232  lightest=l; darkest=d;
1233 }
1234 
1235 
1236 /* --- */
1237 
1239  init(0,0,wd_,ht_,bpc_,TY_RGB,3);
1240  cs=CS_RGB;
1241 }
1242 void Image::RGB::to8() { to8mul(); }
1243 Image::Gray* Image::RGB::toGray(unsigned char bpc_)/* const*/ { return toGray0(bpc_); }
1244 Image::RGB* Image::RGB::toRGB(unsigned char bpc_)/* const*/ { return bpc==bpc_ ? this : toRGB0(bpc_); }
1245 Image::Indexed* Image::RGB::toIndexed()/* const*/ { return toIndexed0(); }
1246 bool Image::RGB::canGray() const { return false; }
1248  param_assert(whichrow<ht);
1249  if (wd==0) return;
1250  unsigned char *p=(unsigned char*)rowbeg+rlen*whichrow;
1251  char *toend=to+3*wd;
1252  unsigned int i, j, k;
1253 
1254  if (bpc==1) {
1255  toend-=(wd*3)&7;
1256  while (to!=toend) {
1257  i=*p++;
1258  k=(i>>7)*255; *to++=k;
1259  k=((i>>6)&1)*255; *to++=k;
1260  k=((i>>5)&1)*255; *to++=k;
1261  k=((i>>4)&1)*255; *to++=k;
1262  k=((i>>3)&1)*255; *to++=k;
1263  k=((i>>2)&1)*255; *to++=k;
1264  k=((i>>1)&1)*255; *to++=k;
1265  k=( i&1)*255; *to++=k;
1266  }
1267  i=*p; /* No mem overrun, even if (wd&7)==0 */
1268  j=(wd*3)&7;
1269  while (j--!=0) { k=(i>>7)*255; *to++=k; i<<=1; }
1270  } else if (bpc==2) {
1271  toend-=(wd*3)&3;
1272  while (to!=toend) {
1273  i=*p++;
1274  k=(i>>6)*85; *to++=k;
1275  k=((i>>4)&3)*85; *to++=k;
1276  k=((i>>2)&3)*85; *to++=k;
1277  k=( i&3)*85; *to++=k;
1278  }
1279  i=*p; /* No mem overrun, even if (wd&7)==0 */
1280  j=(wd*3)&3;
1281  while (j--!=0) { k=(i>>6)*85; *to++=k; i<<=2; }
1282  } else if (bpc==4) {
1283  toend-=(wd*3)&7;
1284  while (to!=toend) {
1285  i=*p++;
1286  k=(i>>4)*17; *to++=k;
1287  k=( i&15)*17; *to++=k;
1288  }
1289  if (0!=((wd*3)&1)) *to++=(*p>>4)*17;
1290  } else if (bpc==8) {
1291  memcpy(to, p, 3*wd);
1292  } else assert(0 && "invalid bpc");
1293 }
1294 #if 0
1295 void Image::RGB::setBpc(unsigned char bpc_) {
1296  (void)bpc_;
1297  assert(0 && "unimplemented"); /* unimplemented */
1298 }
1299 #endif
1300 
1302  if (al->getHt()!=ht || al->getWd()!=wd) Error::sev(Error::EERROR) << "addAlpha: image dimension mismatch" << (Error*)0;
1303  bool ign_mid=false;
1304  unsigned char lightest, darkest;
1305  al->to8();
1306  al->calcExtrema(lightest, darkest);
1307  if (darkest==255) return this; /* no transparent pixels at all */
1308  char *p=rowbeg, *pend=rowbeg+rlen*ht, *alq=al->getRowbeg();
1309  /* Imp: choose an image color instead of black... */
1310  /* Dat: 0..254: transparent, 255: opaque */
1311  while (p!=pend) {
1312  if ((unsigned char)(*alq+1)>1) ign_mid=true;
1313  /* fprintf(stderr,"alq=%u\n", (unsigned char)*alq); */
1314  if ((unsigned char)*alq++!=255) p[0]=p[1]=p[2]=0; /* black out transparent-wannabe pixels */
1315  p+=3;
1316  }
1317  if (ign_mid) Error::sev(Error::WARNING) << "addAlpha: half-transparent pixels made transparent" << (Error*)0;
1318  return addAlpha0(toIndexed(), al);
1319 }
1320 
1321 /* --- */
1322 
1324  static char tmp[8];
1325  char *p=tmp;
1326  *p='#';
1327  *++p='0'+(rgb>>20); if (*p>'9') *p+='a'-'0'-10;
1328  *++p='0'+((rgb>>16)&15); if (*p>'9') *p+='a'-'0'-10;
1329  *++p='0'+((rgb>>12)&15); if (*p>'9') *p+='a'-'0'-10;
1330  *++p='0'+((rgb>>8)&15); if (*p>'9') *p+='a'-'0'-10;
1331  *++p='0'+((rgb>>4)&15); if (*p>'9') *p+='a'-'0'-10;
1332  *++p='0'+((rgb )&15); if (*p>'9') *p+='a'-'0'-10;
1333  *++p='\0';
1334  return tmp;
1335 }
1336 
1338  slen_t buflen=img.getWd()*3;
1339  char *buf=new char[buflen];
1340  Image::Sampled::dimen_t y, ht=img.getHt();
1341  /* vvv in the xv program: image file must be >=30 bytes long to be treated as image */
1342  gw << "P6\n###############\n" << img.getWd() << ' ' << ht;
1343  if (img.getTranspc()>=0x1000000UL) gw << "\n#Opaque";
1344  else gw << "\n#T" << img.rgb2webhash(img.getTranspc());
1345  gw << "\n255\n";
1346  for (y=0; y<ht; y++) {
1347  img.copyRGBRow(buf, y);
1348  gw.vi_write(buf, buflen);
1349  }
1350  delete [] buf;
1351  return gw;
1352 }
1353 
1355 
1357  param_assert(anew!=NULLP);
1358  anew->next=first_image_loader;
1359  first_image_loader=anew;
1360 }
1361 
1362 #if 0 /* removed by code refactoring */
1363 Image::Sampled* Image::load(char const* format, filep_t f_, SimBuffer::Flat const& loadHints) {} /* Removed. */
1364 #endif
1365 
1366 // #include <unistd.h> /* sleep() */
1367 
1368 #if 0
1369 Rule::Sampled *Rule::load(char const* filename) {
1370  static char buf[2*Applier::MAGIC_LEN];
1371  FILE *f=fopen(filename, "rb");
1372  unsigned got=0;
1373  if (f==NULLP) Error::sev(Error::EERROR) << "Cannot open/read image file: " << FNQ(filename) << (Error*)0;
1375  /* vvv Imp: clarify error message: may be a read error */
1376  if (ret==0) Error::sev(Error::EERROR) << "Zero-length image file: " << FNQ(filename) << (Error*)0;
1378 #if 0
1379  unsigned long pos=fseek(f, 0, SEEK_END);
1381  if (0!=fseek(f, pos, SEEK_SET)
1382  || (got=fread(buf+Applier::MAGIC_LEN, 1, Applier::MAGIC_LEN, f))==0
1383 #else
1384  if (0
1385 #endif
1386  || (rewind(f), 0)
1387  || ferror(f))
1388  Error::sev(Error::EERROR) << "I/O error in image file: " << FNQ(filename) << (Error*)0;
1389  if (got!=0 && got!=Applier::MAGIC_LEN) memmove(buf+2*Applier::MAGIC_LEN-got, buf+Applier::MAGIC_LEN, got);
1390  Applier *p=first_image_loader;
1391  Applier::reader_t reader;
1392  while (p!=NULLP) {
1393  if (NULLP!=(reader=p->checker(buf,buf+Applier::MAGIC_LEN))) { return reader(f); }
1394  p=p->next;
1395  }
1396  Error::sev(Error::EERROR) << "Unknown image format: " << FNQ(filename) << (Error*)0;
1397  // Error::sev(Error::WARNING) << "Zero-length image1." << (Error*)0;
1398  // Error::sev(Error::WARNING) << "Zero-length image2." << (Error*)0;
1399  return 0; /*notreached*/
1400 }
1401 #endif
1402 
1403 
1404 Image::Sampled *Image::load(Image::Loader::UFD* ufd0, SimBuffer::Flat const& loadHints, char const* format) {
1406  /* Dat: format arg used in in_pnm.cpp */
1407  static char buf[Loader::MAGIC_LEN+1];
1409  /* vvv Imp: clarify error message: may be a read error */
1410  if (ufd.hadError()) Error::sev(Error::EERROR) << "I/O error pre in image file: " << FNQ(ufd.getFilenameDefault("-")) << (Error*)0;
1411  if (ret==0) Error::sev(Error::EERROR) << "Zero-length image file: " << FNQ(ufd.getFilenameDefault("-")) << (Error*)0;
1413  buf[Loader::MAGIC_LEN]='\0';
1414  /* Dat: do not read the trailer onto buf+Loader::MAGIC_LEN, because no ->checker() uses it yet. */
1415  Loader *p=first_image_loader;
1417  ufd.unread(buf, ret); /* tries to seek back, on failure calls ufd.getUnget().vi_write() */
1418  // ^^^ rewind(f); /* checker might have read */
1419  /* ^^^ do this early for the checkers */
1420  while (p!=NULLP) {
1421  /* vvv each checker() must rewind ufd for itself */
1422  if ((format==(char const*)NULLP || 0==strcmp(p->format, format))
1423  && (Loader::checker_t)0!=p->checker
1424  && (Loader::reader_t)0!=(reader=p->checker(buf,buf+Loader::MAGIC_LEN, loadHints, ufd0))
1425  ) {
1426  // fprintf(stderr, "%p %p\n", ufd0, &ufd);
1427  return reader(ufd0, loadHints);
1428  }
1429  p=p->next;
1430  }
1431  // sleep(1000);
1432  Error::sev(Error::EERROR) << "Unknown input image format: " << FNQ(ufd.getFilenameDefault("-")) << (Error*)0;
1433  return 0; /*notreached*/
1434 }
1435 
1436 #if 0 /* not used anywhere, except in test_main. */
1437 Image::Sampled *Image::load(char const* filename, SimBuffer::Flat const& loadHints, filep_t stdin_f, char const* format) { /* Commented out. */
1438  Filter::UngetFILED ufd(filename, stdin_f==NULLP ? stdin : (FILE*)stdin_f,
1440  return load((Image::Loader::UFD*)&ufd, loadHints, format);
1441  // Imp: better error message, something like: if (f==NULLP) Error::sev(Error::EERROR) << "Cannot open/read image file: " << FNQ(filename) << (Error*)0;
1442 }
1443 #endif
1444 
1445 #if 0 /* before Sat Apr 19 13:42:04 CEST 2003 */
1446 Image::Sampled *Image::load(char const* filename, SimBuffer::Flat const& loadHints, filep_t stdin_f, char const* format) {
1447  /* Dat: format arg used in in_pnm.cpp */
1448  static char buf[2*Loader::MAGIC_LEN];
1449  bool stdin_p=filename[0]=='-' && filename[1]=='\0';
1450  FILE *f=!stdin_p ? fopen(filename, "rb") : stdin_f!=NULLP ? (FILE*)stdin_f : stdin;
1451  unsigned got=0;
1452  if (f==NULLP) Error::sev(Error::EERROR) << "Cannot open/read image file: " << FNQ(filename) << (Error*)0;
1454  /* vvv Imp: clarify error message: may be a read error */
1455  if (ret==0) Error::sev(Error::EERROR) << "Zero-length image file: " << FNQ(filename) << (Error*)0;
1457 #if 0
1458  /* Dat: do not read the trailer, because no ->checker() uses it yet. */
1459  unsigned long pos=fseek(f, 0, SEEK_END);
1461  if (0!=fseek(f, pos, SEEK_SET)
1462  || (got=fread(buf+Loader::MAGIC_LEN, 1, Loader::MAGIC_LEN, f))==0
1463 #else
1464  if (0
1465 #endif
1466  || (rewind(f), 0)
1467  || ferror(f))
1468  Error::sev(Error::EERROR) << "I/O error pre in image file: " << FNQ(filename) << (Error*)0;
1469  if (got!=0 && got!=Loader::MAGIC_LEN) memmove(buf+2*Loader::MAGIC_LEN-got, buf+Loader::MAGIC_LEN, got);
1470  Loader *p=first_image_loader;
1472  while (p!=NULLP) {
1473  if ((format==(char const*)NULLP || 0==strcmp(p->format, format))
1474  && (Loader::checker_t)NULLP!=p->checker
1475  && (Loader::reader_t)NULLP!=(reader=p->checker(buf,buf+Loader::MAGIC_LEN, loadHints, f))
1476  ) {
1477  rewind(f); /* checker might have read */
1478  Image::Sampled *ret=reader(f, loadHints);
1479  if (ferror(f) || (!stdin_p && 0!=fclose(f))) /* don't close stdin */
1480  Error::sev(Error::EERROR) << "I/O error post in image file: " << FNQ(filename) << (Error*)0;
1481  return ret;
1482  }
1483  p=p->next;
1484  }
1485  Error::sev(Error::EERROR) << "Unknown input image format: " << FNQ(filename) << (Error*)0;
1486  // Error::sev(Error::WARNING) << "Zero-length image1." << (Error*)0;
1487  // Error::sev(Error::WARNING) << "Zero-length image2." << (Error*)0;
1488  return 0; /*notreached*/
1489 }
1490 #endif
1491 
1493  unsigned num=0;
1495  while (p!=NULLP) {
1496  if (p->checker!=(Loader::checker_t)0 && p->format!=(char const*)NULLP) { num++; out << ' ' << p->format; }
1497  p=p->next;
1498  }
1499  return num;
1500 }
1501 
1502 /* --- */
1503 
1505  :hasTransp(false)
1506  ,nncols(257)
1507  ,canGray(false)
1508  ,minRGBBpc(8)
1509  ,img(img_)
1510  ,imgs((Indexed**)NULLP) {
1511  param_assert(img_!=NULLP);
1512  Sampled *bak=img;
1513  if ((img=img->toIndexed())==NULLP) {
1514  img=bak;
1515  } else {
1516  if (bak!=img) delete bak;
1517  assert(img->getTy()==img->TY_INDEXED);
1519  /* This packPal() contains a call to sortPal(), which converts the indexed
1520  * image to canonical form.
1521  */
1522  iimg->packPal();
1523  nncols=iimg->getNcols();
1524  if (true==(hasTransp=iimg->hasTransp())) nncols--;
1525  }
1526  minRGBBpc=img->minRGBBpc();
1527  if ((canGray=img->canGray())==true && nncols==257) nncols=256;
1528  sf=(sf_t)((img->getTy()==img->TY_BLACKBOX) ? 0+SF_Asis : 0+SF_None);
1529  /* Dat: 0+: pacify gcc-3.1 */
1530 }
1531 
1533  delete img;
1534  if (imgs!=NULLP) { Image::Indexed::delete_separated(imgs); delete imgs; }
1535 }
1536 
1538  // bool ok;
1539  // ASSERT_SIDE(ok=(sf!=SF_Transparent2 && sf!=SF_Transparent4 && sf!=SF_Transparent8));
1540  // if (!ok) return;
1541  if (sf!=SF_Transparent2 && sf!=SF_Transparent4 && sf!=SF_Transparent8) return;
1542  Indexed *iimg=PTS_dynamic_cast(Indexed*,img);
1543  imgs=iimg->separate();
1544 }
1545 
1546 bool Image::SampledInfo::setSampleFormat(sf_t sf_, bool WarningOK, bool TryOnly, Sampled::rgb_t Transparent) {
1547  /* at Sat Jun 15 11:48:51 CEST 2002: added transparency warnings */
1548  /* fprintf(stderr, "sf=%u sf_=%u transparent=0x%lx\n", sf, sf_, Transparent+0UL); */
1549  // assert(sf_==SF_Asis);
1550  Indexed *iimg;
1551  Sampled *bak=img;
1552  param_assert(sf_!=SF_None);
1553  param_assert(sf==SF_None || sf==SF_Asis || sf==sf_);
1554  if (sf_==sf) return true; /* already converted */
1555  bool zero=img->getWd()==0 || img->getHt()==0;
1556  if (sf==SF_Asis && sf_!=SF_Asis && sf_!=SF_Bbox) {
1557  Error::sev(Error::WARNING) << "SampleFormat: can't convert image loaded as Asis to other" << (Error*)0;
1558  return false;
1559  }
1560  switch (sf_) {
1561  case SF_Bbox:
1562  sf=SF_Bbox; return true;
1563  case SF_Opaque:
1564  if (!hasTransp && nncols==1 && PTS_dynamic_cast(Indexed*,img)->wouldSetTranspc(Transparent)) return false;
1565  if (hasTransp || nncols!=1) return false;
1566  assert(img->getTy()==img->TY_INDEXED);
1567  /* The color can be calculated: PTS_dynamic_cast(Indexed*>(img)->getPal(0); */
1568  /* Conversion is not necessary. */
1569  sf=SF_Opaque; return true;
1570  case SF_Transparent:
1571  if (!hasTransp && nncols==1 && PTS_dynamic_cast(Indexed*,img)->setTranspc(Transparent)) {
1572  /* Must return true eventually, because setTranspc has modified the image. */
1573  hasTransp=true; nncols=0;
1574  } else if (!hasTransp || nncols!=0) {
1575  return false;
1576  }
1577  assert(img->getTy()==img->TY_INDEXED);
1578  /* Conversion is not necessary. */
1579  sf=SF_Transparent; return true;
1580  case SF_Gray1:
1581  /* vvv strict hasTransp added at Mon Sep 9 22:53:24 CEST 2002 */
1582  if (nncols>2 || !canGray || minRGBBpc>1 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1583  /* ^^^ Imp: !! make the hasPixelRFB() check a lot faster (cache results) */
1584  if (TryOnly) return WarningOK || (nncols>=2 && !hasTransp);
1585  if (hasTransp) {
1586  if (!WarningOK) return false;
1587  /* Dat: nncols may be 1 or 2 ! (both transparent and opaque black) */
1589  (nncols<=1 ? "SampleFormat: Mask would be better than "
1590  : "SampleFormat: Transparent2 would be better than ")
1591  << "Gray1" << (Error*)0;
1592  }
1593  if (nncols<2) {
1594  if (!WarningOK) return false;
1595  Error::sev(Error::WARNING) << "SampleFormat: Opaque would be better than Gray1" << (Error*)0;
1596  }
1597  img=img->toGray(1); if (bak!=img) delete bak;
1598  assert(img!=NULLP);
1599  assert(img->getBpc()==1);
1600  sf=SF_Gray1; return true;
1601  case SF_Indexed1:
1602  if (nncols>2 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1603  if (TryOnly) return WarningOK || nncols>=2;
1604  if (nncols<2) {
1605  if (!WarningOK) return false;
1606  Error::sev(Error::WARNING) << "SampleFormat: Opaque would be better than Indexed1" << (Error*)0;
1607  }
1608  if (canGray && minRGBBpc==1) {
1609  Error::sev(Error::NOTICE) << "SampleFormat: Gray1 would be better than Indexed1" << (Error*)0;
1610  }
1611  assert(img->getTy()==img->TY_INDEXED);
1612  // img=img->toIndexed(); /* should be a no-op */
1613  // assert(img!=NULLP); if (bak!=img) delete bak;
1614  { iimg=PTS_dynamic_cast(Indexed*,img);
1615  iimg->setBpc(1);
1616  if (iimg->wouldSetTranspc(Transparent)) return false; /* Dat: false if must be changed to become transparent. */
1617  iimg->setTranspcAndRepack(Transparent);
1618  }
1619  sf=SF_Indexed1; return true;
1620  case SF_Mask:
1621  if (!hasTransp && nncols==2 && PTS_dynamic_cast(Indexed*,img)->wouldSetTranspc(Transparent)) { hasTransp=true; --nncols; }
1622  if (nncols>1 || zero) return false;
1623  if (TryOnly) return WarningOK || nncols+(hasTransp?1:0)==2;
1624  if (nncols==1 && !hasTransp) {
1625  if (!WarningOK) return false;
1626  Error::sev(Error::WARNING) << "SampleFormat: Opaque would be better than Mask" << (Error*)0;
1627  }
1628  if (nncols==0) {
1629  assert(hasTransp);
1630  Error::sev(Error::WARNING) << "SampleFormat: Transparent would be better than Mask" << (Error*)0;
1631  }
1632  assert(img->getTy()==img->TY_INDEXED);
1633  { iimg=PTS_dynamic_cast(Indexed*,img);
1634  iimg->setBpc(1);
1635  if (!iimg->wouldSetTranspc(Transparent)) return false;
1636  iimg->setTranspcAndRepack(Transparent);
1637  }
1638  /* printf("gett=%d\n", PTS_dynamic_cast(Indexed*,img)->getTransp()); */
1639  /* vvv BUGFIX: <1U -> <2U */
1640  assert(PTS_dynamic_cast(Indexed*,img)->getTransp()==-1 || PTS_dynamic_cast(Indexed*,img)->getTransp()+0U<2U);
1641  /* ^^^ color 0 is opaque, color 1 is transparent, thanks to
1642  * img->packPal() called in SampleInfo() -- but setTranspc may have changed this
1643  */
1644  sf=SF_Mask; return true;
1645  case SF_Transparent2:
1646  if (!hasTransp && nncols==4 && PTS_dynamic_cast(Indexed*,img)->wouldSetTranspc(Transparent)) { hasTransp=true; --nncols; }
1647  if (nncols>3 || zero) return false;
1648  if (TryOnly) return WarningOK || (hasTransp && nncols>=2);
1649  Error::sev(Error::NOTICE) << "SampleFormat: Transparent2 separates colors" << (Error*)0;
1650  if (!hasTransp) {
1651  if (!WarningOK) return false;
1652  Error::sev(Error::WARNING) << "SampleFormat: Indexed2 would be better than Transparent2" << (Error*)0;
1653  }
1654  if (nncols<2) {
1655  if (!WarningOK) return false;
1656  Error::sev(Error::WARNING) << "SampleFormat: Mask would be better than Transparent2" << (Error*)0;
1657  }
1658  assert(img->getTy()==img->TY_INDEXED);
1659  { iimg=PTS_dynamic_cast(Indexed*,img);
1660  iimg->setBpc(2); /* BUGFIX at Sat Jun 15 13:55:25 CEST 2002 */
1661  iimg->setTranspcAndRepack(Transparent);
1662  // imgs=iimg->separate(); /* postponed because of GIF89a output */
1663  }
1664  sf=SF_Transparent2; return true;
1665  case SF_Gray2:
1666  if (nncols>4 || !canGray || minRGBBpc>2 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1667  if (TryOnly) return WarningOK || (nncols>2 && !hasTransp);
1668  if (hasTransp) {
1669  if (!WarningOK) return false;
1671  (nncols<=3 ? "SampleFormat: Transparent2 would be better than "
1672  : "SampleFormat: Transparent4 would be better than ")
1673  << "Gray2" << (Error*)0;
1674  }
1675  if (nncols<=2) {
1676  if (!WarningOK) return false;
1677  Error::sev(Error::WARNING) << "SampleFormat: Gray1 would be better than Gray2" << (Error*)0;
1678  }
1679  img=img->toGray(2); if (bak!=img) delete bak;
1680  assert(img!=NULLP);
1681  sf=SF_Gray2; return true;
1682  case SF_Indexed2:
1683  if (nncols>4 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1684  if (TryOnly) return WarningOK || nncols>2;
1685  if (nncols<=2) {
1686  if (!WarningOK) return false;
1687  Error::sev(Error::WARNING) << "SampleFormat: Indexed1 would be better than Indexed2" << (Error*)0;
1688  }
1689  if (canGray && minRGBBpc<=2) {
1690  Error::sev(Error::NOTICE) << "SampleFormat: Gray2 would be better than Indexed2" << (Error*)0;
1691  }
1692  assert(img->getTy()==img->TY_INDEXED);
1693  { iimg=PTS_dynamic_cast(Indexed*,img);
1694  iimg->setBpc(2);
1695  if (iimg->wouldSetTranspc(Transparent)) return false;
1696  iimg->setTranspcAndRepack(Transparent);
1697  }
1698  sf=SF_Indexed2; return true;
1699  case SF_Transparent4:
1700  if (!hasTransp && nncols==16 && PTS_dynamic_cast(Indexed*,img)->wouldSetTranspc(Transparent)) { hasTransp=true; --nncols; }
1701  if (nncols>15 || zero) return false;
1702  if (TryOnly) return WarningOK || (hasTransp && nncols>=4);
1703  Error::sev(Error::NOTICE) << "SampleFormat: Transparent4 separates colors" << (Error*)0;
1704  if (!hasTransp) {
1705  if (!WarningOK) return false;
1706  Error::sev(Error::WARNING) << "SampleFormat: Indexed4 would be better than Transparent4" << (Error*)0;
1707  }
1708  if (nncols<4) {
1709  if (!WarningOK) return false;
1710  Error::sev(Error::WARNING) << "SampleFormat: Transparent2 would be better than Transparent4" << (Error*)0;
1711  }
1712  assert(img->getTy()==img->TY_INDEXED);
1713  { iimg=PTS_dynamic_cast(Indexed*,img);
1714  iimg->setBpc(4);
1715  iimg->setTranspcAndRepack(Transparent);
1716  // imgs=iimg->separate(); /* postponed because of GIF89a output */
1717  }
1718  sf=SF_Transparent4; return true;
1719  case SF_Rgb1:
1720  if (nncols>8 || minRGBBpc>1 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1721  if (TryOnly) return WarningOK || (nncols>4 && !canGray && !hasTransp);
1722  if (hasTransp) {
1723  if (!WarningOK) return false;
1724  Error::sev(Error::WARNING) << "SampleFormat: Transparent4 would be better than " << "Rgb1" << (Error*)0;
1725  }
1726  if (canGray) {
1727  if (!WarningOK) return false;
1728  Error::sev(Error::WARNING) << "SampleFormat: Gray1 would be better than Rgb1" << (Error*)0;
1729  }
1730  if (nncols<=4) {
1731  if (!WarningOK) return false;
1732  Error::sev(Error::WARNING) << "SampleFormat: "
1733  << (hasTransp ? "Transparent2 may" : "Indexed2 would")
1734  << " be better than Rgb1" << (Error*)0;
1735  }
1736  img=img->toRGB(1); if (bak!=img) delete bak;
1737  assert(img!=NULLP);
1738  sf=SF_Rgb1; return true;
1739  case SF_Gray4:
1740  if (nncols>16 || !canGray || minRGBBpc>4 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1741  /* ^^^ BUGFIX at Sat Jun 1 18:27:10 CEST 2002 */
1742  if (TryOnly) return WarningOK || (nncols>4 && !hasTransp);
1743  if (hasTransp) {
1744  if (!WarningOK) return false;
1746  (nncols<=15 ? "SampleFormat: Transparent4 would be better than "
1747  : "SampleFormat: Transparent8 may be better than ")
1748  << "Gray4" << (Error*)0;
1749  }
1750  if (nncols<=4) {
1751  if (!WarningOK) return false;
1752  Error::sev(Error::WARNING) << "SampleFormat: Gray2 would be better than Gray4" << (Error*)0;
1753  }
1754  img=img->toGray(4); if (bak!=img) delete bak;
1755  assert(img!=NULLP);
1756  sf=SF_Gray4; return true;
1757  case SF_Indexed4:
1758  if (nncols>16 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1759  if (TryOnly) return WarningOK || (nncols>4 && minRGBBpc>=4);
1760  if (nncols<=4) {
1761  if (!WarningOK) return false;
1762  Error::sev(Error::WARNING) << "SampleFormat: Indexed2 would be better than Indexed4" << (Error*)0;
1763  }
1764  if (minRGBBpc<=1) {
1765  if (!WarningOK) return false;
1766  Error::sev(Error::WARNING) << "SampleFormat: RGB1 would be better than Indexed4" << (Error*)0;
1767  }
1768  if (canGray && minRGBBpc<=4) {
1769  if (!WarningOK) return false;
1770  Error::sev(Error::NOTICE) << "SampleFormat: Gray4 would be better than Indexed4" << (Error*)0;
1771  }
1772  assert(img->getTy()==img->TY_INDEXED);
1773  { iimg=PTS_dynamic_cast(Indexed*,img);
1774  iimg->setBpc(4);
1775  if (iimg->wouldSetTranspc(Transparent)) return false;
1776  iimg->setTranspcAndRepack(Transparent);
1777  }
1778  sf=SF_Indexed4; return true;
1779  case SF_Transparent8:
1780  if (!hasTransp && nncols==256 && PTS_dynamic_cast(Indexed*,img)->wouldSetTranspc(Transparent)) { hasTransp=true; --nncols; }
1781  if (nncols>255 || zero) return false;
1782  if (!WarningOK) return false;
1783  if (TryOnly) return true;
1784  Error::sev(Error::WARNING) << "SampleFormat: Transparent8 separates too many colors" << (Error*)0;
1785  if (!hasTransp) {
1786  Error::sev(Error::WARNING) << "SampleFormat: Indexed8 would be much better than Transparent8" << (Error*)0;
1787  }
1788  if (nncols<16) {
1789  Error::sev(Error::WARNING) << "SampleFormat: Transparent4 would be better than Transparent8" << (Error*)0;
1790  }
1791  assert(img->getTy()==img->TY_INDEXED);
1792  { iimg=PTS_dynamic_cast(Indexed*,img);
1793  iimg->setBpc(8); /* should be a no-op */
1794  iimg->setTranspcAndRepack(Transparent);
1795  // imgs=iimg->separate(); /* postponed because of GIF89a output */
1796  }
1797  sf=SF_Transparent8; return true;
1798  case SF_Rgb2:
1799  if (nncols>64 || minRGBBpc>2 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1800  if (TryOnly) return WarningOK || (nncols>16 && !canGray && !hasTransp);
1801  if (hasTransp) {
1802  if (!WarningOK) return false;
1803  Error::sev(Error::WARNING) << "SampleFormat: Transparent8 would be better than " << "Rgb2" << (Error*)0;
1804  }
1805  if (canGray) {
1806  if (!WarningOK) return false;
1807  Error::sev(Error::WARNING) << "SampleFormat: Gray2 would be better than Rgb2" << (Error*)0;
1808  }
1809  if (nncols<=16) {
1810  if (!WarningOK) return false;
1811  Error::sev(Error::WARNING) << "SampleFormat: "
1812  << (hasTransp ? "Transparent4 may" : "Indexed4 would")
1813  << " be better than Rgb2" << (Error*)0;
1814  }
1815  img=img->toRGB(2); if (bak!=img) delete bak;
1816  assert(img!=NULLP);
1817  sf=SF_Rgb2; return true;
1818  case SF_Gray8:
1819  if (nncols>256 || !canGray || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1820  if (TryOnly) return WarningOK || (nncols>16 && !hasTransp);
1821  if (hasTransp) {
1822  if (!WarningOK) return false;
1824  (nncols<=255 ? "SampleFormat: Transparent8 may be better than "
1825  : "SampleFormat: ignoring transparency for ")
1826  << "Gray8" << (Error*)0;
1827  }
1828  if (minRGBBpc<=4) {
1829  /* BUGFIX at Wed Jul 3 01:07:44 CEST 2002 */
1830  if (!WarningOK) return false;
1831  Error::sev(Error::WARNING) << "SampleFormat: Gray4 would be better than Gray8" << (Error*)0;
1832  }
1833  img=img->toGray(8); if (bak!=img) delete bak;
1834  assert(img!=NULLP);
1835  sf=SF_Gray8; return true;
1836  case SF_Indexed8:
1837  // fprintf(stderr, "nncols=%u hasTransp=%u zero=%u\n", nncols, hasTransp, zero);
1838  if (nncols>256 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1839  // assert(0);
1840  if (TryOnly) return WarningOK || (nncols>16 && minRGBBpc>=8);
1841  if (nncols<=16) {
1842  if (!WarningOK) return false;
1843  Error::sev(Error::WARNING) << "SampleFormat: Indexed4 would be better than Indexed8" << (Error*)0;
1844  }
1845  if (minRGBBpc<=2) {
1846  if (!WarningOK) return false;
1847  Error::sev(Error::WARNING) << "SampleFormat: RGB2 would be better than Indexed8" << (Error*)0;
1848  }
1849  if (canGray) {
1850  if (!WarningOK) return false;
1851  Error::sev(Error::NOTICE) << "SampleFormat: Gray8 would be better than Indexed8" << (Error*)0;
1852  }
1853  assert(img->getTy()==img->TY_INDEXED);
1854  { iimg=PTS_dynamic_cast(Indexed*,img);
1855  iimg->setBpc(8); /* should be a no-op */
1856  if (iimg->wouldSetTranspc(Transparent)) return false;
1857  iimg->setTranspcAndRepack(Transparent);
1858  }
1859  sf=SF_Indexed8; return true;
1860  case SF_Rgb4:
1861  // fprintf(stderr, "minrgbbpc=%d to=%d\n", minRGBBpc, TryOnly);
1862  if (minRGBBpc>4 || zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1863  if (TryOnly) return WarningOK || (nncols>256 && !canGray && !hasTransp);
1864  if (hasTransp) {
1865  if (!WarningOK) return false;
1867  (nncols<=255 ? "SampleFormat: Transparent8 may be better than "
1868  : "SampleFormat: ignoring transparency for ")
1869  << "Rgb4" << (Error*)0;
1870  }
1871  if (canGray) {
1872  if (!WarningOK) return false;
1873  Error::sev(Error::WARNING) << "SampleFormat: Gray4 would be better than Rgb4" << (Error*)0;
1874  }
1875  if (nncols<=256) {
1876  if (!WarningOK) return false;
1877  Error::sev(Error::WARNING) << "SampleFormat: "
1878  << (hasTransp && nncols<=255 ? "Transparent8 may" : "Indexed8 would")
1879  << " be better than Rgb4" << (Error*)0;
1880  }
1881  img=img->toRGB(4); if (bak!=img) delete bak;
1882  assert(img!=NULLP);
1883  sf=SF_Rgb4; return true;
1884  case SF_Rgb8:
1885  if (zero || hasTransp || img->hasPixelRGB(Transparent)) return false;
1886  if (TryOnly) return WarningOK || (nncols>256 && !canGray && minRGBBpc>=8 && !hasTransp);
1887  if (hasTransp) {
1888  if (!WarningOK) return false;
1890  (nncols<=255 ? "SampleFormat: Transparent8 may be better than "
1891  : "SampleFormat: ignoring transparency for ")
1892  << "Rgb8" << (Error*)0;
1893  }
1894  if (canGray) {
1895  if (!WarningOK) return false;
1896  Error::sev(Error::WARNING) << "SampleFormat: Gray8 would be better than Rgb8" << (Error*)0;
1897  }
1898  if (minRGBBpc<=4) {
1899  if (!WarningOK) return false;
1900  Error::sev(Error::WARNING) << "SampleFormat: Rgb4 would be better than Rgb8" << (Error*)0;
1901  }
1902  if (nncols<=256) {
1903  if (!WarningOK) return false;
1904  Error::sev(Error::WARNING) << "SampleFormat: "
1905  << (hasTransp && nncols<=255 ? "Transparent8 may" : "Indexed8 would")
1906  << " be better than Rgb8" << (Error*)0;
1907  }
1908  img=img->toRGB(8); if (bak!=img) delete bak;
1909  assert(img!=NULLP);
1910  sf=SF_Rgb8; return true;
1911  case SF_Asis:
1912  if (img->getTy()!=img->TY_BLACKBOX) {
1913  Error::sev(Error::WARNING) << "SampleFormat: cannot convert image to /Asis" << (Error*)0;
1914  return false;
1915  }
1916  sf=SF_Asis; return true;
1917  }
1918  assert(0 && "unknown SampleFormat requested");
1919  return false; /* NOTREACHED */
1920 }
1921 
1922 /* __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
#define buflen
Definition: afm2pl.c:181
Definition: error.hpp:20
static GenBuffer::Writable & sev(level_t level)
Definition: error.cpp:58
@ NOTICE
Definition: error.hpp:33
@ EERROR
Definition: error.hpp:29
@ WARNING
Definition: error.hpp:31
void unread(char const *s, slen_t slen)
Definition: gensio.cpp:406
bool hadError() const
Definition: gensio.hpp:262
char const * getFilenameDefault(char const *def) const
Definition: gensio.hpp:261
virtual slen_t vi_read(char *buf, slen_t len)
Definition: gensio.cpp:251
virtual void vi_write(char const *, slen_t)=0
Definition: image.cpp:53
unsigned getLength() const
Definition: image.cpp:58
unsigned getSize() const
Definition: image.cpp:57
unsigned size
Definition: image.cpp:73
bool isFull() const
Definition: image.cpp:60
unsigned char * walk(unsigned char k[4])
Definition: image.cpp:81
Hash46()
Definition: image.cpp:77
unsigned getMaxSize() const
Definition: image.cpp:59
unsigned char * lookup(unsigned char k[4])
Definition: image.cpp:62
virtual RGB * toRGB(unsigned char bpc_)
Definition: image.cpp:1125
virtual Sampled * addAlpha(Gray *al)
Definition: image.cpp:1202
virtual bool hasPixelRGB(Image::Sampled::rgb_t rgb) const
Definition: image.cpp:467
virtual void copyRGBRow(char *to, dimen_t whichrow) const
Definition: image.cpp:1148
virtual Indexed * toIndexed()
Definition: image.cpp:1127
virtual void to8()
Definition: image.cpp:1124
virtual bool canGray() const
Definition: image.cpp:1147
void calcExtrema(unsigned char &lightest, unsigned char &darkest)
Definition: image.cpp:1223
virtual Gray * toGray(unsigned char bpc_)
Definition: image.cpp:1126
Gray(dimen_t wd_, dimen_t ht_, unsigned char bpc_)
Definition: image.cpp:1120
void setTranspcAndRepack(rgb_t color)
Definition: image.cpp:595
virtual Sampled * addAlpha(Gray *al)
Definition: image.cpp:1053
void setNcolsMove(unsigned short ncols_)
Definition: image.cpp:525
void setTransp(unsigned char coloridx)
Definition: image.cpp:557
void sortPal()
Definition: image.cpp:788
Indexed(dimen_t wd_, dimen_t ht_, unsigned short ncols_, unsigned char bpc_)
Definition: image.cpp:515
virtual bool canGray() const
Definition: image.cpp:620
static void delete_separated(Indexed **p)
Definition: image.cpp:858
virtual Indexed * toIndexed()
Definition: image.cpp:617
virtual unsigned char minRGBBpc() const
Definition: image.cpp:637
void setPal(unsigned char coloridx, rgb_t rgb)
Definition: image.cpp:550
void setNcols(unsigned short ncols_)
Definition: image.cpp:522
virtual void setBpc(unsigned char bpc_)
Definition: image.cpp:959
virtual Gray * toGray(unsigned char bpc_)
Definition: image.cpp:619
bool setTranspc(rgb_t color)
Definition: image.cpp:565
virtual void to8()
Definition: image.cpp:616
Indexed * calcAlpha()
Definition: image.cpp:899
Indexed ** separate()
Definition: image.cpp:861
virtual RGB * toRGB(unsigned char bpc_)
Definition: image.cpp:618
virtual void copyRGBRow(char *to, dimen_t whichrow) const
Definition: image.cpp:651
bool wouldSetTranspc(rgb_t color) const
Definition: image.cpp:581
unsigned short getNcols() const
Definition: image.hpp:158
rgb_t getPal(unsigned char coloridx) const
Definition: image.cpp:1027
void packPal()
Definition: image.cpp:701
void makeTranspZero()
Definition: image.cpp:1099
void dumpDebug(GenBuffer::Writable &gw)
Definition: image.cpp:1032
virtual Sampled * addAlpha(Gray *al)
Definition: image.cpp:1301
virtual void to8()
Definition: image.cpp:1242
virtual RGB * toRGB(unsigned char bpc_)
Definition: image.cpp:1244
RGB(dimen_t wd_, dimen_t ht_, unsigned char bpc_)
Definition: image.cpp:1238
virtual bool canGray() const
Definition: image.cpp:1246
virtual void copyRGBRow(char *to, dimen_t whichrow) const
Definition: image.cpp:1247
virtual Gray * toGray(unsigned char bpc_)
Definition: image.cpp:1243
virtual Indexed * toIndexed()
Definition: image.cpp:1245
bool setSampleFormat(sf_t sf, bool WarningOK, bool TryOnly, Sampled::rgb_t Transparent)
Definition: image.cpp:1546
unsigned char minRGBBpc
Definition: image.hpp:388
Sampled * img
Definition: image.hpp:389
SampledInfo(Sampled *img_)
Definition: image.cpp:1504
unsigned nncols
Definition: image.hpp:385
unsigned long rgb_t
Definition: image.hpp:47
unsigned char getTy() const
Definition: image.hpp:125
char * getRowbeg() const
Definition: image.hpp:122
char * rowbeg
Definition: image.hpp:66
void to8nomul()
Definition: image.cpp:362
unsigned char getBpc() const
Definition: image.hpp:126
unsigned char cs
Definition: image.hpp:81
virtual unsigned char minRGBBpc() const
Definition: image.cpp:434
unsigned int dimen_t
Definition: image.hpp:40
char * getHeadp() const
Definition: image.hpp:132
Indexed * toIndexed0()
Definition: image.cpp:257
virtual Indexed * toIndexed()=0
dimen_t getWd() const
Definition: image.hpp:123
virtual bool hasPixelRGB(Image::Sampled::rgb_t rgb) const
Definition: image.cpp:450
dimen_t getHt() const
Definition: image.hpp:124
virtual void copyRGBRow(char *to, dimen_t whichrow) const =0
static const unsigned char cs2cpp[6]
Definition: image.hpp:61
static char * rgb2webhash(rgb_t)
Definition: image.cpp:1323
rlen_t getRlen() const
Definition: image.hpp:130
unsigned int rlen_t
Definition: image.hpp:42
void init(slen_t l_comment, slen_t l_header, dimen_t wd_, dimen_t ht_, unsigned char bpc_, unsigned char ty_, unsigned char cpp_)
Definition: image.cpp:141
static Indexed * addAlpha0(Indexed *iimg, Gray *al)
Definition: image.cpp:491
RGB * toRGB0(unsigned char bpc_)
Definition: image.cpp:212
virtual bool canGray() const =0
Gray * toGray0(unsigned char bpc_)
Definition: image.cpp:165
static char const * cs2devcs(unsigned char cs)
Definition: image.cpp:105
void to8mul()
Definition: image.cpp:293
rgb_t getTranspc() const
Definition: image.hpp:131
bool hasTransp() const
Definition: image.hpp:111
void * filep_t
Definition: image.hpp:265
static unsigned printLoaders(GenBuffer::Writable &)
Definition: image.cpp:1492
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
static void register0(Loader *)
Definition: image.cpp:1356
static Sampled * load(Loader::UFD *ufd, SimBuffer::Flat const &loadHints, char const *format)
unsigned int slen_t
Definition: config2.h:37
#define NULLP
Definition: config2.h:66
#define FNQ(filename)
Definition: config2.h:91
#define PTS_dynamic_cast(ptrtype, ptr)
Definition: config2.h:293
#define param_assert
Definition: config2.h:96
#define b
Definition: jpegint.h:372
int w
Definition: dviconv.c:26
int h
Definition: dviconv.c:9
#define fopen
Definition: xxstdio.h:21
#define fread
Definition: xxstdio.h:25
#define fseek
Definition: xxstdio.h:30
int strcmp()
Definition: coll.cpp:143
int printf()
static void
Definition: fpif.c:118
mpz_t * f
Definition: gen-fib.c:34
#define tp
#define c(n)
Definition: gpos-common.c:150
#define a(n)
Definition: gpos-common.c:148
#define d(n)
Definition: gpos-common.c:151
#define memmove(d, s, n)
Definition: gsftopk.c:65
#define memcpy(d, s, n)
Definition: gsftopk.c:64
FILE * out
Definition: hbf2gf.c:286
unsigned int u32_t
Definition: image.cpp:20
const unsigned D
Definition: image.cpp:30
GenBuffer::Writable & operator<<(GenBuffer::Writable &gw, Image::Sampled const &img)
Definition: image.cpp:1337
static slen_t add_check(slen_t a, slen_t b)
Definition: image.cpp:125
const unsigned HD
Definition: image.cpp:32
static Image::Loader * first_image_loader
Definition: image.cpp:1354
const unsigned M
Definition: image.cpp:28
static void fatal_image_too_large()
Definition: image.cpp:110
const unsigned char FREE
Definition: image.cpp:34
static slen_t multiply_check(slen_t a, slen_t b)
Definition: image.cpp:114
signed int s32_t
Definition: image.cpp:21
pinfo pal
Definition: in_pcx.cpp:145
assert(pcxLoadImage24((char *)((void *) 0), fp, pinfo, hdr))
static const unsigned char CS_RGB
static const unsigned char CS_Indexed_RGB
static const unsigned char CS_GRAYSCALE
#define SEEK_SET
Definition: jmemansi.c:26
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p
Definition: afcover.h:72
small capitals from c petite p scientific i
Definition: afcover.h:80
#define SEEK_END
Definition: ftzconf.h:251
#define false
Definition: ftrandom.c:52
kerning y
Definition: ttdriver.c:212
int num
Definition: disdvi.c:621
#define buf
#define fclose
Definition: debug.h:100
static int ret
Definition: convert.c:72
const int * pos
Definition: combiners.h:905
#define MAGIC_LEN
Definition: minigimp.c:1450
#define RGB
Definition: mitsu.h:92
cpp
Definition: cutout.py:14
list names
Definition: fc-lang.py:151
int k
Definition: otp-parser.c:70
static int format
Definition: pbmclean.c:15
static int delta
Definition: pbmtolj.c:36
char * filename[256]
Definition: pbmtopk.c:46
static bool transp
Definition: pdftocairo.cc:118
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld endif[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
#define zero
real to[600]
Definition: pmxab.c:87
static int size
Definition: ppmlabel.c:24
int r
Definition: ppmqvga.c:68
static int curcol
Definition: ppmtoacad.c:35
bstring c int memset(void *s, int c, int length)
static const char * reader(lua_State *L, void *ud, size_t *size)
Definition: luac.c:122
#define rzero(a)
Definition: avl.c:93
#define load(x, t)
Definition: interp.c:111
static Filter::UngetFILED * ufd
Definition: sam2p_main.cpp:269
Loader * next
Definition: image.hpp:293
Sampled *(* reader_t)(UFD *ufd, SimBuffer::Flat const &loadHints)
Definition: image.hpp:276
reader_t(* checker_t)(char buf[MAGIC_LEN], char bufend[MAGIC_LEN], SimBuffer::Flat const &loadHints, UFD *ufd)
Definition: image.hpp:285
Definition: pdfdev.c:706
Definition: pst1form.c:310
Definition: sh.h:1226
Definition: jpegtopnm.c:237
Definition: tfmaux.c:31
Definition: dvips.h:235
Definition: strexpr.c:21
#define FILE
Definition: t1stdio.h:34
#define ferror(f)
Definition: t1stdio.h:110
int j
Definition: t4ht.c:1589
val
Definition: tex4ht.c:3227
#define U(a)
Definition: twiddle.h:1