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)  

CairoOutputDev.cc
Go to the documentation of this file.
1 //========================================================================
2 //
3 // CairoOutputDev.cc
4 //
5 // Copyright 2003 Glyph & Cog, LLC
6 // Copyright 2004 Red Hat, Inc
7 //
8 //========================================================================
9 
10 //========================================================================
11 //
12 // Modified under the Poppler project - http://poppler.freedesktop.org
13 //
14 // All changes made under the Poppler project to this file are licensed
15 // under GPL version 2 or later
16 //
17 // Copyright (C) 2005-2008 Jeff Muizelaar <jeff@infidigm.net>
18 // Copyright (C) 2005, 2006 Kristian Høgsberg <krh@redhat.com>
19 // Copyright (C) 2005, 2009, 2012, 2017-2021 Albert Astals Cid <aacid@kde.org>
20 // Copyright (C) 2005 Nickolay V. Shmyrev <nshmyrev@yandex.ru>
21 // Copyright (C) 2006-2011, 2013, 2014, 2017, 2018 Carlos Garcia Campos <carlosgc@gnome.org>
22 // Copyright (C) 2008 Carl Worth <cworth@cworth.org>
23 // Copyright (C) 2008-2018 Adrian Johnson <ajohnson@redneon.com>
24 // Copyright (C) 2008 Michael Vrable <mvrable@cs.ucsd.edu>
25 // Copyright (C) 2008, 2009 Chris Wilson <chris@chris-wilson.co.uk>
26 // Copyright (C) 2008, 2012 Hib Eris <hib@hiberis.nl>
27 // Copyright (C) 2009, 2010 David Benjamin <davidben@mit.edu>
28 // Copyright (C) 2011-2014 Thomas Freitag <Thomas.Freitag@alfa.de>
29 // Copyright (C) 2012 Patrick Pfeifer <p2000@mailinator.com>
30 // Copyright (C) 2012, 2015, 2016 Jason Crain <jason@aquaticape.us>
31 // Copyright (C) 2015 Suzuki Toshiya <mpsuzuki@hiroshima-u.ac.jp>
32 // Copyright (C) 2018 Klarälvdalens Datakonsult AB, a KDAB Group company, <info@kdab.com>. Work sponsored by the LiMux project of the city of Munich
33 // Copyright (C) 2018, 2020 Adam Reichold <adam.reichold@t-online.de>
34 // Copyright (C) 2019, 2020 Marek Kasik <mkasik@redhat.com>
35 // Copyright (C) 2020 Michal <sudolskym@gmail.com>
36 // Copyright (C) 2020 Oliver Sander <oliver.sander@tu-dresden.de>
37 //
38 // To see a description of the changes please see the Changelog file that
39 // came with your tarball or type make ChangeLog if you are building from git
40 //
41 //========================================================================
42 
43 #include <config.h>
44 
45 #include <cstdint>
46 #include <cstring>
47 #include <cmath>
48 #include <cassert>
49 #include <cairo.h>
50 
51 #include "goo/gfile.h"
52 #include "GlobalParams.h"
53 #include "Error.h"
54 #include "Object.h"
55 #include "Gfx.h"
56 #include "GfxState.h"
57 #include "GfxFont.h"
58 #include "Page.h"
59 #include "Link.h"
60 #include "FontEncodingTables.h"
61 #include "PDFDocEncoding.h"
62 #include <fofi/FoFiTrueType.h>
63 #include <splash/SplashBitmap.h>
64 #include "CairoOutputDev.h"
65 #include "CairoFontEngine.h"
66 #include "CairoRescaleBox.h"
67 #include "UnicodeMap.h"
68 #include "JBIG2Stream.h"
69 //------------------------------------------------------------------------
70 
71 // #define LOG_CAIRO
72 
73 // To limit memory usage and improve performance when printing, limit
74 // cairo images to this size. 8192 is sufficient for an A2 sized
75 // 300ppi image.
76 #define MAX_PRINT_IMAGE_SIZE 8192
77 
78 #ifdef LOG_CAIRO
79 # define LOG(x) (x)
80 #else
81 # define LOG(x)
82 #endif
83 
84 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
85 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
86 
87 //------------------------------------------------------------------------
88 // CairoImage
89 //------------------------------------------------------------------------
90 
91 CairoImage::CairoImage(double x1A, double y1A, double x2A, double y2A)
92 {
93  image = nullptr;
94  x1 = x1A;
95  y1 = y1A;
96  x2 = x2A;
97  y2 = y2A;
98 }
99 
101 {
102  if (image)
104 }
105 
107 {
108  if (image)
111 }
112 
113 //------------------------------------------------------------------------
114 // CairoOutputDev
115 //------------------------------------------------------------------------
116 
117 // We cannot tie the lifetime of an FT_Library object to that of
118 // CairoOutputDev, since any FT_Faces created with it may end up with a
119 // reference by Cairo which can be held long after the CairoOutputDev is
120 // deleted. The simplest way to avoid problems is to never tear down the
121 // FT_Library instance; to avoid leaks, just use a single global instance
122 // initialized the first time it is needed.
124 std::once_flag CairoOutputDev::ft_lib_once_flag;
125 
127 {
128  doc = nullptr;
129 
130  std::call_once(ft_lib_once_flag, FT_Init_FreeType, &ft_lib);
131 
132  fontEngine = nullptr;
133  fontEngine_owner = false;
134  glyphs = nullptr;
135  fill_pattern = nullptr;
137  stroke_pattern = nullptr;
139  stroke_opacity = 1.0;
140  fill_opacity = 1.0;
141  textClipPath = nullptr;
142  strokePathClip = nullptr;
143  cairo = nullptr;
144  currentFont = nullptr;
145 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
146  prescaleImages = false;
147 #else
148  prescaleImages = true;
149 #endif
150  printing = true;
151  use_show_text_glyphs = false;
152  inUncoloredPattern = false;
153  inType3Char = false;
154  t3_glyph_has_bbox = false;
155  text_matrix_valid = true;
157 
158  groupColorSpaceStack = nullptr;
159  maskStack = nullptr;
160  group = nullptr;
161  mask = nullptr;
162  shape = nullptr;
163  cairo_shape = nullptr;
164  knockoutCount = 0;
165 
166  textPage = nullptr;
167  actualText = nullptr;
168 
169  // the SA parameter supposedly defaults to false, but Acrobat
170  // apparently hardwires it to true
171  stroke_adjust = true;
172  align_stroke_coords = false;
173  adjusted_stroke_width = false;
174  xref = nullptr;
175 }
176 
178 {
179  if (fontEngine_owner && fontEngine) {
180  delete fontEngine;
181  }
182 
183  if (cairo)
187  if (group)
189  if (mask)
191  if (shape)
193  if (textPage)
194  textPage->decRefCnt();
195  if (actualText)
196  delete actualText;
197 }
198 
200 {
201  if (cairo != nullptr) {
203  if (status) {
204  error(errInternal, -1, "cairo context error: {0:s}\n", cairo_status_to_string(status));
205  }
208  }
209  if (c != nullptr) {
211  /* save the initial matrix so that we can use it for type3 fonts. */
212  // XXX: is this sufficient? could we miss changes to the matrix somehow?
215  } else {
216  cairo = nullptr;
217  cairo_shape = nullptr;
218  }
219 }
220 
222 {
223  if (textPage)
224  textPage->decRefCnt();
225  if (actualText)
226  delete actualText;
227  if (text) {
228  textPage = text;
229  textPage->incRefCnt();
230  actualText = new ActualText(text);
231  } else {
232  textPage = nullptr;
233  actualText = nullptr;
234  }
235 }
236 
238 {
239  antialias = a;
240  if (cairo)
242  if (cairo_shape)
244 }
245 
247 {
248  cairo_font_options_t *font_options;
250  font_options = cairo_font_options_create();
251  cairo_get_font_options(cr, font_options);
253  cairo_set_font_options(cr, font_options);
254  cairo_font_options_destroy(font_options);
255 }
256 
257 void CairoOutputDev::startDoc(PDFDoc *docA, CairoFontEngine *parentFontEngine)
258 {
259  doc = docA;
260  if (parentFontEngine) {
261  fontEngine = parentFontEngine;
262  } else {
263  if (fontEngine) {
264  delete fontEngine;
265  }
267  fontEngine_owner = true;
268  }
269  xref = doc->getXRef();
270 }
271 
272 void CairoOutputDev::startPage(int pageNum, GfxState *state, XRef *xrefA)
273 {
274  /* set up some per page defaults */
277 
282 
283  if (textPage)
285  if (xrefA != nullptr) {
286  xref = xrefA;
287  }
288 }
289 
291 {
292  if (textPage) {
293  textPage->endPage();
294  textPage->coalesce(true, 0, false);
295  }
296 }
297 
299 {
300  LOG(printf("save\n"));
301  cairo_save(cairo);
302  if (cairo_shape)
304 
305  MaskStack *ms = new MaskStack;
307  ms->mask_matrix = mask_matrix;
308  ms->next = maskStack;
309  maskStack = ms;
310 
311  if (strokePathClip)
313 }
314 
316 {
317  LOG(printf("restore\n"));
319  if (cairo_shape)
321 
322  text_matrix_valid = true;
323 
324  /* These aren't restored by cairo_restore() since we keep them in
325  * the output device. */
331 
332  MaskStack *ms = maskStack;
333  if (ms) {
334  if (mask)
336  mask = ms->mask;
337  mask_matrix = ms->mask_matrix;
338  maskStack = ms->next;
339  delete ms;
340  }
341 
342  if (strokePathClip && --strokePathClip->ref_count == 0) {
343  delete strokePathClip->path;
344  if (strokePathClip->dashes)
347  strokePathClip = nullptr;
348  }
349 }
350 
352 {
364  needFontUpdate = true;
365  if (textPage)
367 }
368 
369 void CairoOutputDev::setDefaultCTM(const double *ctm)
370 {
372  matrix.xx = ctm[0];
373  matrix.yx = ctm[1];
374  matrix.xy = ctm[2];
375  matrix.yy = ctm[3];
376  matrix.x0 = ctm[4];
377  matrix.y0 = ctm[5];
378 
380  if (cairo_shape)
382 
384 }
385 
386 void CairoOutputDev::updateCTM(GfxState *state, double m11, double m12, double m21, double m22, double m31, double m32)
387 {
388  cairo_matrix_t matrix, invert_matrix;
389  matrix.xx = m11;
390  matrix.yx = m12;
391  matrix.xy = m21;
392  matrix.yy = m22;
393  matrix.x0 = m31;
394  matrix.y0 = m32;
395 
396  /* Make sure the matrix is invertible before setting it.
397  * cairo will blow up if we give it a matrix that's not
398  * invertible, so we need to check before passing it
399  * to cairo_transform. Ignoring it is likely to give better
400  * results than not rendering anything at all. See #14398
401  *
402  * Ideally, we could do the cairo_transform
403  * and then check if anything went wrong and fix it then
404  * instead of having to invert the matrix. */
405  invert_matrix = matrix;
406  if (cairo_matrix_invert(&invert_matrix)) {
407  error(errSyntaxWarning, -1, "matrix not invertible\n");
408  return;
409  }
410 
412  if (cairo_shape)
418 }
419 
421 {
422  double *dashPattern;
423  int dashLength;
424  double dashStart;
425 
426  state->getLineDash(&dashPattern, &dashLength, &dashStart);
427  cairo_set_dash(cairo, dashPattern, dashLength, dashStart);
428  if (cairo_shape)
429  cairo_set_dash(cairo_shape, dashPattern, dashLength, dashStart);
430 }
431 
433 {
434  // cairo_set_tolerance (cairo, state->getFlatness());
435 }
436 
438 {
439  switch (state->getLineJoin()) {
440  case 0:
442  break;
443  case 1:
445  break;
446  case 2:
448  break;
449  }
450  if (cairo_shape)
452 }
453 
455 {
456  switch (state->getLineCap()) {
457  case 0:
459  break;
460  case 1:
462  break;
463  case 2:
465  break;
466  }
467  if (cairo_shape)
469 }
470 
472 {
473  cairo_set_miter_limit(cairo, state->getMiterLimit());
474  if (cairo_shape)
475  cairo_set_miter_limit(cairo_shape, state->getMiterLimit());
476 }
477 
479 {
480  LOG(printf("line width: %f\n", state->getLineWidth()));
481  adjusted_stroke_width = false;
482  double width = state->getLineWidth();
483  if (stroke_adjust && !printing) {
484  double x, y;
485  x = y = width;
486 
487  /* find out line width in device units */
489  if (fabs(x) <= 1.0 && fabs(y) <= 1.0) {
490  /* adjust width to at least one device pixel */
491  x = y = 1.0;
493  width = MIN(fabs(x), fabs(y));
494  adjusted_stroke_width = true;
495  }
496  } else if (width == 0.0) {
497  /* Cairo does not support 0 line width == 1 device pixel. Find out
498  * how big pixels (device unit) are in the x and y
499  * directions. Choose the smaller of the two as our line width.
500  */
501  double x = 1.0, y = 1.0;
502  if (printing) {
503  // assume printer pixel size is 1/600 inch
504  x = 72.0 / 600;
505  y = 72.0 / 600;
506  }
508  width = MIN(fabs(x), fabs(y));
509  }
511  if (cairo_shape)
513 }
514 
516 {
518 
519  if (inUncoloredPattern)
520  return;
521 
522  state->getFillRGB(&fill_color);
526 
527  LOG(printf("fill color: %d %d %d\n", fill_color.r, fill_color.g, fill_color.b));
528  }
529 }
530 
532 {
534 
535  if (inUncoloredPattern)
536  return;
537 
538  state->getStrokeRGB(&stroke_color);
542 
543  LOG(printf("stroke color: %d %d %d\n", stroke_color.r, stroke_color.g, stroke_color.b));
544  }
545 }
546 
548 {
549  double opacity = fill_opacity;
550 
551  if (inUncoloredPattern)
552  return;
553 
554  fill_opacity = state->getFillOpacity();
555  if (opacity != fill_opacity) {
558 
559  LOG(printf("fill opacity: %f\n", fill_opacity));
560  }
561 }
562 
564 {
565  double opacity = stroke_opacity;
566 
567  if (inUncoloredPattern)
568  return;
569 
570  stroke_opacity = state->getStrokeOpacity();
571  if (opacity != stroke_opacity) {
574 
575  LOG(printf("stroke opacity: %f\n", stroke_opacity));
576  }
577 }
578 
580 {
581  if (inUncoloredPattern)
582  return;
583 
584  state->getFillRGB(&fill_color);
585 
586  // If stroke pattern is set then the current fill is clipped
587  // to a stroke path. In that case, the stroke opacity has to be used
588  // rather than the fill opacity.
589  // See https://gitlab.freedesktop.org/poppler/poppler/issues/178
590  auto opacity = (state->getStrokePattern()) ? state->getStrokeOpacity() : state->getFillOpacity();
591 
593  LOG(printf("fill color stop: %f (%d, %d, %d, %d)\n", offset, fill_color.r, fill_color.g, fill_color.b, dblToCol(opacity)));
594 }
595 
597 {
598  switch (state->getBlendMode()) {
599  default:
600  case gfxBlendNormal:
602  break;
603  case gfxBlendMultiply:
605  break;
606  case gfxBlendScreen:
608  break;
609  case gfxBlendOverlay:
611  break;
612  case gfxBlendDarken:
614  break;
615  case gfxBlendLighten:
617  break;
618  case gfxBlendColorDodge:
620  break;
621  case gfxBlendColorBurn:
623  break;
624  case gfxBlendHardLight:
626  break;
627  case gfxBlendSoftLight:
629  break;
630  case gfxBlendDifference:
632  break;
633  case gfxBlendExclusion:
635  break;
636  case gfxBlendHue:
638  break;
639  case gfxBlendSaturation:
641  break;
642  case gfxBlendColor:
644  break;
645  case gfxBlendLuminosity:
647  break;
648  }
649  LOG(printf("blend mode: %d\n", (int)state->getBlendMode()));
650 }
651 
653 {
655  cairo_matrix_t matrix, invert_matrix;
656 
657  LOG(printf("updateFont() font=%s\n", state->getFont()->getName()->c_str()));
658 
659  needFontUpdate = false;
660 
661  // FIXME: use cairo font engine?
662  if (textPage)
664 
665  currentFont = fontEngine->getFont(state->getFont(), doc, printing, xref);
666 
667  if (!currentFont)
668  return;
669 
672 
674 
675  double fontSize = state->getFontSize();
676  const double *m = state->getTextMat();
677  /* NOTE: adjusting by a constant is hack. The correct solution
678  * is probably to use user-fonts and compute the scale on a per
679  * glyph basis instead of for the entire font */
680  double w = currentFont->getSubstitutionCorrection(state->getFont());
681  matrix.xx = m[0] * fontSize * state->getHorizScaling() * w;
682  matrix.yx = m[1] * fontSize * state->getHorizScaling() * w;
683  matrix.xy = -m[2] * fontSize;
684  matrix.yy = -m[3] * fontSize;
685  matrix.x0 = 0;
686  matrix.y0 = 0;
687 
688  LOG(printf("font matrix: %f %f %f %f\n", matrix.xx, matrix.yx, matrix.xy, matrix.yy));
689 
690  /* Make sure the font matrix is invertible before setting it. cairo
691  * will blow up if we give it a matrix that's not invertible, so we
692  * need to check before passing it to cairo_set_font_matrix. Ignoring it
693  * is likely to give better results than not rendering anything at
694  * all. See #18254.
695  */
696  invert_matrix = matrix;
697  if (cairo_matrix_invert(&invert_matrix)) {
698  error(errSyntaxWarning, -1, "font matrix not invertible");
699  text_matrix_valid = false;
700  return;
701  }
702 
704  text_matrix_valid = true;
705 }
706 
707 /* Tolerance in pixels for checking if strokes are horizontal or vertical
708  * lines in device space */
709 #define STROKE_COORD_TOLERANCE 0.5
710 
711 /* Align stroke coordinate i if the point is the start or end of a
712  * horizontal or vertical line */
713 void CairoOutputDev::alignStrokeCoords(const GfxSubpath *subpath, int i, double *x, double *y)
714 {
715  double x1, y1, x2, y2;
716  bool align = false;
717 
718  x1 = subpath->getX(i);
719  y1 = subpath->getY(i);
721 
722  // Does the current coord and prev coord form a horiz or vert line?
723  if (i > 0 && !subpath->getCurve(i - 1)) {
724  x2 = subpath->getX(i - 1);
725  y2 = subpath->getY(i - 1);
728  align = true;
729  }
730 
731  // Does the current coord and next coord form a horiz or vert line?
732  if (i < subpath->getNumPoints() - 1 && !subpath->getCurve(i + 1)) {
733  x2 = subpath->getX(i + 1);
734  y2 = subpath->getY(i + 1);
737  align = true;
738  }
739 
740  *x = subpath->getX(i);
741  *y = subpath->getY(i);
742  if (align) {
743  /* see http://www.cairographics.org/FAQ/#sharp_lines */
745  *x = floor(*x) + 0.5;
746  *y = floor(*y) + 0.5;
748  }
749 }
750 
751 #undef STROKE_COORD_TOLERANCE
752 
754 {
755  int i, j;
756  double x, y;
757  cairo_new_path(c);
758  for (i = 0; i < path->getNumSubpaths(); ++i) {
759  const GfxSubpath *subpath = path->getSubpath(i);
760  if (subpath->getNumPoints() > 0) {
761  if (align_stroke_coords) {
762  alignStrokeCoords(subpath, 0, &x, &y);
763  } else {
764  x = subpath->getX(0);
765  y = subpath->getY(0);
766  }
767  cairo_move_to(c, x, y);
768  j = 1;
769  while (j < subpath->getNumPoints()) {
770  if (subpath->getCurve(j)) {
771  if (align_stroke_coords) {
772  alignStrokeCoords(subpath, j + 2, &x, &y);
773  } else {
774  x = subpath->getX(j + 2);
775  y = subpath->getY(j + 2);
776  }
777  cairo_curve_to(c, subpath->getX(j), subpath->getY(j), subpath->getX(j + 1), subpath->getY(j + 1), x, y);
778 
779  j += 3;
780  } else {
781  if (align_stroke_coords) {
782  alignStrokeCoords(subpath, j, &x, &y);
783  } else {
784  x = subpath->getX(j);
785  y = subpath->getY(j);
786  }
787  cairo_line_to(c, x, y);
788  ++j;
789  }
790  }
791  if (subpath->isClosed()) {
792  LOG(printf("close\n"));
794  }
795  }
796  }
797 }
798 
800 {
801  if (inType3Char) {
802  GfxGray gray;
803  state->getFillGray(&gray);
804  if (colToDbl(gray) > 0.5)
805  return;
806  }
807 
809  align_stroke_coords = true;
810  doPath(cairo, state, state->getPath());
811  align_stroke_coords = false;
813  LOG(printf("stroke\n"));
814  if (strokePathClip) {
819  } else {
821  }
822  if (cairo_shape) {
823  doPath(cairo_shape, state, state->getPath());
825  }
826 }
827 
829 {
830  if (inType3Char) {
831  GfxGray gray;
832  state->getFillGray(&gray);
833  if (colToDbl(gray) > 0.5)
834  return;
835  }
836 
837  doPath(cairo, state, state->getPath());
840  LOG(printf("fill\n"));
841  // XXX: how do we get the path
842  if (mask) {
843  cairo_save(cairo);
844  cairo_clip(cairo);
845  if (strokePathClip) {
849  }
853  } else if (strokePathClip) {
855  } else {
856  cairo_fill(cairo);
857  }
858  if (cairo_shape) {
860  doPath(cairo_shape, state, state->getPath());
862  }
863 }
864 
866 {
867  doPath(cairo, state, state->getPath());
870  LOG(printf("fill-eo\n"));
871 
872  if (mask) {
873  cairo_save(cairo);
874  cairo_clip(cairo);
878  } else {
879  cairo_fill(cairo);
880  }
881  if (cairo_shape) {
883  doPath(cairo_shape, state, state->getPath());
885  }
886 }
887 
888 bool CairoOutputDev::tilingPatternFill(GfxState *state, Gfx *gfxA, Catalog *cat, GfxTilingPattern *tPat, const double *mat, int x0, int y0, int x1, int y1, double xStep, double yStep)
889 {
891  Gfx *gfx;
895  cairo_matrix_t pattern_matrix;
896  cairo_t *old_cairo;
897  double xMin, yMin, xMax, yMax;
898  double width, height;
899  double scaleX, scaleY;
900  int surface_width, surface_height;
901  StrokePathClip *strokePathTmp;
902  bool adjusted_stroke_width_tmp;
903  cairo_pattern_t *maskTmp;
904  const double *bbox = tPat->getBBox();
905  const double *pmat = tPat->getMatrix();
906  const int paintType = tPat->getPaintType();
907  Dict *resDict = tPat->getResDict();
908  Object *str = tPat->getContentStream();
909 
910  width = bbox[2] - bbox[0];
911  height = bbox[3] - bbox[1];
912 
913  if (xStep != width || yStep != height)
914  return false;
915  /* TODO: implement the other cases here too */
916 
917  // Find the width and height of the transformed pattern
919  cairo_matrix_init(&pattern_matrix, mat[0], mat[1], mat[2], mat[3], mat[4], mat[5]);
920  cairo_matrix_multiply(&matrix, &matrix, &pattern_matrix);
921 
922  double widthX = width, widthY = 0;
923  cairo_matrix_transform_distance(&matrix, &widthX, &widthY);
924  surface_width = ceil(sqrt(widthX * widthX + widthY * widthY));
925 
926  double heightX = 0, heightY = height;
927  cairo_matrix_transform_distance(&matrix, &heightX, &heightY);
928  surface_height = ceil(sqrt(heightX * heightX + heightY * heightY));
929  scaleX = surface_width / width;
930  scaleY = surface_height / height;
931 
934  return false;
935 
936  old_cairo = cairo;
940 
941  box.x1 = bbox[0];
942  box.y1 = bbox[1];
943  box.x2 = bbox[2];
944  box.y2 = bbox[3];
945  cairo_scale(cairo, scaleX, scaleY);
946  cairo_translate(cairo, -box.x1, -box.y1);
947 
948  strokePathTmp = strokePathClip;
949  strokePathClip = nullptr;
950  adjusted_stroke_width_tmp = adjusted_stroke_width;
951  maskTmp = mask;
952  mask = nullptr;
953  gfx = new Gfx(doc, this, resDict, &box, nullptr, nullptr, nullptr, gfxA);
954  if (paintType == 2)
955  inUncoloredPattern = true;
956  gfx->display(str);
957  if (paintType == 2)
958  inUncoloredPattern = false;
959  delete gfx;
960  strokePathClip = strokePathTmp;
961  adjusted_stroke_width = adjusted_stroke_width_tmp;
962  mask = maskTmp;
963 
966  cairo = old_cairo;
968  return false;
969 
970  // Cairo can fail if the pattern translation is too large. Fix by making the
971  // translation smaller.
972  const double det = pmat[0] * pmat[3] - pmat[1] * pmat[2];
973 
974  // Find the number of repetitions of pattern we need to shift by. Transform
975  // the translation component of pmat (pmat[4] and pmat[5]) into the pattern's
976  // coordinate system by multiplying by inverse of pmat, then divide by
977  // pattern size (xStep and yStep).
978  const double xoffset = round((pmat[3] * pmat[4] - pmat[2] * pmat[5]) / (xStep * det));
979  const double yoffset = -round((pmat[1] * pmat[4] - pmat[0] * pmat[5]) / (yStep * det));
980 
981  if (!std::isfinite(xoffset) || !std::isfinite(yoffset)) {
982  error(errSyntaxWarning, -1, "CairoOutputDev: Singular matrix in tilingPatternFill");
983  return false;
984  }
985 
986  // Shift pattern_matrix by multiples of the pattern size.
987  pattern_matrix.x0 -= xoffset * pattern_matrix.xx * xStep + yoffset * pattern_matrix.xy * yStep;
988  pattern_matrix.y0 -= xoffset * pattern_matrix.yx * xStep + yoffset * pattern_matrix.yy * yStep;
989 
990  state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
991  cairo_rectangle(cairo, xMin, yMin, xMax - xMin, yMax - yMin);
992 
993  cairo_matrix_init_scale(&matrix, scaleX, scaleY);
994  cairo_matrix_translate(&matrix, -box.x1, -box.y1);
996 
997  cairo_transform(cairo, &pattern_matrix);
1000  if (strokePathClip) {
1002  } else {
1003  cairo_fill(cairo);
1004  }
1005 
1007 
1008  return true;
1009 }
1010 
1011 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
1013 {
1014  // Function shaded fills are subdivided to rectangles that are the
1015  // following size in device space. Note when printing this size is
1016  // in points.
1017  const int subdivide_pixels = 10;
1018 
1019  double x_begin, x_end, x1, x2;
1020  double y_begin, y_end, y1, y2;
1021  double x_step;
1022  double y_step;
1023  GfxColor color;
1024  GfxRGB rgb;
1025  cairo_matrix_t mat;
1026 
1027  const double *matrix = shading->getMatrix();
1028  mat.xx = matrix[0];
1029  mat.yx = matrix[1];
1030  mat.xy = matrix[2];
1031  mat.yy = matrix[3];
1032  mat.x0 = matrix[4];
1033  mat.y0 = matrix[5];
1034  if (cairo_matrix_invert(&mat)) {
1035  error(errSyntaxWarning, -1, "matrix not invertible\n");
1036  return false;
1037  }
1038 
1039  // get cell size in pattern space
1040  x_step = y_step = subdivide_pixels;
1041  cairo_matrix_transform_distance(&mat, &x_step, &y_step);
1042 
1046  shading->getDomain(&x_begin, &y_begin, &x_end, &y_end);
1047 
1048  for (x1 = x_begin; x1 < x_end; x1 += x_step) {
1049  x2 = x1 + x_step;
1050  if (x2 > x_end)
1051  x2 = x_end;
1052 
1053  for (y1 = y_begin; y1 < y_end; y1 += y_step) {
1054  y2 = y1 + y_step;
1055  if (y2 > y_end)
1056  y2 = y_end;
1057 
1063 
1064  shading->getColor(x1, y1, &color);
1065  shading->getColorSpace()->getRGB(&color, &rgb);
1067 
1068  shading->getColor(x2, y1, &color);
1069  shading->getColorSpace()->getRGB(&color, &rgb);
1071 
1072  shading->getColor(x2, y2, &color);
1073  shading->getColorSpace()->getRGB(&color, &rgb);
1075 
1076  shading->getColor(x1, y2, &color);
1077  shading->getColorSpace()->getRGB(&color, &rgb);
1079 
1081  }
1082  }
1083 
1084  double xMin, yMin, xMax, yMax;
1085  // get the clip region bbox
1086  state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
1087  state->moveTo(xMin, yMin);
1088  state->lineTo(xMin, yMax);
1089  state->lineTo(xMax, yMax);
1090  state->lineTo(xMax, yMin);
1091  state->closePath();
1092  fill(state);
1093  state->clearPath();
1094 
1095  return true;
1096 }
1097 #endif /* CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) */
1098 
1099 bool CairoOutputDev::axialShadedFill(GfxState *state, GfxAxialShading *shading, double tMin, double tMax)
1100 {
1101  double x0, y0, x1, y1;
1102  double dx, dy;
1103 
1104  shading->getCoords(&x0, &y0, &x1, &y1);
1105  dx = x1 - x0;
1106  dy = y1 - y0;
1107 
1109  fill_pattern = cairo_pattern_create_linear(x0 + tMin * dx, y0 + tMin * dy, x0 + tMax * dx, y0 + tMax * dy);
1110  if (!shading->getExtend0() && !shading->getExtend1())
1112  else
1114 
1115  LOG(printf("axial-sh\n"));
1116 
1117  // TODO: use the actual stops in the shading in the case
1118  // of linear interpolation (Type 2 Exponential functions with N=1)
1119  return false;
1120 }
1121 
1123 {
1124  return (shading->getExtend0() == shading->getExtend1());
1125 }
1126 
1127 bool CairoOutputDev::radialShadedFill(GfxState *state, GfxRadialShading *shading, double sMin, double sMax)
1128 {
1129  double x0, y0, r0, x1, y1, r1;
1130  double dx, dy, dr;
1132  double scale;
1133 
1134  shading->getCoords(&x0, &y0, &r0, &x1, &y1, &r1);
1135  dx = x1 - x0;
1136  dy = y1 - y0;
1137  dr = r1 - r0;
1138 
1139  // Cairo/pixman do not work well with a very large or small scaled
1140  // matrix. See cairo bug #81657.
1141  //
1142  // As a workaround, scale the pattern by the average of the vertical
1143  // and horizontal scaling of the current transformation matrix.
1145  scale = (sqrt(matrix.xx * matrix.xx + matrix.yx * matrix.yx) + sqrt(matrix.xy * matrix.xy + matrix.yy * matrix.yy)) / 2;
1147 
1149  fill_pattern = cairo_pattern_create_radial((x0 + sMin * dx) * scale, (y0 + sMin * dy) * scale, (r0 + sMin * dr) * scale, (x0 + sMax * dx) * scale, (y0 + sMax * dy) * scale, (r0 + sMax * dr) * scale);
1151  if (shading->getExtend0() && shading->getExtend1())
1153  else
1155 
1156  LOG(printf("radial-sh\n"));
1157 
1158  return false;
1159 }
1160 
1162 {
1163  return (shading->getExtend0() == shading->getExtend1());
1164 }
1165 
1166 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0)
1168 {
1169  double x0, y0, x1, y1, x2, y2;
1170  GfxColor color[3];
1171  int i, j;
1172  GfxRGB rgb;
1173 
1176 
1177  for (i = 0; i < shading->getNTriangles(); i++) {
1178  if (shading->isParameterized()) {
1179  double color0, color1, color2;
1180  shading->getTriangle(i, &x0, &y0, &color0, &x1, &y1, &color1, &x2, &y2, &color2);
1181  shading->getParameterizedColor(color0, &color[0]);
1182  shading->getParameterizedColor(color1, &color[1]);
1183  shading->getParameterizedColor(color2, &color[2]);
1184  } else {
1185  shading->getTriangle(i, &x0, &y0, &color[0], &x1, &y1, &color[1], &x2, &y2, &color[2]);
1186  }
1187 
1189 
1193 
1194  for (j = 0; j < 3; j++) {
1195  shading->getColorSpace()->getRGB(&color[j], &rgb);
1197  }
1198 
1200  }
1201 
1202  double xMin, yMin, xMax, yMax;
1203  // get the clip region bbox
1204  state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
1205  state->moveTo(xMin, yMin);
1206  state->lineTo(xMin, yMax);
1207  state->lineTo(xMax, yMax);
1208  state->lineTo(xMax, yMin);
1209  state->closePath();
1210  fill(state);
1211  state->clearPath();
1212 
1213  return true;
1214 }
1215 
1217 {
1218  int i, j, k;
1219 
1222 
1223  for (i = 0; i < shading->getNPatches(); i++) {
1224  const GfxPatch *patch = shading->getPatch(i);
1225  GfxColor color;
1226  GfxRGB rgb;
1227 
1229 
1230  cairo_mesh_pattern_move_to(fill_pattern, patch->x[0][0], patch->y[0][0]);
1231  cairo_mesh_pattern_curve_to(fill_pattern, patch->x[0][1], patch->y[0][1], patch->x[0][2], patch->y[0][2], patch->x[0][3], patch->y[0][3]);
1232 
1233  cairo_mesh_pattern_curve_to(fill_pattern, patch->x[1][3], patch->y[1][3], patch->x[2][3], patch->y[2][3], patch->x[3][3], patch->y[3][3]);
1234 
1235  cairo_mesh_pattern_curve_to(fill_pattern, patch->x[3][2], patch->y[3][2], patch->x[3][1], patch->y[3][1], patch->x[3][0], patch->y[3][0]);
1236 
1237  cairo_mesh_pattern_curve_to(fill_pattern, patch->x[2][0], patch->y[2][0], patch->x[1][0], patch->y[1][0], patch->x[0][0], patch->y[0][0]);
1238 
1239  cairo_mesh_pattern_set_control_point(fill_pattern, 0, patch->x[1][1], patch->y[1][1]);
1240  cairo_mesh_pattern_set_control_point(fill_pattern, 1, patch->x[1][2], patch->y[1][2]);
1241  cairo_mesh_pattern_set_control_point(fill_pattern, 2, patch->x[2][2], patch->y[2][2]);
1242  cairo_mesh_pattern_set_control_point(fill_pattern, 3, patch->x[2][1], patch->y[2][1]);
1243 
1244  for (j = 0; j < 4; j++) {
1245  int u, v;
1246 
1247  switch (j) {
1248  case 0:
1249  u = 0;
1250  v = 0;
1251  break;
1252  case 1:
1253  u = 0;
1254  v = 1;
1255  break;
1256  case 2:
1257  u = 1;
1258  v = 1;
1259  break;
1260  case 3:
1261  u = 1;
1262  v = 0;
1263  break;
1264  }
1265 
1266  if (shading->isParameterized()) {
1267  shading->getParameterizedColor(patch->color[u][v].c[0], &color);
1268  } else {
1269  for (k = 0; k < shading->getColorSpace()->getNComps(); k++) {
1270  // simply cast to the desired type; that's all what is needed.
1271  color.c[k] = GfxColorComp(patch->color[u][v].c[k]);
1272  }
1273  }
1274 
1275  shading->getColorSpace()->getRGB(&color, &rgb);
1277  }
1279  }
1280 
1281  double xMin, yMin, xMax, yMax;
1282  // get the clip region bbox
1283  state->getUserClipBBox(&xMin, &yMin, &xMax, &yMax);
1284  state->moveTo(xMin, yMin);
1285  state->lineTo(xMin, yMax);
1286  state->lineTo(xMax, yMax);
1287  state->lineTo(xMax, yMin);
1288  state->closePath();
1289  fill(state);
1290  state->clearPath();
1291 
1292  return true;
1293 }
1294 #endif /* CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 12, 0) */
1295 
1297 {
1298  doPath(cairo, state, state->getPath());
1300  cairo_clip(cairo);
1301  LOG(printf("clip\n"));
1302  if (cairo_shape) {
1303  doPath(cairo_shape, state, state->getPath());
1306  }
1307 }
1308 
1310 {
1311  doPath(cairo, state, state->getPath());
1313  cairo_clip(cairo);
1314  LOG(printf("clip-eo\n"));
1315  if (cairo_shape) {
1316  doPath(cairo_shape, state, state->getPath());
1319  }
1320 }
1321 
1323 {
1324  LOG(printf("clip-to-stroke-path\n"));
1326  strokePathClip->path = state->getPath()->copy();
1330  if (strokePathClip->dash_count) {
1331  strokePathClip->dashes = (double *)gmallocn(sizeof(double), strokePathClip->dash_count);
1333  } else {
1334  strokePathClip->dashes = nullptr;
1335  }
1340 }
1341 
1343 {
1344  cairo_save(cairo);
1345 
1354 
1356 }
1357 
1359 {
1360  int len = s->getLength();
1361 
1362  if (needFontUpdate)
1363  updateFont(state);
1364 
1365  if (!currentFont)
1366  return;
1367 
1369  glyphCount = 0;
1370  if (use_show_text_glyphs) {
1372  clusterCount = 0;
1373  utf8Max = len * 2; // start with twice the number of glyphs. we will realloc if we need more.
1374  utf8 = (char *)gmalloc(utf8Max);
1375  utf8Count = 0;
1376  }
1377 }
1378 
1379 void CairoOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, double originX, double originY, CharCode code, int nBytes, const Unicode *u, int uLen)
1380 {
1381  if (currentFont) {
1383  glyphs[glyphCount].x = x - originX;
1384  glyphs[glyphCount].y = y - originY;
1385  glyphCount++;
1386  if (use_show_text_glyphs) {
1387  const UnicodeMap *utf8Map = globalParams->getUtf8Map();
1388  if (utf8Max - utf8Count < uLen * 6) {
1389  // utf8 encoded characters can be up to 6 bytes
1390  if (utf8Max > uLen * 6)
1391  utf8Max *= 2;
1392  else
1393  utf8Max += 2 * uLen * 6;
1394  utf8 = (char *)grealloc(utf8, utf8Max);
1395  }
1397  for (int i = 0; i < uLen; i++) {
1398  int size = utf8Map->mapUnicode(u[i], utf8 + utf8Count, utf8Max - utf8Count);
1399  utf8Count += size;
1401  }
1403  clusterCount++;
1404  }
1405  }
1406 
1407  if (!textPage)
1408  return;
1409  actualText->addChar(state, x, y, dx, dy, code, nBytes, u, uLen);
1410 }
1411 
1413 {
1414  int render;
1415 
1416  if (!currentFont)
1417  return;
1418 
1419  // endString can be called without a corresponding beginString. If this
1420  // happens glyphs will be null so don't draw anything, just return.
1421  // XXX: OutputDevs should probably not have to deal with this...
1422  if (!glyphs)
1423  return;
1424 
1425  // ignore empty strings and invisible text -- this is used by
1426  // Acrobat Capture
1427  render = state->getRender();
1428  if (render == 3 || glyphCount == 0 || !text_matrix_valid) {
1429  goto finish;
1430  }
1431 
1432  if (!(render & 1)) {
1433  LOG(printf("fill string\n"));
1437  else
1439  if (cairo_shape)
1441  }
1442 
1443  // stroke
1444  if ((render & 3) == 1 || (render & 3) == 2) {
1445  LOG(printf("stroke string\n"));
1449  if (cairo_shape) {
1452  }
1453  }
1454 
1455  // clip
1456  if ((render & 4)) {
1457  LOG(printf("clip string\n"));
1458  // append the glyph path to textClipPath.
1459 
1460  // set textClipPath as the currentPath
1461  if (textClipPath) {
1463  if (cairo_shape) {
1465  }
1467  }
1468 
1469  // append the glyph path
1471 
1472  // move the path back into textClipPath
1473  // and clear the current path
1476  if (cairo_shape) {
1478  }
1479  }
1480 
1481 finish:
1482  gfree(glyphs);
1483  glyphs = nullptr;
1484  if (use_show_text_glyphs) {
1485  gfree(clusters);
1486  clusters = nullptr;
1487  gfree(utf8);
1488  utf8 = nullptr;
1489  }
1490 }
1491 
1492 bool CairoOutputDev::beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, const Unicode *u, int uLen)
1493 {
1494 
1495  cairo_save(cairo);
1497 
1498  const double *ctm = state->getCTM();
1499  matrix.xx = ctm[0];
1500  matrix.yx = ctm[1];
1501  matrix.xy = ctm[2];
1502  matrix.yy = ctm[3];
1503  matrix.x0 = ctm[4];
1504  matrix.y0 = ctm[5];
1505  /* Restore the original matrix and then transform to matrix needed for the
1506  * type3 font. This is ugly but seems to work. Perhaps there is a better way to do it?*/
1509  if (cairo_shape) {
1513  }
1517  return false;
1518 }
1519 
1521 {
1523  if (cairo_shape) {
1525  }
1526 }
1527 
1528 void CairoOutputDev::type3D0(GfxState *state, double wx, double wy)
1529 {
1530  t3_glyph_wx = wx;
1531  t3_glyph_wy = wy;
1532 }
1533 
1534 void CairoOutputDev::type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury)
1535 {
1536  t3_glyph_wx = wx;
1537  t3_glyph_wy = wy;
1538  t3_glyph_bbox[0] = llx;
1539  t3_glyph_bbox[1] = lly;
1540  t3_glyph_bbox[2] = urx;
1541  t3_glyph_bbox[3] = ury;
1542  t3_glyph_has_bbox = true;
1543 }
1544 
1546 
1548 {
1549  if (textClipPath) {
1550  // clip the accumulated text path
1552  cairo_clip(cairo);
1553  if (cairo_shape) {
1556  }
1558  textClipPath = nullptr;
1559  }
1560 }
1561 
1563 {
1564  if (textPage)
1566 }
1567 
1569 {
1570  if (textPage)
1571  actualText->end(state);
1572 }
1573 
1574 static inline int splashRound(SplashCoord x)
1575 {
1576  return (int)floor(x + 0.5);
1577 }
1578 
1579 static inline int splashCeil(SplashCoord x)
1580 {
1581  return (int)ceil(x);
1582 }
1583 
1584 static inline int splashFloor(SplashCoord x)
1585 {
1586  return (int)floor(x);
1587 }
1588 
1590 {
1592  cairo_surface_t *surface = nullptr;
1593 
1595  pattern = cairo_pop_group(cairo);
1599  return surface;
1600 }
1601 
1602 void CairoOutputDev::beginTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/, GfxColorSpace *blendingColorSpace, bool /*isolated*/, bool knockout, bool forSoftMask)
1603 {
1604  /* push color space */
1605  ColorSpaceStack *css = new ColorSpaceStack;
1606  css->cs = blendingColorSpace;
1607  css->knockout = knockout;
1609  css->next = groupColorSpaceStack;
1610  groupColorSpaceStack = css;
1611 
1612  LOG(printf("begin transparency group. knockout: %s\n", knockout ? "yes" : "no"));
1613 
1614  if (knockout) {
1615  knockoutCount++;
1616  if (!cairo_shape) {
1617  /* create a surface for tracking the shape */
1619  cairo_shape = cairo_create(cairo_shape_surface);
1620  cairo_surface_destroy(cairo_shape_surface);
1622 
1623  /* the color doesn't matter as long as it is opaque */
1628  }
1629  }
1631  /* we need to track the shape */
1633  }
1634  if (false && forSoftMask)
1636  else
1638 
1639  /* push_group has an implicit cairo_save() */
1640  if (knockout) {
1641  /*XXX: let's hope this matches the semantics needed */
1643  } else {
1645  }
1646 }
1647 
1649 {
1650  if (group)
1653 
1654  LOG(printf("end transparency group\n"));
1655 
1657  if (shape)
1660  }
1661 }
1662 
1663 void CairoOutputDev::paintTransparencyGroup(GfxState * /*state*/, const double * /*bbox*/)
1664 {
1665  LOG(printf("paint transparency group\n"));
1666 
1667  cairo_save(cairo);
1669 
1670  if (shape) {
1671  /* OPERATOR_SOURCE w/ a mask is defined as (src IN mask) ADD (dest OUT mask)
1672  * however our source has already been clipped to mask so we only need to
1673  * do ADD and OUT */
1674 
1675  /* clear the shape mask */
1678  cairo_paint(cairo);
1680  }
1682 
1683  if (!mask) {
1686  if (status)
1687  printf("BAD status: %s\n", cairo_status_to_string(status));
1688  } else {
1689  if (fill_opacity < 1.0) {
1691  }
1692  cairo_save(cairo);
1694  cairo_mask(cairo, mask);
1696  if (fill_opacity < 1.0) {
1699  }
1701  mask = nullptr;
1702  }
1703 
1704  if (shape) {
1705  if (cairo_shape) {
1709  }
1711  shape = nullptr;
1712  }
1713 
1716 }
1717 
1718 static int luminocity(uint32_t x)
1719 {
1720  int r = (x >> 16) & 0xff;
1721  int g = (x >> 8) & 0xff;
1722  int b = (x >> 0) & 0xff;
1723  // an arbitrary integer approximation of .3*r + .59*g + .11*b
1724  int y = (r * 19661 + g * 38666 + b * 7209 + 32829) >> 16;
1725  return y;
1726 }
1727 
1728 /* XXX: do we need to deal with shape here? */
1729 void CairoOutputDev::setSoftMask(GfxState *state, const double *bbox, bool alpha, Function *transferFunc, GfxColor *backdropColor)
1730 {
1732 
1733  LOG(printf("set softMask\n"));
1734 
1735  if (!alpha || transferFunc) {
1736  /* We need to mask according to the luminocity of the group.
1737  * So we paint the group to an image surface convert it to a luminocity map
1738  * and then use that as the mask. */
1739 
1740  /* Get clip extents in device space */
1741  double x1, y1, x2, y2, x_min, y_min, x_max, y_max;
1742  cairo_clip_extents(cairo, &x1, &y1, &x2, &y2);
1745  x_min = MIN(x1, x2);
1746  y_min = MIN(y1, y2);
1747  x_max = MAX(x1, x2);
1748  y_max = MAX(y1, y2);
1749  cairo_clip_extents(cairo, &x1, &y1, &x2, &y2);
1752  x_min = MIN(x_min, MIN(x1, x2));
1753  y_min = MIN(y_min, MIN(y1, y2));
1754  x_max = MAX(x_max, MAX(x1, x2));
1755  y_max = MAX(y_max, MAX(y1, y2));
1756 
1757  int width = (int)(ceil(x_max) - floor(x_min));
1758  int height = (int)(ceil(y_max) - floor(y_min));
1759 
1760  /* Get group device offset */
1761  double x_offset, y_offset;
1764  } else {
1765  cairo_surface_t *pats;
1768  }
1769 
1770  /* Adjust extents by group offset */
1771  x_min += x_offset;
1772  y_min += y_offset;
1773 
1775  cairo_t *maskCtx = cairo_create(source);
1776  setContextAntialias(maskCtx, antialias);
1777 
1778  // XXX: hopefully this uses the correct color space */
1779  if (!alpha && groupColorSpaceStack->cs) {
1780  GfxRGB backdropColorRGB;
1781  groupColorSpaceStack->cs->getRGB(backdropColor, &backdropColorRGB);
1782  /* paint the backdrop */
1783  cairo_set_source_rgb(maskCtx, colToDbl(backdropColorRGB.r), colToDbl(backdropColorRGB.g), colToDbl(backdropColorRGB.b));
1784  }
1785  cairo_paint(maskCtx);
1786 
1787  /* Copy source ctm to mask ctm and translate origin so that the
1788  * mask appears it the same location on the source surface. */
1789  cairo_matrix_t mat, tmat;
1791  cairo_get_matrix(cairo, &mat);
1792  cairo_matrix_multiply(&mat, &mat, &tmat);
1793  cairo_set_matrix(maskCtx, &mat);
1794 
1795  /* make the device offset of the new mask match that of the group */
1797 
1798  /* paint the group */
1799  cairo_set_source(maskCtx, group);
1800  cairo_paint(maskCtx);
1801 
1802  /* XXX status = cairo_status(maskCtx); */
1803  cairo_destroy(maskCtx);
1804 
1805  /* convert to a luminocity map */
1806  uint32_t *source_data = reinterpret_cast<uint32_t *>(cairo_image_surface_get_data(source));
1807  /* get stride in units of 32 bits */
1809  for (int y = 0; y < height; y++) {
1810  for (int x = 0; x < width; x++) {
1811  int lum = alpha ? fill_opacity : luminocity(source_data[y * stride + x]);
1812  if (transferFunc) {
1813  double lum_in, lum_out;
1814  lum_in = lum / 256.0;
1815  transferFunc->transform(&lum_in, &lum_out);
1816  lum = (int)(lum_out * 255.0 + 0.5);
1817  }
1818  source_data[y * stride + x] = lum << 24;
1819  }
1820  }
1822 
1823  /* setup the new mask pattern */
1826 
1829  } else {
1830  cairo_matrix_t patMatrix;
1831  cairo_pattern_get_matrix(group, &patMatrix);
1832  /* Apply x_min, y_min offset to it appears in the same location as source. */
1833  cairo_matrix_multiply(&patMatrix, &patMatrix, &tmat);
1834  cairo_pattern_set_matrix(mask, &patMatrix);
1835  }
1836 
1838  } else if (alpha) {
1841  }
1842 
1844 }
1845 
1847 {
1848  /* pop color space */
1850  if (css->knockout) {
1851  knockoutCount--;
1852  if (!knockoutCount) {
1853  /* we don't need to track the shape anymore because
1854  * we are not above any knockout groups */
1856  cairo_shape = nullptr;
1857  }
1858  }
1859  groupColorSpaceStack = css->next;
1860  delete css;
1861 }
1862 
1864 {
1865  if (mask)
1867  mask = nullptr;
1868 }
1869 
1870 /* Taken from cairo/doc/tutorial/src/singular.c */
1871 static void get_singular_values(const cairo_matrix_t *matrix, double *major, double *minor)
1872 {
1873  double xx = matrix->xx, xy = matrix->xy;
1874  double yx = matrix->yx, yy = matrix->yy;
1875 
1876  double a = xx * xx + yx * yx;
1877  double b = xy * xy + yy * yy;
1878  double k = xx * xy + yx * yy;
1879 
1880  double f = (a + b) * .5;
1881  double g = (a - b) * .5;
1882  double delta = sqrt(g * g + k * k);
1883 
1884  if (major)
1885  *major = sqrt(f + delta);
1886  if (minor)
1887  *minor = sqrt(f - delta);
1888 }
1889 
1890 void CairoOutputDev::getScaledSize(const cairo_matrix_t *matrix, int orig_width, int orig_height, int *scaledWidth, int *scaledHeight)
1891 {
1892  double xScale;
1893  double yScale;
1894  if (orig_width > orig_height)
1895  get_singular_values(matrix, &xScale, &yScale);
1896  else
1897  get_singular_values(matrix, &yScale, &xScale);
1898 
1899  int tx, tx2, ty, ty2; /* the integer co-ordinates of the resulting image */
1900  if (xScale >= 0) {
1901  tx = splashRound(matrix->x0 - 0.01);
1902  tx2 = splashRound(matrix->x0 + xScale + 0.01) - 1;
1903  } else {
1904  tx = splashRound(matrix->x0 + 0.01) - 1;
1905  tx2 = splashRound(matrix->x0 + xScale - 0.01);
1906  }
1907  *scaledWidth = abs(tx2 - tx) + 1;
1908  // scaledWidth = splashRound(fabs(xScale));
1909  if (*scaledWidth == 0) {
1910  // technically, this should draw nothing, but it generally seems
1911  // better to draw a one-pixel-wide stripe rather than throwing it
1912  // away
1913  *scaledWidth = 1;
1914  }
1915  if (yScale >= 0) {
1916  ty = splashFloor(matrix->y0 + 0.01);
1917  ty2 = splashCeil(matrix->y0 + yScale - 0.01);
1918  } else {
1919  ty = splashCeil(matrix->y0 - 0.01);
1920  ty2 = splashFloor(matrix->y0 + yScale + 0.01);
1921  }
1922  *scaledHeight = abs(ty2 - ty);
1923  if (*scaledHeight == 0) {
1924  *scaledHeight = 1;
1925  }
1926 }
1927 
1929 {
1930  if (interpolate)
1931  return CAIRO_FILTER_GOOD;
1932 
1933  int orig_width = cairo_image_surface_get_width(image);
1934  int orig_height = cairo_image_surface_get_height(image);
1935  if (orig_width == 0 || orig_height == 0)
1936  return CAIRO_FILTER_NEAREST;
1937 
1938  /* When printing, don't change the interpolation. */
1939  if (printing)
1940  return CAIRO_FILTER_NEAREST;
1941 
1944  int scaled_width, scaled_height;
1945  getScaledSize(&matrix, orig_width, orig_height, &scaled_width, &scaled_height);
1946 
1947  /* When scale factor is >= 400% we don't interpolate. See bugs #25268, #9860 */
1948  if (scaled_width / orig_width >= 4 || scaled_height / orig_height >= 4)
1949  return CAIRO_FILTER_NEAREST;
1950 
1951  return CAIRO_FILTER_GOOD;
1952 }
1953 
1955 {
1956 
1957  /* FIXME: Doesn't the image mask support any colorspace? */
1959 
1960  /* work around a cairo bug when scaling 1x1 surfaces */
1961  if (width == 1 && height == 1) {
1962  ImageStream *imgStr;
1963  unsigned char pix;
1964  int invert_bit;
1965 
1966  imgStr = new ImageStream(str, width, 1, 1);
1967  imgStr->reset();
1968  imgStr->getPixel(&pix);
1969  imgStr->close();
1970  delete imgStr;
1971 
1972  invert_bit = invert ? 1 : 0;
1973  if (pix ^ invert_bit)
1974  return;
1975 
1976  cairo_save(cairo);
1977  cairo_rectangle(cairo, 0., 0., width, height);
1978  cairo_fill(cairo);
1980  if (cairo_shape) {
1985  }
1986  return;
1987  }
1988 
1989  /* shape is 1.0 for painted areas, 0.0 for unpainted ones */
1990 
1993  // XXX: it is possible that we should only do sub pixel positioning if
1994  // we are rendering fonts */
1995  if (!printing
1996  && prescaleImages
1997  /* not rotated */
1998  && matrix.xy == 0
1999  && matrix.yx == 0
2000  /* axes not flipped / not 180 deg rotated */
2001  && matrix.xx > 0 && (upsideDown() ? -1 : 1) * matrix.yy > 0) {
2003  } else {
2005  }
2006 }
2007 
2008 void CairoOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool inlineImg, double *baseMatrix)
2009 {
2010 
2011  /* FIXME: Doesn't the image mask support any colorspace? */
2013 
2014  /* work around a cairo bug when scaling 1x1 surfaces */
2015  if (width == 1 && height == 1) {
2016  ImageStream *imgStr;
2017  unsigned char pix;
2018  int invert_bit;
2019 
2020  imgStr = new ImageStream(str, width, 1, 1);
2021  imgStr->reset();
2022  imgStr->getPixel(&pix);
2023  imgStr->close();
2024  delete imgStr;
2025 
2026  invert_bit = invert ? 1 : 0;
2027  if (!(pix ^ invert_bit)) {
2028  cairo_save(cairo);
2029  cairo_rectangle(cairo, 0., 0., width, height);
2030  cairo_fill(cairo);
2032  if (cairo_shape) {
2037  }
2038  }
2039  } else {
2041 
2042  /* shape is 1.0 for painted areas, 0.0 for unpainted ones */
2043 
2046  // XXX: it is possible that we should only do sub pixel positioning if
2047  // we are rendering fonts */
2048  if (!printing && prescaleImages && matrix.xy == 0.0 && matrix.yx == 0.0) {
2049  drawImageMaskPrescaled(state, ref, str, width, height, invert, false, inlineImg);
2050  } else {
2051  drawImageMaskRegular(state, ref, str, width, height, invert, false, inlineImg);
2052  }
2053 
2054  if (state->getFillColorSpace()->getMode() == csPattern) {
2055  cairo_set_source_rgb(cairo, 1, 1, 1);
2057  cairo_mask(cairo, mask);
2058  }
2059 
2060  if (mask)
2063  }
2064 
2065  saveState(state);
2066  double bbox[4] = { 0, 0, 1, 1 }; // dummy
2067  beginTransparencyGroup(state, bbox, state->getFillColorSpace(), true, false, false);
2068 }
2069 
2071 {
2072  double bbox[4] = { 0, 0, 1, 1 }; // dummy
2073 
2078 }
2079 
2081 {
2082  unsigned char *buffer;
2083  unsigned char *dest;
2086  int x, y, i, bit;
2087  ImageStream *imgStr;
2088  unsigned char *pix;
2090  int invert_bit;
2091  ptrdiff_t row_stride;
2093 
2094  /* TODO: Do we want to cache these? */
2095  imgStr = new ImageStream(str, width, 1, 1);
2096  imgStr->reset();
2097 
2100  goto cleanup;
2101 
2103  row_stride = cairo_image_surface_get_stride(image);
2104 
2105  invert_bit = invert ? 1 : 0;
2106 
2107  for (y = 0; y < height; y++) {
2108  pix = imgStr->getLine();
2109  dest = buffer + y * row_stride;
2110  i = 0;
2111  bit = 0;
2112  for (x = 0; x < width; x++) {
2113  if (bit == 0)
2114  dest[i] = 0;
2115  if (!(pix[x] ^ invert_bit)) {
2116 #ifdef WORDS_BIGENDIAN
2117  dest[i] |= (1 << (7 - bit));
2118 #else
2119  dest[i] |= (1 << bit);
2120 #endif
2121  }
2122  bit++;
2123  if (bit > 7) {
2124  bit = 0;
2125  i++;
2126  }
2127  }
2128  }
2129 
2131 
2136  goto cleanup;
2137 
2138  LOG(printf("drawImageMask %dx%d\n", width, height));
2139 
2141 
2147  goto cleanup;
2148  }
2149 
2150  if (state->getFillColorSpace()->getMode() == csPattern) {
2153  } else if (!printing) {
2154  cairo_save(cairo);
2155  cairo_rectangle(cairo, 0., 0., 1., 1.);
2156  cairo_clip(cairo);
2157  if (strokePathClip) {
2161  }
2164  } else {
2166  }
2167 
2168  if (cairo_shape) {
2171  if (!printing) {
2172  cairo_rectangle(cairo_shape, 0., 0., 1., 1.);
2174  } else {
2176  }
2178  }
2179 
2181 
2182 cleanup:
2183  imgStr->close();
2184  delete imgStr;
2185 }
2186 
2188 {
2189  unsigned char *buffer;
2192  ImageStream *imgStr;
2193  unsigned char *pix;
2195  int invert_bit;
2196  ptrdiff_t row_stride;
2197 
2198  /* cairo does a very poor job of scaling down images so we scale them ourselves */
2199 
2200  LOG(printf("drawImageMaskPrescaled %dx%d\n", width, height));
2201 
2202  /* this scaling code is adopted from the splash image scaling code */
2204 #if 0
2205  printf("[%f %f], [%f %f], %f %f\n", matrix.xx, matrix.xy, matrix.yx, matrix.yy, matrix.x0, matrix.y0);
2206 #endif
2207  /* this whole computation should be factored out */
2208  double xScale = matrix.xx;
2209  double yScale = matrix.yy;
2210  int tx, tx2, ty, ty2; /* the integer co-ordinates of the resulting image */
2211  int scaledHeight;
2212  int scaledWidth;
2213  if (xScale >= 0) {
2214  tx = splashRound(matrix.x0 - 0.01);
2215  tx2 = splashRound(matrix.x0 + xScale + 0.01) - 1;
2216  } else {
2217  tx = splashRound(matrix.x0 + 0.01) - 1;
2218  tx2 = splashRound(matrix.x0 + xScale - 0.01);
2219  }
2220  scaledWidth = abs(tx2 - tx) + 1;
2221  // scaledWidth = splashRound(fabs(xScale));
2222  if (scaledWidth == 0) {
2223  // technically, this should draw nothing, but it generally seems
2224  // better to draw a one-pixel-wide stripe rather than throwing it
2225  // away
2226  scaledWidth = 1;
2227  }
2228  if (yScale >= 0) {
2229  ty = splashFloor(matrix.y0 + 0.01);
2230  ty2 = splashCeil(matrix.y0 + yScale - 0.01);
2231  } else {
2232  ty = splashCeil(matrix.y0 - 0.01);
2233  ty2 = splashFloor(matrix.y0 + yScale + 0.01);
2234  }
2235  scaledHeight = abs(ty2 - ty);
2236  if (scaledHeight == 0) {
2237  scaledHeight = 1;
2238  }
2239 #if 0
2240  printf("xscale: %g, yscale: %g\n", xScale, yScale);
2241  printf("width: %d, height: %d\n", width, height);
2242  printf("scaledWidth: %d, scaledHeight: %d\n", scaledWidth, scaledHeight);
2243 #endif
2244 
2245  /* compute the required padding */
2246  /* Padding is used to preserve the aspect ratio.
2247  We compute total_pad to make (height+total_pad)/scaledHeight as close to height/yScale as possible */
2248  int head_pad = 0;
2249  int tail_pad = 0;
2250  int total_pad = splashRound(height * (scaledHeight / fabs(yScale)) - height);
2251 
2252  /* compute the two pieces of padding */
2253  if (total_pad > 0) {
2254  // XXX: i'm not positive fabs() is correct
2255  float tail_error = fabs(matrix.y0 - ty);
2256  float head_error = fabs(ty2 - (matrix.y0 + yScale));
2257  float tail_fraction = tail_error / (tail_error + head_error);
2258  tail_pad = splashRound(total_pad * tail_fraction);
2259  head_pad = total_pad - tail_pad;
2260  } else {
2261  tail_pad = 0;
2262  head_pad = 0;
2263  }
2264  int origHeight = height;
2265  height += tail_pad;
2266  height += head_pad;
2267 #if 0
2268  printf("head_pad: %d tail_pad: %d\n", head_pad, tail_pad);
2269  printf("origHeight: %d height: %d\n", origHeight, height);
2270  printf("ty: %d, ty2: %d\n", ty, ty2);
2271 #endif
2272 
2273  /* TODO: Do we want to cache these? */
2274  imgStr = new ImageStream(str, width, 1, 1);
2275  imgStr->reset();
2276 
2277  invert_bit = invert ? 1 : 0;
2278 
2279  image = cairo_image_surface_create(CAIRO_FORMAT_A8, scaledWidth, scaledHeight);
2280  if (cairo_surface_status(image)) {
2281  imgStr->close();
2282  delete imgStr;
2283  return;
2284  }
2285 
2287  row_stride = cairo_image_surface_get_stride(image);
2288 
2289  int yp = height / scaledHeight;
2290  int yq = height % scaledHeight;
2291  int xp = width / scaledWidth;
2292  int xq = width % scaledWidth;
2293  int yt = 0;
2294  int origHeight_c = origHeight;
2295  /* use MIN() because yp might be > origHeight because of padding */
2296  unsigned char *pixBuf = (unsigned char *)malloc(MIN(yp + 1, origHeight) * width);
2297  int lastYStep = 1;
2298  int total = 0;
2299  for (int y = 0; y < scaledHeight; y++) {
2300  // y scale Bresenham
2301  int yStep = yp;
2302  yt += yq;
2303 
2304  if (yt >= scaledHeight) {
2305  yt -= scaledHeight;
2306  ++yStep;
2307  }
2308 
2309  // read row (s) from image ignoring the padding as appropriate
2310  {
2311  int n = (yp > 0) ? yStep : lastYStep;
2312  total += n;
2313  if (n > 0) {
2314  unsigned char *p = pixBuf;
2315  int head_pad_count = head_pad;
2316  int origHeight_count = origHeight;
2317  int tail_pad_count = tail_pad;
2318  for (int i = 0; i < n; i++) {
2319  // get row
2320  if (head_pad_count) {
2321  head_pad_count--;
2322  } else if (origHeight_count) {
2323  pix = imgStr->getLine();
2324  for (int j = 0; j < width; j++) {
2325  if (pix[j] ^ invert_bit)
2326  p[j] = 0;
2327  else
2328  p[j] = 255;
2329  }
2330  origHeight_count--;
2331  p += width;
2332  } else if (tail_pad_count) {
2333  tail_pad_count--;
2334  } else {
2335  printf("%d %d\n", n, total);
2336  assert(0 && "over run\n");
2337  }
2338  }
2339  }
2340  }
2341 
2342  lastYStep = yStep;
2343  int k1 = y;
2344 
2345  int xt = 0;
2346  int xSrc = 0;
2347  int x1 = k1;
2348  int n = yStep > 0 ? yStep : 1;
2349  int origN = n;
2350 
2351  /* compute the size of padding and pixels that will be used for this row */
2352  int head_pad_size = MIN(n, head_pad);
2353  n -= head_pad_size;
2354  head_pad -= MIN(head_pad_size, yStep);
2355 
2356  int pix_size = MIN(n, origHeight);
2357  n -= pix_size;
2358  origHeight -= MIN(pix_size, yStep);
2359 
2360  int tail_pad_size = MIN(n, tail_pad);
2361  n -= tail_pad_size;
2362  tail_pad -= MIN(tail_pad_size, yStep);
2363  if (n != 0) {
2364  printf("n = %d (%d %d %d)\n", n, head_pad_size, pix_size, tail_pad_size);
2365  assert(n == 0);
2366  }
2367 
2368  for (int x = 0; x < scaledWidth; ++x) {
2369  int xStep = xp;
2370  xt += xq;
2371  if (xt >= scaledWidth) {
2372  xt -= scaledWidth;
2373  ++xStep;
2374  }
2375  int m = xStep > 0 ? xStep : 1;
2376  float pixAcc0 = 0;
2377  /* could m * head_pad_size * tail_pad_size overflow? */
2378  if (invert_bit) {
2379  pixAcc0 += m * head_pad_size * tail_pad_size * 255;
2380  } else {
2381  pixAcc0 += m * head_pad_size * tail_pad_size * 0;
2382  }
2383  /* Accumulate all of the source pixels for the destination pixel */
2384  for (int i = 0; i < pix_size; ++i) {
2385  for (int j = 0; j < m; ++j) {
2386  if (xSrc + i * width + j > MIN(yp + 1, origHeight_c) * width) {
2387  printf("%d > %d (%d %d %d %d) (%d %d %d)\n", xSrc + i * width + j, MIN(yp + 1, origHeight_c) * width, xSrc, i, width, j, yp, origHeight_c, width);
2388  printf("%d %d %d\n", head_pad_size, pix_size, tail_pad_size);
2389  assert(0 && "bad access\n");
2390  }
2391  pixAcc0 += pixBuf[xSrc + i * width + j];
2392  }
2393  }
2394  buffer[y * row_stride + x] = splashFloor(pixAcc0 / (origN * m));
2395  xSrc += xStep;
2396  x1 += 1;
2397  }
2398  }
2399  free(pixBuf);
2400 
2405  imgStr->close();
2406  delete imgStr;
2407  return;
2408  }
2409 
2410  /* we should actually be using CAIRO_FILTER_NEAREST here. However,
2411  * cairo doesn't yet do minifaction filtering causing scaled down
2412  * images with CAIRO_FILTER_NEAREST to look really bad */
2414 
2415  if (state->getFillColorSpace()->getMode() == csPattern) {
2416  cairo_matrix_init_translate(&matrix, 0, scaledHeight);
2417  cairo_matrix_scale(&matrix, scaledWidth, -scaledHeight);
2421  imgStr->close();
2422  delete imgStr;
2423  return;
2424  }
2425 
2428  } else {
2429  cairo_save(cairo);
2430 
2431  /* modify our current transformation so that the prescaled image
2432  * goes where it is supposed to */
2434  cairo_scale(cairo, 1.0 / matrix.xx, 1.0 / matrix.yy);
2435  // get integer co-ords
2436  cairo_translate(cairo, tx - matrix.x0, ty2 - matrix.y0);
2437  if (yScale > 0)
2438  cairo_scale(cairo, 1, -1);
2439 
2440  cairo_rectangle(cairo, 0., 0., scaledWidth, scaledHeight);
2441  cairo_clip(cairo);
2442  if (strokePathClip) {
2446  }
2448 
2449  // cairo_get_matrix(cairo, &matrix);
2450  // printf("mask at: [%f %f], [%f %f], %f %f\n\n", matrix.xx, matrix.xy, matrix.yx, matrix.yy, matrix.x0, matrix.y0);
2452  }
2453 
2454  if (cairo_shape) {
2456 
2457  /* modify our current transformation so that the prescaled image
2458  * goes where it is supposed to */
2460  cairo_scale(cairo_shape, 1.0 / matrix.xx, 1.0 / matrix.yy);
2461  // get integer co-ords
2462  cairo_translate(cairo_shape, tx - matrix.x0, ty2 - matrix.y0);
2463  if (yScale > 0)
2464  cairo_scale(cairo_shape, 1, -1);
2465 
2466  cairo_rectangle(cairo_shape, 0., 0., scaledWidth, scaledHeight);
2468 
2470  }
2471 
2473 
2474  imgStr->close();
2475  delete imgStr;
2476 }
2477 
2478 void CairoOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate)
2479 {
2480  ImageStream *maskImgStr, *imgStr;
2481  ptrdiff_t row_stride;
2482  unsigned char *maskBuffer, *buffer;
2483  unsigned char *maskDest;
2484  unsigned int *dest;
2485  cairo_surface_t *maskImage, *image;
2486  cairo_pattern_t *maskPattern, *pattern;
2488  cairo_matrix_t maskMatrix;
2489  unsigned char *pix;
2490  int x, y;
2491  int invert_bit;
2493  cairo_filter_t maskFilter;
2494 
2495  maskImgStr = new ImageStream(maskStr, maskWidth, 1, 1);
2496  maskImgStr->reset();
2497 
2498  maskImage = cairo_image_surface_create(CAIRO_FORMAT_A8, maskWidth, maskHeight);
2499  if (cairo_surface_status(maskImage)) {
2500  maskImgStr->close();
2501  delete maskImgStr;
2502  return;
2503  }
2504 
2505  maskBuffer = cairo_image_surface_get_data(maskImage);
2506  row_stride = cairo_image_surface_get_stride(maskImage);
2507 
2508  invert_bit = maskInvert ? 1 : 0;
2509 
2510  for (y = 0; y < maskHeight; y++) {
2511  pix = maskImgStr->getLine();
2512  maskDest = maskBuffer + y * row_stride;
2513  for (x = 0; x < maskWidth; x++) {
2514  if (pix[x] ^ invert_bit)
2515  *maskDest++ = 0;
2516  else
2517  *maskDest++ = 255;
2518  }
2519  }
2520 
2521  maskImgStr->close();
2522  delete maskImgStr;
2523 
2524  maskFilter = getFilterForSurface(maskImage, maskInterpolate);
2525 
2526  cairo_surface_mark_dirty(maskImage);
2527  maskPattern = cairo_pattern_create_for_surface(maskImage);
2528  cairo_surface_destroy(maskImage);
2529  if (cairo_pattern_status(maskPattern))
2530  return;
2531 
2532 #if 0
2533  /* ICCBased color space doesn't do any color correction
2534  * so check its underlying color space as well */
2535  int is_identity_transform;
2536  is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
2537  (colorMap->getColorSpace()->getMode() == csICCBased &&
2538  ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
2539 #endif
2540 
2541  /* TODO: Do we want to cache these? */
2542  imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
2543  imgStr->reset();
2544 
2547  goto cleanup;
2548 
2550  row_stride = cairo_image_surface_get_stride(image);
2551  for (y = 0; y < height; y++) {
2552  dest = reinterpret_cast<unsigned int *>(buffer + y * row_stride);
2553  pix = imgStr->getLine();
2554  colorMap->getRGBLine(pix, dest, width);
2555  }
2556 
2558 
2563  goto cleanup;
2564 
2565  LOG(printf("drawMaskedImage %dx%d\n", width, height));
2566 
2568  cairo_pattern_set_filter(maskPattern, maskFilter);
2569 
2570  if (!printing) {
2573  }
2574 
2580  cairo_pattern_destroy(maskPattern);
2581  goto cleanup;
2582  }
2583 
2584  cairo_matrix_init_translate(&maskMatrix, 0, maskHeight);
2585  cairo_matrix_scale(&maskMatrix, maskWidth, -maskHeight);
2586  cairo_pattern_set_matrix(maskPattern, &maskMatrix);
2587  if (cairo_pattern_status(maskPattern)) {
2588  cairo_pattern_destroy(maskPattern);
2590  goto cleanup;
2591  }
2592 
2593  if (!printing) {
2594  cairo_save(cairo);
2596  cairo_rectangle(cairo, 0., 0., 1., 1.);
2597  cairo_clip(cairo);
2598  cairo_mask(cairo, maskPattern);
2600  } else {
2602  cairo_mask(cairo, maskPattern);
2603  }
2604 
2605  if (cairo_shape) {
2608  if (!printing) {
2609  cairo_rectangle(cairo_shape, 0., 0., 1., 1.);
2611  } else {
2613  }
2615  }
2616 
2617  cairo_pattern_destroy(maskPattern);
2619 
2620 cleanup:
2621  imgStr->close();
2622  delete imgStr;
2623 }
2624 
2625 // XXX: is this affect by AIS(alpha is shape)?
2626 void CairoOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap,
2627  bool maskInterpolate)
2628 {
2629  ImageStream *maskImgStr, *imgStr;
2630  ptrdiff_t row_stride;
2631  unsigned char *maskBuffer, *buffer;
2632  unsigned char *maskDest;
2633  unsigned int *dest;
2634  cairo_surface_t *maskImage, *image;
2635  cairo_pattern_t *maskPattern, *pattern;
2636  cairo_matrix_t maskMatrix, matrix;
2637  unsigned char *pix;
2638  int y;
2640  cairo_filter_t maskFilter;
2641 
2642  maskImgStr = new ImageStream(maskStr, maskWidth, maskColorMap->getNumPixelComps(), maskColorMap->getBits());
2643  maskImgStr->reset();
2644 
2645  maskImage = cairo_image_surface_create(CAIRO_FORMAT_A8, maskWidth, maskHeight);
2646  if (cairo_surface_status(maskImage)) {
2647  maskImgStr->close();
2648  delete maskImgStr;
2649  return;
2650  }
2651 
2652  maskBuffer = cairo_image_surface_get_data(maskImage);
2653  row_stride = cairo_image_surface_get_stride(maskImage);
2654  for (y = 0; y < maskHeight; y++) {
2655  maskDest = (unsigned char *)(maskBuffer + y * row_stride);
2656  pix = maskImgStr->getLine();
2657  if (likely(pix != nullptr)) {
2658  maskColorMap->getGrayLine(pix, maskDest, maskWidth);
2659  }
2660  }
2661 
2662  maskImgStr->close();
2663  delete maskImgStr;
2664 
2665  maskFilter = getFilterForSurface(maskImage, maskInterpolate);
2666 
2667  cairo_surface_mark_dirty(maskImage);
2668  maskPattern = cairo_pattern_create_for_surface(maskImage);
2669  cairo_surface_destroy(maskImage);
2670  if (cairo_pattern_status(maskPattern))
2671  return;
2672 
2673 #if 0
2674  /* ICCBased color space doesn't do any color correction
2675  * so check its underlying color space as well */
2676  int is_identity_transform;
2677  is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
2678  (colorMap->getColorSpace()->getMode() == csICCBased &&
2679  ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
2680 #endif
2681 
2682  /* TODO: Do we want to cache these? */
2683  imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
2684  imgStr->reset();
2685 
2688  goto cleanup;
2689 
2691  row_stride = cairo_image_surface_get_stride(image);
2692  for (y = 0; y < height; y++) {
2693  dest = reinterpret_cast<unsigned int *>(buffer + y * row_stride);
2694  pix = imgStr->getLine();
2695  colorMap->getRGBLine(pix, dest, width);
2696  }
2697 
2699 
2701 
2702  setMimeData(state, str, ref, colorMap, image, height);
2703 
2707  goto cleanup;
2708 
2709  LOG(printf("drawSoftMaskedImage %dx%d\n", width, height));
2710 
2712  cairo_pattern_set_filter(maskPattern, maskFilter);
2713 
2714  if (!printing) {
2717  }
2718 
2724  cairo_pattern_destroy(maskPattern);
2725  goto cleanup;
2726  }
2727 
2728  cairo_matrix_init_translate(&maskMatrix, 0, maskHeight);
2729  cairo_matrix_scale(&maskMatrix, maskWidth, -maskHeight);
2730  cairo_pattern_set_matrix(maskPattern, &maskMatrix);
2731  if (cairo_pattern_status(maskPattern)) {
2732  cairo_pattern_destroy(maskPattern);
2734  goto cleanup;
2735  }
2736 
2737  if (fill_opacity != 1.0)
2739  else
2740  cairo_save(cairo);
2741 
2743  if (!printing) {
2744  cairo_rectangle(cairo, 0., 0., 1., 1.);
2745  cairo_clip(cairo);
2746  }
2747  cairo_mask(cairo, maskPattern);
2748 
2749  if (fill_opacity != 1.0) {
2751  cairo_save(cairo);
2752  if (!printing) {
2753  cairo_rectangle(cairo, 0., 0., 1., 1.);
2754  cairo_clip(cairo);
2755  }
2757  }
2759 
2760  if (cairo_shape) {
2763  if (!printing) {
2764  cairo_rectangle(cairo_shape, 0., 0., 1., 1.);
2766  } else {
2768  }
2770  }
2771 
2772  cairo_pattern_destroy(maskPattern);
2774 
2775 cleanup:
2776  imgStr->close();
2777  delete imgStr;
2778 }
2779 
2781 {
2782  int len, i;
2783  char *strBuffer;
2784 
2785  len = 0;
2786  str->close();
2787  str->reset();
2788  while (str->getChar() != EOF)
2789  len++;
2790  if (len == 0)
2791  return false;
2792 
2793  strBuffer = (char *)gmalloc(len);
2794 
2795  str->close();
2796  str->reset();
2797  for (i = 0; i < len; ++i)
2798  strBuffer[i] = str->getChar();
2799 
2800  *buffer = strBuffer;
2801  *length = len;
2802 
2803  return true;
2804 }
2805 
2807 {
2808  for (int i = 0; i < colorMap->getNumPixelComps(); i++) {
2809  if (colorMap->getDecodeLow(i) != 0.0 || colorMap->getDecodeHigh(i) != 1.0)
2810  return false;
2811  }
2812  return true;
2813 }
2814 
2815 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)
2816 static cairo_status_t setMimeIdFromRef(cairo_surface_t *surface, const char *mime_type, const char *mime_id_prefix, Ref ref)
2817 {
2818  GooString *mime_id;
2819  char *idBuffer;
2821 
2822  mime_id = new GooString;
2823 
2824  if (mime_id_prefix)
2825  mime_id->append(mime_id_prefix);
2826 
2827  mime_id->appendf("{0:d}-{1:d}", ref.gen, ref.num);
2828 
2829  idBuffer = copyString(mime_id->c_str());
2830  status = cairo_surface_set_mime_data(surface, mime_type, (const unsigned char *)idBuffer, mime_id->getLength(), gfree, idBuffer);
2831  delete mime_id;
2832  if (status)
2833  gfree(idBuffer);
2834  return status;
2835 }
2836 #endif
2837 
2838 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
2840 {
2841  JBIG2Stream *jb2Str = static_cast<JBIG2Stream *>(str);
2842  Object *globalsStr = jb2Str->getGlobalsStream();
2843  char *globalsBuffer;
2844  int globalsLength;
2845 
2846  // nothing to do for JBIG2 stream without Globals
2847  if (!globalsStr->isStream())
2848  return true;
2849 
2851  return false;
2852 
2853  if (!getStreamData(globalsStr->getStream(), &globalsBuffer, &globalsLength))
2854  return false;
2855 
2856  if (cairo_surface_set_mime_data(image, CAIRO_MIME_TYPE_JBIG2_GLOBAL, (const unsigned char *)globalsBuffer, globalsLength, gfree, (void *)globalsBuffer)) {
2857  gfree(globalsBuffer);
2858  return false;
2859  }
2860 
2861  return true;
2862 }
2863 #endif
2864 
2865 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
2867 {
2868  CCITTFaxStream *ccittStr = static_cast<CCITTFaxStream *>(str);
2869 
2870  GooString params;
2871  params.appendf("Columns={0:d}", ccittStr->getColumns());
2872  params.appendf(" Rows={0:d}", height);
2873  params.appendf(" K={0:d}", ccittStr->getEncoding());
2874  params.appendf(" EndOfLine={0:d}", ccittStr->getEndOfLine() ? 1 : 0);
2875  params.appendf(" EncodedByteAlign={0:d}", ccittStr->getEncodedByteAlign() ? 1 : 0);
2876  params.appendf(" EndOfBlock={0:d}", ccittStr->getEndOfBlock() ? 1 : 0);
2877  params.appendf(" BlackIs1={0:d}", ccittStr->getBlackIs1() ? 1 : 0);
2878  params.appendf(" DamagedRowsBeforeError={0:d}", ccittStr->getDamagedRowsBeforeError());
2879 
2880  char *p = strdup(params.c_str());
2881  if (cairo_surface_set_mime_data(image, CAIRO_MIME_TYPE_CCITT_FAX_PARAMS, (const unsigned char *)p, params.getLength(), gfree, (void *)p)) {
2882  gfree(p);
2883  return false;
2884  }
2885 
2886  return true;
2887 }
2888 #endif
2889 
2891 {
2892  char *strBuffer;
2893  int len;
2894  Object obj;
2895  GfxColorSpace *colorSpace;
2896  StreamKind strKind = str->getKind();
2897  const char *mime_type;
2898 
2899  if (!printing)
2900  return;
2901 
2902  switch (strKind) {
2903  case strDCT:
2904  mime_type = CAIRO_MIME_TYPE_JPEG;
2905  break;
2906  case strJPX:
2907  mime_type = CAIRO_MIME_TYPE_JP2;
2908  break;
2909 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
2910  case strJBIG2:
2911  mime_type = CAIRO_MIME_TYPE_JBIG2;
2912  break;
2913 #endif
2914 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
2915  case strCCITTFax:
2916  mime_type = CAIRO_MIME_TYPE_CCITT_FAX;
2917  break;
2918 #endif
2919  default:
2920  return;
2921  }
2922 
2923  obj = str->getDict()->lookup("ColorSpace");
2924  colorSpace = GfxColorSpace::parse(nullptr, &obj, this, state);
2925 
2926  // colorspace in stream dict may be different from colorspace in jpx
2927  // data
2928  if (strKind == strJPX && colorSpace)
2929  return;
2930 
2931  // only embed mime data for gray, rgb, and cmyk colorspaces.
2932  if (colorSpace) {
2933  GfxColorSpaceMode mode = colorSpace->getMode();
2934  delete colorSpace;
2935  switch (mode) {
2936  case csDeviceGray:
2937  case csCalGray:
2938  case csDeviceRGB:
2939  case csCalRGB:
2940  case csDeviceCMYK:
2941  case csICCBased:
2942  break;
2943 
2944  case csLab:
2945  case csIndexed:
2946  case csSeparation:
2947  case csDeviceN:
2948  case csPattern:
2949  return;
2950  }
2951  }
2952 
2953  if (!colorMapHasIdentityDecodeMap(colorMap))
2954  return;
2955 
2956 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
2957  if (strKind == strJBIG2 && !setMimeDataForJBIG2Globals(str, image))
2958  return;
2959 #endif
2960 
2961 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
2962  if (strKind == strCCITTFax && !setMimeDataForCCITTParams(str, image, height))
2963  return;
2964 #endif
2965 
2966  if (getStreamData(str->getNextStream(), &strBuffer, &len)) {
2968 
2969 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 11, 2)
2970  // Since 1.5.10 the cairo PS backend stores images with UNIQUE_ID in PS memory so the
2971  // image can be re-used multiple times. As we don't know how large the images are or
2972  // how many times they are used, there is no benefit in enabling this. Issue #106
2974  if (ref && ref->isRef()) {
2975  status = setMimeIdFromRef(image, CAIRO_MIME_TYPE_UNIQUE_ID, "poppler-surface-", ref->getRef());
2976  }
2977  }
2978 #endif
2979  if (!status) {
2980  status = cairo_surface_set_mime_data(image, mime_type, (const unsigned char *)strBuffer, len, gfree, strBuffer);
2981  }
2982 
2983  if (status)
2984  gfree(strBuffer);
2985  }
2986 }
2987 
2989 {
2990 private:
2993  int width;
2995  const int *maskColors;
2998 
2999 public:
3000  ~RescaleDrawImage() override;
3001  cairo_surface_t *getSourceImage(Stream *str, int widthA, int height, int scaledWidth, int scaledHeight, bool printing, GfxImageColorMap *colorMapA, const int *maskColorsA)
3002  {
3003  cairo_surface_t *image = nullptr;
3004  int i;
3005 
3006  lookup = nullptr;
3007  colorMap = colorMapA;
3008  maskColors = maskColorsA;
3009  width = widthA;
3010  current_row = -1;
3011  imageError = false;
3012 
3013  /* TODO: Do we want to cache these? */
3015  imgStr->reset();
3016 
3017 #if 0
3018  /* ICCBased color space doesn't do any color correction
3019  * so check its underlying color space as well */
3020  int is_identity_transform;
3021  is_identity_transform = colorMap->getColorSpace()->getMode() == csDeviceRGB ||
3023  ((GfxICCBasedColorSpace*)colorMap->getColorSpace())->getAlt()->getMode() == csDeviceRGB);
3024 #endif
3025 
3026  // special case for one-channel (monochrome/gray/separation) images:
3027  // build a lookup table here
3028  if (colorMap->getNumPixelComps() == 1) {
3029  int n;
3030  unsigned char pix;
3031 
3032  n = 1 << colorMap->getBits();
3033  lookup = (GfxRGB *)gmallocn(n, sizeof(GfxRGB));
3034  for (i = 0; i < n; ++i) {
3035  pix = (unsigned char)i;
3036 
3037  colorMap->getRGB(&pix, &lookup[i]);
3038  }
3039  }
3040 
3041 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 14, 0)
3042  bool needsCustomDownscaling = false;
3043 #else
3044  bool needsCustomDownscaling = true;
3045 #endif
3046 
3047  if (printing) {
3049  if (width > height) {
3050  scaledWidth = MAX_PRINT_IMAGE_SIZE;
3051  scaledHeight = MAX_PRINT_IMAGE_SIZE * (double)height / width;
3052  } else {
3053  scaledHeight = MAX_PRINT_IMAGE_SIZE;
3054  scaledWidth = MAX_PRINT_IMAGE_SIZE * (double)width / height;
3055  }
3056  needsCustomDownscaling = true;
3057 
3058  if (scaledWidth == 0) {
3059  scaledWidth = 1;
3060  }
3061  if (scaledHeight == 0) {
3062  scaledHeight = 1;
3063  }
3064  } else {
3065  needsCustomDownscaling = false;
3066  }
3067  }
3068 
3069  if (!needsCustomDownscaling || scaledWidth >= width || scaledHeight >= height) {
3070  // No downscaling. Create cairo image containing the source image data.
3071  unsigned char *buffer;
3072  ptrdiff_t stride;
3073 
3076  goto cleanup;
3077 
3080  for (int y = 0; y < height; y++) {
3081  uint32_t *dest = reinterpret_cast<uint32_t *>(buffer + y * stride);
3082  getRow(y, dest);
3083  }
3084  } else {
3085  // // Downscaling required. Create cairo image the size of the
3086  // rescaled image and // downscale the source image data into
3087  // the cairo image. downScaleImage() will call getRow() to read
3088  // source image data from the image stream. This avoids having
3089  // to create an image the size of the source image which may
3090  // exceed cairo's 32676x32767 image size limit (and also saves a
3091  // lot of memory).
3094  goto cleanup;
3095 
3096  downScaleImage(width, height, scaledWidth, scaledHeight, 0, 0, scaledWidth, scaledHeight, image);
3097  }
3099 
3100  cleanup:
3101  gfree(lookup);
3102  imgStr->close();
3103  delete imgStr;
3104  return image;
3105  }
3106 
3107  void getRow(int row_num, uint32_t *row_data) override
3108  {
3109  unsigned char *pix;
3110 
3111  if (row_num <= current_row)
3112  return;
3113 
3114  while (current_row < row_num) {
3115  pix = imgStr->getLine();
3116  current_row++;
3117  }
3118 
3119  if (unlikely(pix == nullptr)) {
3120  memset(row_data, 0, width * 4);
3121  if (!imageError) {
3122  error(errInternal, -1, "Bad image stream");
3123  imageError = true;
3124  }
3125  } else if (lookup) {
3126  unsigned char *p = pix;
3127  GfxRGB rgb;
3128 
3129  for (int i = 0; i < width; i++) {
3130  rgb = lookup[*p];
3131  row_data[i] = ((int)colToByte(rgb.r) << 16) | ((int)colToByte(rgb.g) << 8) | ((int)colToByte(rgb.b) << 0);
3132  p++;
3133  }
3134  } else {
3135  colorMap->getRGBLine(pix, row_data, width);
3136  }
3137 
3138  if (maskColors) {
3139  for (int x = 0; x < width; x++) {
3140  bool is_opaque = false;
3141  for (int i = 0; i < colorMap->getNumPixelComps(); ++i) {
3142  if (pix[i] < maskColors[2 * i] || pix[i] > maskColors[2 * i + 1]) {
3143  is_opaque = true;
3144  break;
3145  }
3146  }
3147  if (is_opaque)
3148  *row_data |= 0xff000000;
3149  else
3150  *row_data = 0;
3151  row_data++;
3153  }
3154  }
3155  }
3156 };
3157 
3159 
3160 void CairoOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int widthA, int heightA, GfxImageColorMap *colorMap, bool interpolate, const int *maskColors, bool inlineImg)
3161 {
3163  cairo_pattern_t *pattern, *maskPattern;
3165  int width, height;
3166  int scaledWidth, scaledHeight;
3168  RescaleDrawImage rescale;
3169 
3170  LOG(printf("drawImage %dx%d\n", widthA, heightA));
3171 
3173  getScaledSize(&matrix, widthA, heightA, &scaledWidth, &scaledHeight);
3174  image = rescale.getSourceImage(str, widthA, heightA, scaledWidth, scaledHeight, printing, colorMap, maskColors);
3175  if (!image)
3176  return;
3177 
3180  if (width == widthA && height == heightA)
3182 
3183  if (!inlineImg) { /* don't read stream twice if it is an inline image */
3184  // cairo 1.15.10 allows mime image data to have different size to cairo image
3185  // mime image size will be scaled to same size as cairo image
3186 #if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 15, 10)
3187  bool requireSameSize = false;
3188 #else
3189  bool requireSameSize = true;
3190 #endif
3191  if (!requireSameSize || (width == widthA && height == heightA))
3192  setMimeData(state, str, ref, colorMap, image, heightA);
3193  }
3194 
3198  return;
3199 
3201 
3202  if (!printing)
3204 
3210  return;
3211  }
3212 
3213  if (!mask && fill_opacity != 1.0) {
3214  maskPattern = cairo_pattern_create_rgba(1., 1., 1., fill_opacity);
3215  } else if (mask) {
3216  maskPattern = cairo_pattern_reference(mask);
3217  } else {
3218  maskPattern = nullptr;
3219  }
3220 
3221  cairo_save(cairo);
3223  if (!printing)
3224  cairo_rectangle(cairo, 0., 0., 1., 1.);
3225  if (maskPattern) {
3226  if (!printing)
3227  cairo_clip(cairo);
3228  if (mask)
3230  cairo_mask(cairo, maskPattern);
3231  } else {
3232  if (printing)
3233  cairo_paint(cairo);
3234  else
3235  cairo_fill(cairo);
3236  }
3238 
3239  cairo_pattern_destroy(maskPattern);
3240 
3241  if (cairo_shape) {
3244  if (printing) {
3246  } else {
3247  cairo_rectangle(cairo_shape, 0., 0., 1., 1.);
3249  }
3251  }
3252 
3254 }
3255 
3256 //------------------------------------------------------------------------
3257 // ImageOutputDev
3258 //------------------------------------------------------------------------
3259 
3261 {
3262  images = nullptr;
3263  numImages = 0;
3264  size = 0;
3265  imgDrawCbk = nullptr;
3266  imgDrawCbkData = nullptr;
3267 }
3268 
3270 {
3271  int i;
3272 
3273  for (i = 0; i < numImages; i++)
3274  delete images[i];
3275  gfree(images);
3276 }
3277 
3279 {
3280  if (numImages >= size) {
3281  size += 16;
3282  images = (CairoImage **)greallocn(images, size, sizeof(CairoImage *));
3283  }
3284  images[numImages++] = image;
3285 }
3286 
3287 void CairoImageOutputDev::getBBox(GfxState *state, int width, int height, double *x1, double *y1, double *x2, double *y2)
3288 {
3289  const double *ctm = state->getCTM();
3291  cairo_matrix_init(&matrix, ctm[0], ctm[1], -ctm[2], -ctm[3], ctm[2] + ctm[4], ctm[3] + ctm[5]);
3292 
3293  int scaledWidth, scaledHeight;
3294  getScaledSize(&matrix, width, height, &scaledWidth, &scaledHeight);
3295 
3296  if (matrix.xx >= 0) {
3297  *x1 = matrix.x0;
3298  } else {
3299  *x1 = matrix.x0 - scaledWidth;
3300  }
3301  *x2 = *x1 + scaledWidth;
3302 
3303  if (matrix.yy >= 0) {
3304  *y1 = matrix.y0;
3305  } else {
3306  *y1 = matrix.y0 - scaledHeight;
3307  }
3308  *y2 = *y1 + scaledHeight;
3309 }
3310 
3312 {
3313  cairo_t *cr;
3315  double x1, y1, x2, y2;
3316  CairoImage *image;
3317 
3318  getBBox(state, width, height, &x1, &y1, &x2, &y2);
3319 
3320  image = new CairoImage(x1, y1, x2, y2);
3321  saveImage(image);
3322 
3325  cr = cairo_create(surface);
3326  setCairo(cr);
3327  cairo_translate(cr, 0, height);
3328  cairo_scale(cr, width, -height);
3329 
3331  image->setImage(surface);
3332 
3333  setCairo(nullptr);
3335  cairo_destroy(cr);
3336  }
3337 }
3338 
3339 void CairoImageOutputDev::setSoftMaskFromImageMask(GfxState *state, Object *ref, Stream *str, int width, int height, bool invert, bool inlineImg, double *baseMatrix)
3340 {
3341  cairo_t *cr;
3343  double x1, y1, x2, y2;
3344  CairoImage *image;
3345 
3346  getBBox(state, width, height, &x1, &y1, &x2, &y2);
3347 
3348  image = new CairoImage(x1, y1, x2, y2);
3349  saveImage(image);
3350 
3353  cr = cairo_create(surface);
3354  setCairo(cr);
3355  cairo_translate(cr, 0, height);
3356  cairo_scale(cr, width, -height);
3357 
3358  CairoOutputDev::drawImageMask(state, ref, str, width, height, invert, inlineImg, false);
3359  if (state->getFillColorSpace()->getMode() == csPattern) {
3360  cairo_mask(cairo, mask);
3361  }
3362  image->setImage(surface);
3363 
3364  setCairo(nullptr);
3366  cairo_destroy(cr);
3367  }
3368 }
3369 
3370 void CairoImageOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, const int *maskColors, bool inlineImg)
3371 {
3372  cairo_t *cr;
3374  double x1, y1, x2, y2;
3375  CairoImage *image;
3376 
3377  getBBox(state, width, height, &x1, &y1, &x2, &y2);
3378 
3379  image = new CairoImage(x1, y1, x2, y2);
3380  saveImage(image);
3381 
3384  cr = cairo_create(surface);
3385  setCairo(cr);
3386  cairo_translate(cr, 0, height);
3387  cairo_scale(cr, width, -height);
3388 
3389  CairoOutputDev::drawImage(state, ref, str, width, height, colorMap, interpolate, maskColors, inlineImg);
3390  image->setImage(surface);
3391 
3392  setCairo(nullptr);
3394  cairo_destroy(cr);
3395  }
3396 }
3397 
3398 void CairoImageOutputDev::drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, GfxImageColorMap *maskColorMap,
3399  bool maskInterpolate)
3400 {
3401  cairo_t *cr;
3403  double x1, y1, x2, y2;
3404  CairoImage *image;
3405 
3406  getBBox(state, width, height, &x1, &y1, &x2, &y2);
3407 
3408  image = new CairoImage(x1, y1, x2, y2);
3409  saveImage(image);
3410 
3413  cr = cairo_create(surface);
3414  setCairo(cr);
3415  cairo_translate(cr, 0, height);
3416  cairo_scale(cr, width, -height);
3417 
3418  CairoOutputDev::drawSoftMaskedImage(state, ref, str, width, height, colorMap, interpolate, maskStr, maskWidth, maskHeight, maskColorMap, maskInterpolate);
3419  image->setImage(surface);
3420 
3421  setCairo(nullptr);
3423  cairo_destroy(cr);
3424  }
3425 }
3426 
3427 void CairoImageOutputDev::drawMaskedImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, bool interpolate, Stream *maskStr, int maskWidth, int maskHeight, bool maskInvert, bool maskInterpolate)
3428 {
3429  cairo_t *cr;
3431  double x1, y1, x2, y2;
3432  CairoImage *image;
3433 
3434  getBBox(state, width, height, &x1, &y1, &x2, &y2);
3435 
3436  image = new CairoImage(x1, y1, x2, y2);
3437  saveImage(image);
3438 
3441  cr = cairo_create(surface);
3442  setCairo(cr);
3443  cairo_translate(cr, 0, height);
3444  cairo_scale(cr, width, -height);
3445 
3446  CairoOutputDev::drawMaskedImage(state, ref, str, width, height, colorMap, interpolate, maskStr, maskWidth, maskHeight, maskInvert, maskInterpolate);
3447  image->setImage(surface);
3448 
3449  setCairo(nullptr);
3451  cairo_destroy(cr);
3452  }
3453 }
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
int ptrdiff_t
Definition: CPAL.d:3845
double det(const Matrix &m)
Definition: Matrix.cpp:34
#define strdup
Definition: Utility.h:167
double ury
Definition: aftopl.c:56
double urx
Definition: aftopl.c:55
double lly
Definition: aftopl.c:54
double wx
Definition: aftopl.c:57
double llx
Definition: aftopl.c:53
#define y0
#define width(a)
Definition: aptex-macros.h:198
#define box(a)
Definition: aptex-macros.h:675
#define x0
#define height(a)
Definition: aptex-macros.h:200
#define text(a)
Definition: aptex-macros.h:925
#define mode
Definition: aptex-macros.h:510
static FT_Face font_face[65536]
Definition: aptex-src.c:20633
void cairo_font_options_set_antialias(cairo_font_options_t *options, cairo_antialias_t antialias)
cairo_font_options_t * cairo_font_options_create(void)
void cairo_font_options_destroy(cairo_font_options_t *options)
int cairo_image_surface_get_height(cairo_surface_t *surface)
int cairo_image_surface_get_stride(cairo_surface_t *surface)
unsigned char * cairo_image_surface_get_data(cairo_surface_t *surface)
cairo_surface_t * cairo_image_surface_create(cairo_format_t format, int width, int height)
int cairo_image_surface_get_width(cairo_surface_t *surface)
void cairo_matrix_init_scale(cairo_matrix_t *matrix, double sx, double sy)
Definition: cairo-matrix.c:219
void cairo_matrix_init_translate(cairo_matrix_t *matrix, double tx, double ty)
Definition: cairo-matrix.c:173
cairo_status_t cairo_matrix_invert(cairo_matrix_t *matrix)
Definition: cairo-matrix.c:586
void cairo_matrix_transform_distance(const cairo_matrix_t *matrix, double *dx, double *dy)
Definition: cairo-matrix.c:387
void cairo_matrix_init(cairo_matrix_t *matrix, double xx, double yx, double xy, double yy, double x0, double y0)
Definition: cairo-matrix.c:111
void cairo_matrix_translate(cairo_matrix_t *matrix, double tx, double ty)
Definition: cairo-matrix.c:197
void cairo_matrix_scale(cairo_matrix_t *matrix, double sx, double sy)
Definition: cairo-matrix.c:242
void cairo_matrix_multiply(cairo_matrix_t *result, const cairo_matrix_t *a, const cairo_matrix_t *b)
Definition: cairo-matrix.c:331
const char * cairo_status_to_string(cairo_status_t status)
Definition: cairo-misc.c:87
void cairo_path_destroy(cairo_path_t *path)
Definition: cairo-path.c:366
cairo_status_t cairo_pattern_status(cairo_pattern_t *pattern)
void cairo_mesh_pattern_set_control_point(cairo_pattern_t *pattern, unsigned int point_num, double x, double y)
void cairo_mesh_pattern_end_patch(cairo_pattern_t *pattern)
cairo_pattern_t * cairo_pattern_reference(cairo_pattern_t *pattern)
cairo_pattern_t * cairo_pattern_create_rgb(double red, double green, double blue)
cairo_pattern_t * cairo_pattern_create_rgba(double red, double green, double blue, double alpha)
void cairo_pattern_destroy(cairo_pattern_t *pattern)
void cairo_mesh_pattern_line_to(cairo_pattern_t *pattern, double x, double y)
cairo_pattern_t * cairo_pattern_create_radial(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)
void cairo_pattern_set_matrix(cairo_pattern_t *pattern, const cairo_matrix_t *matrix)
cairo_status_t cairo_pattern_get_surface(cairo_pattern_t *pattern, cairo_surface_t **surface)
cairo_pattern_type_t cairo_pattern_get_type(cairo_pattern_t *pattern)
void cairo_mesh_pattern_begin_patch(cairo_pattern_t *pattern)
void cairo_pattern_add_color_stop_rgba(cairo_pattern_t *pattern, double offset, double red, double green, double blue, double alpha)
void cairo_pattern_set_extend(cairo_pattern_t *pattern, cairo_extend_t extend)
cairo_pattern_t * cairo_pattern_create_for_surface(cairo_surface_t *surface)
void cairo_pattern_get_matrix(cairo_pattern_t *pattern, cairo_matrix_t *matrix)
cairo_pattern_t * cairo_pattern_create_mesh(void)
void cairo_pattern_set_filter(cairo_pattern_t *pattern, cairo_filter_t filter)
void cairo_mesh_pattern_move_to(cairo_pattern_t *pattern, double x, double y)
void cairo_mesh_pattern_curve_to(cairo_pattern_t *pattern, double x1, double y1, double x2, double y2, double x3, double y3)
cairo_pattern_t * cairo_pattern_create_linear(double x0, double y0, double x1, double y1)
void cairo_mesh_pattern_set_corner_color_rgb(cairo_pattern_t *pattern, unsigned int corner_num, double red, double green, double blue)
cairo_surface_t * cairo_surface_reference(cairo_surface_t *surface)
void cairo_surface_destroy(cairo_surface_t *surface)
void cairo_surface_set_device_offset(cairo_surface_t *surface, double x_offset, double y_offset)
void cairo_surface_get_device_offset(cairo_surface_t *surface, double *x_offset, double *y_offset)
cairo_surface_t * cairo_surface_create_similar(cairo_surface_t *other, cairo_content_t content, int width, int height)
cairo_status_t cairo_surface_set_mime_data(cairo_surface_t *surface, const char *mime_type, const unsigned char *data, unsigned long length, cairo_destroy_func_t destroy, void *closure)
cairo_status_t cairo_surface_status(cairo_surface_t *surface)
cairo_surface_type_t cairo_surface_get_type(cairo_surface_t *surface)
void cairo_surface_mark_dirty(cairo_surface_t *surface)
cairo_bool_t cairo_surface_has_show_text_glyphs(cairo_surface_t *surface)
void cairo_set_matrix(cairo_t *cr, const cairo_matrix_t *matrix)
Definition: cairo.c:1513
void cairo_set_font_options(cairo_t *cr, const cairo_font_options_t *options)
Definition: cairo.c:3235
void cairo_rectangle(cairo_t *cr, double x, double y, double width, double height)
Definition: cairo.c:2078
void cairo_translate(cairo_t *cr, double tx, double ty)
Definition: cairo.c:1409
void cairo_scale(cairo_t *cr, double sx, double sy)
Definition: cairo.c:1436
cairo_status_t cairo_status(cairo_t *cr)
Definition: cairo.c:4338
void cairo_get_font_options(cairo_t *cr, cairo_font_options_t *options)
Definition: cairo.c:3269
double cairo_get_line_width(cairo_t *cr)
Definition: cairo.c:4052
void cairo_push_group_with_content(cairo_t *cr, cairo_content_t content)
Definition: cairo.c:731
void cairo_set_line_width(cairo_t *cr, double width)
Definition: cairo.c:1172
void cairo_close_path(cairo_t *cr)
Definition: cairo.c:2139
void cairo_show_text_glyphs(cairo_t *cr, const char *utf8, int utf8_len, const cairo_glyph_t *glyphs, int num_glyphs, const cairo_text_cluster_t *clusters, int num_clusters, cairo_text_cluster_flags_t cluster_flags)
Definition: cairo.c:3670
void cairo_set_fill_rule(cairo_t *cr, cairo_fill_rule_t fill_rule)
Definition: cairo.c:1131
void cairo_device_to_user(cairo_t *cr, double *x, double *y)
Definition: cairo.c:1609
void cairo_line_to(cairo_t *cr, double x, double y)
Definition: cairo.c:1736
void cairo_stroke(cairo_t *cr)
Definition: cairo.c:2360
void cairo_transform(cairo_t *cr, const cairo_matrix_t *matrix)
Definition: cairo.c:1488
void cairo_set_line_cap(cairo_t *cr, cairo_line_cap_t line_cap)
Definition: cairo.c:1207
cairo_pattern_t * cairo_pop_group(cairo_t *cr)
Definition: cairo.c:766
cairo_t * cairo_create(cairo_surface_t *target)
Definition: cairo.c:446
cairo_line_join_t cairo_get_line_join(cairo_t *cr)
Definition: cairo.c:4091
void cairo_fill(cairo_t *cr)
Definition: cairo.c:2415
void cairo_save(cairo_t *cr)
Definition: cairo.c:624
void cairo_glyph_path(cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
Definition: cairo.c:3843
void cairo_set_source_rgb(cairo_t *cr, double red, double green, double blue)
Definition: cairo.c:893
cairo_surface_t * cairo_get_group_target(cairo_t *cr)
Definition: cairo.c:4188
void cairo_restore(cairo_t *cr)
Definition: cairo.c:648
void cairo_set_font_face(cairo_t *cr, cairo_font_face_t *font_face)
Definition: cairo.c:3097
cairo_path_t * cairo_copy_path(cairo_t *cr)
Definition: cairo.c:4225
void cairo_push_group(cairo_t *cr)
Definition: cairo.c:706
void cairo_device_to_user_distance(cairo_t *cr, double *dx, double *dy)
Definition: cairo.c:1632
double cairo_get_miter_limit(cairo_t *cr)
Definition: cairo.c:4110
void cairo_set_antialias(cairo_t *cr, cairo_antialias_t antialias)
Definition: cairo.c:1103
void cairo_set_line_join(cairo_t *cr, cairo_line_join_t line_join)
Definition: cairo.c:1239
void cairo_user_to_device(cairo_t *cr, double *x, double *y)
Definition: cairo.c:1564
void cairo_user_to_device_distance(cairo_t *cr, double *dx, double *dy)
Definition: cairo.c:1587
cairo_surface_t * cairo_get_target(cairo_t *cr)
Definition: cairo.c:4158
void cairo_paint_with_alpha(cairo_t *cr, double alpha)
Definition: cairo.c:2239
void cairo_set_source(cairo_t *cr, cairo_pattern_t *source)
Definition: cairo.c:1011
void cairo_curve_to(cairo_t *cr, double x1, double y1, double x2, double y2, double x3, double y3)
Definition: cairo.c:1771
void cairo_get_matrix(cairo_t *cr, cairo_matrix_t *matrix)
Definition: cairo.c:4128
void cairo_move_to(cairo_t *cr, double x, double y)
Definition: cairo.c:1706
void cairo_append_path(cairo_t *cr, const cairo_path_t *path)
Definition: cairo.c:4292
cairo_t * cairo_reference(cairo_t *cr)
Definition: cairo.c:490
void cairo_get_dash(cairo_t *cr, double *dashes, double *offset)
Definition: cairo.c:1341
int cairo_get_dash_count(cairo_t *cr)
Definition: cairo.c:1316
void cairo_mask(cairo_t *cr, cairo_pattern_t *pattern)
Definition: cairo.c:2265
void cairo_show_glyphs(cairo_t *cr, const cairo_glyph_t *glyphs, int num_glyphs)
Definition: cairo.c:3610
void cairo_paint(cairo_t *cr)
Definition: cairo.c:2213
cairo_line_cap_t cairo_get_line_cap(cairo_t *cr)
Definition: cairo.c:4072
void cairo_new_path(cairo_t *cr)
Definition: cairo.c:1650
void cairo_pop_group_to_source(cairo_t *cr)
Definition: cairo.c:809
void cairo_set_operator(cairo_t *cr, cairo_operator_t op)
Definition: cairo.c:832
void cairo_destroy(cairo_t *cr)
Definition: cairo.c:519
void cairo_clip(cairo_t *cr)
Definition: cairo.c:2706
void cairo_set_dash(cairo_t *cr, const double *dashes, int num_dashes, double offset)
Definition: cairo.c:1287
void cairo_clip_extents(cairo_t *cr, double *x1, double *y1, double *x2, double *y2)
Definition: cairo.c:2801
void cairo_set_font_matrix(cairo_t *cr, const cairo_matrix_t *matrix)
Definition: cairo.c:3186
void cairo_set_miter_limit(cairo_t *cr, double limit)
Definition: cairo.c:1382
@ CAIRO_SURFACE_TYPE_PS
Definition: cairo.h:2400
enum _cairo_filter cairo_filter_t
@ CAIRO_LINE_JOIN_ROUND
Definition: cairo.h:802
@ CAIRO_LINE_JOIN_BEVEL
Definition: cairo.h:803
@ CAIRO_LINE_JOIN_MITER
Definition: cairo.h:801
@ CAIRO_FILTER_GOOD
Definition: cairo.h:2951
@ CAIRO_FILTER_FAST
Definition: cairo.h:2950
@ CAIRO_FILTER_NEAREST
Definition: cairo.h:2953
#define CAIRO_MIME_TYPE_UNIQUE_ID
Definition: cairo.h:2458
#define CAIRO_MIME_TYPE_JP2
Definition: cairo.h:2456
enum _cairo_antialias cairo_antialias_t
#define CAIRO_MIME_TYPE_CCITT_FAX
Definition: cairo.h:2462
@ CAIRO_EXTEND_PAD
Definition: cairo.h:2920
@ CAIRO_EXTEND_NONE
Definition: cairo.h:2917
@ CAIRO_EXTEND_REPEAT
Definition: cairo.h:2918
@ CAIRO_STATUS_SUCCESS
Definition: cairo.h:315
@ CAIRO_CONTENT_ALPHA
Definition: cairo.h:381
@ CAIRO_CONTENT_COLOR_ALPHA
Definition: cairo.h:382
enum _cairo_content cairo_content_t
#define CAIRO_MIME_TYPE_CCITT_FAX_PARAMS
Definition: cairo.h:2463
#define CAIRO_MIME_TYPE_JPEG
Definition: cairo.h:2454
@ CAIRO_ANTIALIAS_DEFAULT
Definition: cairo.h:710
@ CAIRO_LINE_CAP_ROUND
Definition: cairo.h:778
@ CAIRO_LINE_CAP_BUTT
Definition: cairo.h:777
@ CAIRO_LINE_CAP_SQUARE
Definition: cairo.h:779
@ CAIRO_OPERATOR_HARD_LIGHT
Definition: cairo.h:639
@ CAIRO_OPERATOR_COLOR_BURN
Definition: cairo.h:638
@ CAIRO_OPERATOR_HSL_LUMINOSITY
Definition: cairo.h:646
@ CAIRO_OPERATOR_SCREEN
Definition: cairo.h:633
@ CAIRO_OPERATOR_OVERLAY
Definition: cairo.h:634
@ CAIRO_OPERATOR_LIGHTEN
Definition: cairo.h:636
@ CAIRO_OPERATOR_HSL_HUE
Definition: cairo.h:643
@ CAIRO_OPERATOR_MULTIPLY
Definition: cairo.h:632
@ CAIRO_OPERATOR_DARKEN
Definition: cairo.h:635
@ CAIRO_OPERATOR_COLOR_DODGE
Definition: cairo.h:637
@ CAIRO_OPERATOR_HSL_COLOR
Definition: cairo.h:645
@ CAIRO_OPERATOR_SOFT_LIGHT
Definition: cairo.h:640
@ CAIRO_OPERATOR_ADD
Definition: cairo.h:629
@ CAIRO_OPERATOR_DIFFERENCE
Definition: cairo.h:641
@ CAIRO_OPERATOR_EXCLUSION
Definition: cairo.h:642
@ CAIRO_OPERATOR_HSL_SATURATION
Definition: cairo.h:644
@ CAIRO_OPERATOR_DEST_OUT
Definition: cairo.h:625
@ CAIRO_OPERATOR_SOURCE
Definition: cairo.h:616
@ CAIRO_OPERATOR_OVER
Definition: cairo.h:617
enum _cairo_status cairo_status_t
@ CAIRO_FORMAT_A8
Definition: cairo.h:420
@ CAIRO_FORMAT_RGB24
Definition: cairo.h:419
@ CAIRO_FORMAT_ARGB32
Definition: cairo.h:418
@ CAIRO_FORMAT_A1
Definition: cairo.h:421
#define CAIRO_MIME_TYPE_JBIG2
Definition: cairo.h:2459
#define CAIRO_MIME_TYPE_JBIG2_GLOBAL
Definition: cairo.h:2460
@ CAIRO_FILL_RULE_EVEN_ODD
Definition: cairo.h:755
@ CAIRO_FILL_RULE_WINDING
Definition: cairo.h:754
enum _cairo_text_cluster_flags cairo_text_cluster_flags_t
#define CAIRO_MIME_TYPE_JBIG2_GLOBAL_ID
Definition: cairo.h:2461
@ CAIRO_PATTERN_TYPE_SOLID
Definition: cairo.h:2825
static struct brw_reg stride(struct brw_reg reg, uint32_t vstride, uint32_t width, uint32_t hstride)
void begin(const GfxState *state, const GooString *text)
void addChar(const GfxState *state, double x, double y, double dx, double dy, CharCode c, int nBytes, const Unicode *u, int uLen)
void end(const GfxState *state)
bool getEndOfLine()
Definition: Stream.h:957
int getColumns()
Definition: Stream.h:960
int getEncoding()
Definition: Stream.h:956
bool getEndOfBlock()
Definition: Stream.h:959
bool getBlackIs1()
Definition: