Coverage Report

Created: 2026-06-22 07:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/xpdf-4.06/splash/SplashXPathScanner.cc
Line
Count
Source
1
//========================================================================
2
//
3
// SplashXPathScanner.cc
4
//
5
// Copyright 2003-2013 Glyph & Cog, LLC
6
//
7
//========================================================================
8
9
#include <aconf.h>
10
11
#include <stdlib.h>
12
#include <string.h>
13
#if HAVE_STD_SORT
14
#include <algorithm>
15
#endif
16
#include "gmem.h"
17
#include "gmempp.h"
18
#include "GList.h"
19
#include "SplashMath.h"
20
#include "SplashXPath.h"
21
#include "SplashXPathScanner.h"
22
23
//------------------------------------------------------------------------
24
25
#if ANTIALIAS_256
26
27
#define aaVert  15
28
#define aaHoriz 17
29
30
#else
31
32
41.8M
#define aaVert  4
33
9.17M
#define aaHoriz 4
34
35
// 4x4 oversampling tends to generate alpha (coverage) values that are
36
// too high, so we reduce them here. (Yes, this is a kludge.)
37
static Guchar map16to255[17] = {
38
  0,
39
  16 / 2,
40
  32 / 2,
41
  48 / 2,
42
  64 - 32,
43
  80 - 32,
44
  96 - 32,
45
  112 - 32,
46
  128 - 32,
47
  143 - 32,
48
  159 - 32,
49
  175 - 32,
50
  191 - 32,
51
  207 - 32,
52
  223 - 32,
53
  239 - 32,
54
  255
55
};
56
57
#endif
58
59
//------------------------------------------------------------------------
60
61
SplashXPathScanner::SplashXPathScanner(SplashXPath *xPathA, GBool eo,
62
128k
               int yMinA, int yMaxA) {
63
128k
  xPath = xPathA;
64
128k
  eoMask = eo ? 1 : 0xffffffff;
65
128k
  yMin = yMinA;
66
128k
  yMax = yMaxA;
67
128k
  if (xPath->isRect) {
68
16.0k
    rectX0I = splashFloor(xPath->rectX0);
69
16.0k
    rectY0I = splashFloor(xPath->rectY0);
70
16.0k
    rectX1I = splashFloor(xPath->rectX1);
71
16.0k
    rectY1I = splashFloor(xPath->rectY1);
72
16.0k
  }
73
74
128k
  pre = &preSeg;
75
128k
  post = &postSeg;
76
128k
  pre->mx = xPath->xMin - 1;
77
128k
  post->mx = xPath->xMax + 1;
78
79
128k
  resetDone = gFalse;
80
128k
  resetAA = gFalse;
81
128k
}
82
83
128k
SplashXPathScanner::~SplashXPathScanner() {
84
128k
}
85
86
void SplashXPathScanner::insertSegmentBefore(SplashXPathSeg *s,
87
2.40M
               SplashXPathSeg *sNext) {
88
2.40M
  SplashXPathSeg *sPrev;
89
90
2.40M
  sPrev = sNext->prev;
91
2.40M
  sPrev->next = s;
92
2.40M
  s->prev = sPrev;
93
2.40M
  s->next = sNext;
94
2.40M
  sNext->prev = s;
95
2.40M
}
96
97
1.25M
void SplashXPathScanner::removeSegment(SplashXPathSeg *s) {
98
1.25M
  SplashXPathSeg *sPrev, *sNext;
99
100
1.25M
  sPrev = s->prev;
101
1.25M
  sNext = s->next;
102
1.25M
  sPrev->next = sNext;
103
1.25M
  sNext->prev = sPrev;
104
1.25M
  s->prev = s->next = NULL;
105
1.25M
}
106
107
void SplashXPathScanner::moveSegmentAfter(SplashXPathSeg *s,
108
174k
            SplashXPathSeg *sPrev) {
109
174k
  SplashXPathSeg *sNext;
110
111
174k
  s->prev->next = s->next;
112
174k
  s->next->prev = s->prev;
113
114
174k
  sNext = sPrev->next;
115
174k
  sPrev->next = s;
116
174k
  s->prev = sPrev;
117
174k
  s->next = sNext;
118
174k
  sNext->prev = s;
119
174k
}
120
121
93.1k
void SplashXPathScanner::reset(GBool aa, GBool aaChanged) {
122
93.1k
  SplashXPathSeg *seg;
123
93.1k
  SplashCoord y;
124
93.1k
  int i;
125
126
  //--- initialize segment parameters
127
29.0M
  for (i = 0; i < xPath->length; ++i) {
128
28.9M
    seg = &xPath->segs[i];
129
28.9M
    if (aa) {
130
21.3M
      if (aaChanged) {
131
19.2M
  seg->iy = splashFloor(seg->y0 * aaVert);
132
19.2M
      }
133
21.3M
      y = (SplashCoord)(seg->iy + 1) / (SplashCoord)aaVert;
134
21.3M
    } else {
135
7.58M
      if (aaChanged) {
136
5.75M
  seg->iy = splashFloor(seg->y0);
137
5.75M
      }
138
7.58M
      y = (SplashCoord)(seg->iy + 1);
139
7.58M
    }
140
28.9M
    seg->sx0 = seg->x0;
141
28.9M
    if (seg->y1 <= y) {
142
15.7M
      seg->sx1 = seg->x1;
143
15.7M
    } else {
144
13.1M
      seg->sx1 = seg->x0 + (y - seg->y0) * seg->dxdy;
145
13.1M
    }
146
28.9M
    seg->mx = (seg->sx0 <= seg->sx1) ? seg->sx0 : seg->sx1;
147
28.9M
    seg->prev = seg->next = NULL;
148
28.9M
  }
149
150
  //--- sort the inactive segments by iy, mx
151
93.1k
  if (aaChanged) {
152
32.5k
#if HAVE_STD_SORT
153
32.5k
    std::sort(xPath->segs, xPath->segs + xPath->length, &SplashXPathSeg::cmpMX);
154
#else
155
    qsort(xPath->segs, xPath->length, sizeof(SplashXPathSeg),
156
    &SplashXPathSeg::cmpMX);
157
#endif
158
32.5k
  }
159
160
  //--- initialize the active list
161
93.1k
  pre->prev = NULL;
162
93.1k
  pre->next = post;
163
93.1k
  post->prev = pre;
164
93.1k
  post->next = NULL;
165
166
  //--- initialize the scan state
167
93.1k
  nextSeg = 0;
168
93.1k
  if (xPath->length) {
169
91.4k
    yBottomI = xPath->segs[0].iy;
170
91.4k
    if (aa) {
171
85.8k
      yBottomI -= yBottomI % aaVert;
172
85.8k
    }
173
91.4k
  } else {
174
1.69k
    yBottomI = 0;
175
1.69k
  }
176
93.1k
  yTopI = yBottomI - 1;
177
93.1k
  if (aa) {
178
87.5k
    yTop = (SplashCoord)yTopI / (SplashCoord)aaVert;
179
87.5k
    yBottom = (SplashCoord)yBottomI / (SplashCoord)aaVert;
180
87.5k
  } else {
181
5.67k
    yTop = (SplashCoord)yTopI;
182
5.67k
    yBottom = (SplashCoord)yBottomI;
183
5.67k
  }
184
185
93.1k
  resetDone = gTrue;
186
93.1k
  resetAA = aa;
187
93.1k
}
188
189
78.8k
void SplashXPathScanner::skip(int newYBottomI, GBool aa) {
190
78.8k
  SplashXPathSeg *s0, *s1,*s2;
191
78.8k
  int iy;
192
193
78.8k
  yTopI = newYBottomI - 1;
194
78.8k
  yBottomI = newYBottomI;
195
78.8k
  if (aa) {
196
73.5k
    yTop = (SplashCoord)yTopI / (SplashCoord)aaVert;
197
73.5k
    yBottom = (SplashCoord)yBottomI / (SplashCoord)aaVert;
198
73.5k
  } else {
199
5.33k
    yTop = (SplashCoord)yTopI;
200
5.33k
    yBottom = (SplashCoord)yBottomI;
201
5.33k
  }
202
203
  //--- remove finished segments; update sx0, sx1, mx for active segments
204
78.8k
  s0 = pre->next;
205
78.8k
  while (s0 != post) {
206
0
    s1 = s0->next;
207
208
    // check for a finished segment
209
0
    if (s0->y1 < yTop) {
210
0
      removeSegment(s0);
211
212
    // compute sx0, sx1, mx
213
0
    } else {
214
0
      if (s0->y0 >= yTop) {
215
0
  s0->sx0 = s0->x0;
216
0
      } else {
217
0
  s0->sx0 = s0->x0 + (yTop - s0->y0) * s0->dxdy;
218
0
      }
219
0
      if (s0->y1 <= yBottom) {
220
0
  s0->sx1 = s0->x1;
221
0
      } else {
222
0
  s0->sx1 = s0->x0 + (yBottom - s0->y0) * s0->dxdy;
223
0
      }
224
0
      s0->mx = (s0->sx0 <= s0->sx1) ? s0->sx0 : s0->sx1;
225
0
    }
226
227
0
    s0 = s1;
228
0
  }
229
230
  //--- check for intersections
231
78.8k
  s0 = pre->next;
232
78.8k
  if (s0 != post) {
233
0
    s1 = s0->next;
234
0
    while (s1 != post) {
235
0
      if (s1->mx < s0->mx) {
236
0
  for (s2 = s0->prev; s1->mx < s2->mx; s2 = s2->prev) ;
237
0
  moveSegmentAfter(s1, s2);
238
0
      } else {
239
0
  s0 = s1;
240
0
      }
241
0
      s1 = s0->next;
242
0
    }
243
0
  }
244
245
  //--- insert new segments with a merge sort
246
  // - this has to be done one (sub)scanline at a time, because the
247
  //   inactive list is bin-sorted by (sub)scanline
248
5.38M
  while (nextSeg < xPath->length && xPath->segs[nextSeg].iy <= yTopI) {
249
    // the first inactive segment determines the next scanline to process
250
5.30M
    iy = xPath->segs[nextSeg].iy;
251
5.30M
    s0 = pre->next;
252
13.3M
    do {
253
13.3M
      s1 = &xPath->segs[nextSeg];
254
13.3M
      ++nextSeg;
255
13.3M
      if (s1->y1 < yTop) {
256
12.4M
  continue;
257
12.4M
      }
258
951k
      if (s1->y0 >= yTop) {
259
799
  s1->sx0 = s1->x0;
260
950k
      } else {
261
950k
  s1->sx0 = s1->x0 + (yTop - s1->y0) * s1->dxdy;
262
950k
      }
263
951k
      if (s1->y1 <= yBottom) {
264
5.83k
  s1->sx1 = s1->x1;
265
945k
      } else {
266
945k
  s1->sx1 = s1->x0 + (yBottom - s1->y0) * s1->dxdy;
267
945k
      }
268
951k
      s1->mx = (s1->sx0 <= s1->sx1) ? s1->sx0 : s1->sx1;
269
951k
      insertSegmentBefore(s1, s0);
270
13.3M
    } while (nextSeg < xPath->length && xPath->segs[nextSeg].iy <= iy);
271
5.30M
  }
272
78.8k
}
273
274
315k
void SplashXPathScanner::advance(GBool aa) {
275
315k
  SplashXPathSeg *s, *sNext, *s1;
276
277
315k
  yTopI = yBottomI;
278
315k
  yTop = yBottom;
279
315k
  yBottomI = yTopI + 1;
280
315k
  if (aa) {
281
309k
    yBottom = (SplashCoord)yBottomI / (SplashCoord)aaVert;
282
309k
  } else {
283
5.65k
    yBottom = (SplashCoord)yBottomI;
284
5.65k
  }
285
286
315k
  s = pre->next;
287
5.33M
  while (s != post) {
288
5.01M
    sNext = s->next;
289
290
    // check for a finished segment
291
5.01M
    if (s->y1 < yTop) {
292
1.25M
      removeSegment(s);
293
294
3.76M
    } else {
295
296
      // compute sx0, sx1, mx
297
3.76M
      s->sx0 = s->sx1;
298
3.76M
      if (s->y1 <= yBottom) {
299
5.28k
  s->sx1 = s->x1;
300
3.75M
      } else {
301
3.75M
  s->sx1 = s->x0 + (yBottom - s->y0) * s->dxdy;
302
3.75M
      }
303
3.76M
      s->mx = (s->sx0 <= s->sx1) ? s->sx0 : s->sx1;
304
305
      // check for intersection
306
3.76M
      if (s->mx < s->prev->mx) {
307
59.2M
  for (s1 = s->prev->prev; s->mx < s1->mx; s1 = s1->prev) ;
308
174k
  moveSegmentAfter(s, s1);
309
174k
      }
310
3.76M
    }
311
312
5.01M
    s = sNext;
313
5.01M
  }
314
315
  // insert new segments
316
315k
  s = pre->next;
317
1.77M
  while (nextSeg < xPath->length && xPath->segs[nextSeg].iy <= yTopI) {
318
1.45M
    s1 = &xPath->segs[nextSeg];
319
1.45M
    ++nextSeg;
320
1.46M
    while (s1->mx > s->mx) {
321
3.24k
      s = s->next;
322
3.24k
    }
323
1.45M
    insertSegmentBefore(s1, s);
324
1.45M
  }
325
315k
}
326
327
void SplashXPathScanner::generatePixels(int x0, int x1, Guchar *line,
328
309k
          int *xMin, int *xMax) {
329
309k
  SplashXPathSeg *s;
330
309k
  int fillCount, x, xEnd, ix0, ix1, t;
331
332
309k
  fillCount = 0;
333
309k
  x = x0 * aaHoriz;
334
309k
  xEnd = (x1 + 1) * aaHoriz;
335
2.32M
  for (s = pre->next; s != post && x < xEnd; s = s->next) {
336
2.01M
    ix0 = splashFloor(s->sx0 * aaHoriz);
337
2.01M
    ix1 = splashFloor(s->sx1 * aaHoriz);
338
2.01M
    if (ix0 > ix1) {
339
406k
      t = ix0;  ix0 = ix1;  ix1 = t;
340
406k
    }
341
2.01M
    if (!(fillCount & eoMask)) {
342
551k
      if (ix0 > x) {
343
26.5k
  x = ix0;
344
26.5k
      }
345
551k
    }
346
2.01M
    if (ix1 >= xEnd) {
347
44.4k
      ix1 = xEnd - 1;
348
44.4k
    }
349
2.01M
    if (x / aaHoriz < *xMin) {
350
72.9k
      *xMin = x / aaHoriz;
351
72.9k
    }
352
2.01M
    if (ix1 / aaHoriz > *xMax) {
353
74.3k
      *xMax = ix1 / aaHoriz;
354
74.3k
    }
355
2.35M
    for (; x <= ix1; ++x) {
356
332k
      ++line[x / aaHoriz];
357
332k
    }
358
2.01M
    if (s->y0 <= yTop && s->y1 > yTop) {
359
1.96M
      fillCount += s->count;
360
1.96M
    }
361
2.01M
  }
362
309k
}
363
364
void SplashXPathScanner::generatePixelsBinary(int x0, int x1, Guchar *line,
365
5.65k
                int *xMin, int *xMax) {
366
5.65k
  SplashXPathSeg *s;
367
5.65k
  int fillCount, x, xEnd, ix0, ix1, t;
368
369
5.65k
  fillCount = 0;
370
5.65k
  x = x0;
371
5.65k
  xEnd = x1 + 1;
372
14.2k
  for (s = pre->next; s != post && x < xEnd; s = s->next) {
373
8.60k
    ix0 = splashFloor(s->sx0);
374
8.60k
    ix1 = splashFloor(s->sx1);
375
8.60k
    if (ix0 > ix1) {
376
1.32k
      t = ix0;  ix0 = ix1;  ix1 = t;
377
1.32k
    }
378
8.60k
    if (!(fillCount & eoMask)) {
379
6.49k
      if (ix0 > x) {
380
14
  x = ix0;
381
14
      }
382
6.49k
    }
383
8.60k
    if (ix1 >= xEnd) {
384
387
      ix1 = xEnd - 1;
385
387
    }
386
8.60k
    if (x < *xMin) {
387
5.62k
      *xMin = x;
388
5.62k
    }
389
8.60k
    if (ix1 > *xMax) {
390
5.54k
      *xMax = ix1;
391
5.54k
    }
392
14.1k
    for (; x <= ix1; ++x) {
393
5.52k
      line[x] = 255;
394
5.52k
    }
395
8.60k
    if (s->y0 <= yTop && s->y1 > yTop) {
396
7.23k
      fillCount += s->count;
397
7.23k
    }
398
8.60k
  }
399
5.65k
}
400
401
void SplashXPathScanner::drawRectangleSpan(Guchar *line, int y,
402
             int x0, int x1,
403
10.1k
             int *xMin, int *xMax) {
404
10.1k
  SplashCoord edge;
405
10.1k
  Guchar pix;
406
10.1k
  int xe, x;
407
408
10.1k
  if (rectX0I > x1 || rectX1I < x0) {
409
154
    return;
410
154
  }
411
412
9.96k
  *xMin = x0 <= rectX0I ? rectX0I : x0;
413
9.96k
  *xMax = rectX1I <= x1 ? rectX1I : x1;
414
415
  //--- upper edge
416
9.96k
  if (y == rectY0I) {
417
418
    // handle a rectangle less than one pixel high
419
1.86k
    if (rectY0I == rectY1I) {
420
1.83k
      edge = xPath->rectY1 - xPath->rectY0;
421
1.83k
    } else {
422
32
      edge = (SplashCoord)1 - (xPath->rectY0 - rectY0I);
423
32
    }
424
425
    // upper left corner
426
1.86k
    if (x0 <= rectX0I) {
427
1.65k
      pix = (Guchar)splashCeil(edge
428
1.65k
             * ((SplashCoord)1 - (xPath->rectX0 - rectX0I))
429
1.65k
             * 255);
430
1.65k
      if (pix < 16) {
431
1.61k
  pix = 16;
432
1.61k
      }
433
1.65k
      line[rectX0I] = pix;
434
1.65k
      x = rectX0I + 1;
435
1.65k
    } else {
436
214
      x = x0;
437
214
    }
438
439
    // upper right corner
440
1.86k
    if (rectX1I <= x1) {
441
1.64k
      pix = (Guchar)splashCeil(edge * (xPath->rectX1 - rectX1I) * 255);
442
1.64k
      if (pix < 16) {
443
1.63k
  pix = 16;
444
1.63k
      }
445
1.64k
      line[rectX1I] = pix;
446
1.64k
      xe = rectX1I - 1;
447
1.64k
    } else {
448
223
      xe = x1;
449
223
    }
450
451
    // upper edge
452
1.86k
    pix = (Guchar)splashCeil(edge * 255);
453
1.86k
    if (pix < 16) {
454
1.83k
      pix = 16;
455
1.83k
    }
456
2.07k
    for (; x <= xe; ++x) {
457
214
      line[x] = pix;
458
214
    }
459
460
  //--- lower edge
461
8.10k
  } else if (y == rectY1I) {
462
306
    edge = xPath->rectY1 - rectY1I;
463
464
    // lower left corner
465
306
    if (x0 <= rectX0I) {
466
306
      pix = (Guchar)splashCeil(edge
467
306
             * ((SplashCoord)1 - (xPath->rectX0 - rectX0I))
468
306
             * 255);
469
306
      if (pix < 16) {
470
303
  pix = 16;
471
303
      }
472
306
      line[rectX0I] = pix;
473
306
      x = rectX0I + 1;
474
306
    } else {
475
0
      x = x0;
476
0
    }
477
478
    // lower right corner
479
306
    if (rectX1I <= x1) {
480
306
      pix = (Guchar)splashCeil(edge * (xPath->rectX1 - rectX1I) * 255);
481
306
      if (pix < 16) {
482
306
  pix = 16;
483
306
      }
484
306
      line[rectX1I] = pix;
485
306
      xe = rectX1I - 1;
486
306
    } else {
487
0
      xe = x1;
488
0
    }
489
490
    // lower edge
491
306
    pix = (Guchar)splashCeil(edge * 255);
492
306
    if (pix < 16) {
493
303
      pix = 16;
494
303
    }
495
306
    for (; x <= xe; ++x) {
496
0
      line[x] = pix;
497
0
    }
498
499
  //--- between the upper and lower edges
500
7.79k
  } else if (y > rectY0I && y < rectY1I) {
501
502
    // left edge
503
7.73k
    if (x0 <= rectX0I) {
504
4.07k
      pix = (Guchar)splashCeil(((SplashCoord)1 - (xPath->rectX0 - rectX0I))
505
4.07k
             * 255);
506
4.07k
      if (pix < 16) {
507
0
  pix = 16;
508
0
      }
509
4.07k
      line[rectX0I] = pix;
510
4.07k
      x = rectX0I + 1;
511
4.07k
    } else {
512
3.66k
      x = x0;
513
3.66k
    }
514
515
    // right edge
516
7.73k
    if (rectX1I <= x1) {
517
2.49k
      pix = (Guchar)splashCeil((xPath->rectX1 - rectX1I) * 255);
518
2.49k
      if (pix < 16) {
519
2.30k
  pix = 16;
520
2.30k
      }
521
2.49k
      line[rectX1I] = pix;
522
2.49k
      xe = rectX1I - 1;
523
5.24k
    } else {
524
5.24k
      xe = x1;
525
5.24k
    }
526
527
    // middle
528
11.3k
    for (; x <= xe; ++x) {
529
3.60k
      line[x] = 255;
530
3.60k
    }
531
7.73k
  }
532
9.96k
}
533
534
void SplashXPathScanner::drawRectangleSpanBinary(Guchar *line, int y,
535
             int x0, int x1,
536
14
             int *xMin, int *xMax) {
537
14
  int xe, x;
538
539
14
  if (y >= rectY0I && y <= rectY1I) {
540
14
    if (x0 <= rectX0I) {
541
14
      x = rectX0I;
542
14
    } else {
543
0
      x = x0;
544
0
    }
545
14
    *xMin = x;
546
14
    if (rectX1I <= x1) {
547
14
      xe = rectX1I;
548
14
    } else {
549
0
      xe = x1;
550
0
    }
551
14
    *xMax = xe;
552
28
    for (; x <= xe; ++x) {
553
14
      line[x] = 255;
554
14
    }
555
14
  }
556
14
}
557
558
void SplashXPathScanner::getSpan(Guchar *line, int y, int x0, int x1,
559
87.5k
         int *xMin, int *xMax) {
560
87.5k
  int iy, x, k;
561
562
87.5k
  iy = y * aaVert;
563
87.5k
  if (!resetDone || !resetAA) {
564
28.4k
    reset(gTrue, gTrue);
565
59.0k
  } else if (yBottomI > iy) {
566
59.0k
    reset(gTrue, gFalse);
567
59.0k
  }
568
87.5k
  memset(line + x0, 0, x1 - x0 + 1);
569
570
87.5k
  *xMin = x1 + 1;
571
87.5k
  *xMax = x0 - 1;
572
573
87.5k
  if (xPath->isRect) {
574
10.1k
    drawRectangleSpan(line, y, x0, x1, xMin, xMax);
575
10.1k
    return;
576
10.1k
  }
577
578
77.3k
  if (yBottomI < iy) {
579
73.5k
    skip(iy, gTrue);
580
73.5k
  }
581
386k
  for (k = 0; k < aaVert; ++k, ++iy) {
582
309k
    advance(gTrue);
583
309k
    generatePixels(x0, x1, line, xMin, xMax);
584
309k
  }
585
586
77.3k
#if !ANTIALIAS_256
587
149k
  for (x = *xMin; x <= *xMax; ++x) {
588
71.8k
    line[x] = map16to255[line[x]];
589
71.8k
  }
590
77.3k
#endif
591
77.3k
}
592
593
void SplashXPathScanner::getSpanBinary(Guchar *line, int y, int x0, int x1,
594
5.67k
               int *xMin, int *xMax) {
595
5.67k
  int iy;
596
597
5.67k
  iy = y;
598
5.67k
  if (!resetDone || resetAA) {
599
4.08k
    reset(gFalse, gTrue);
600
4.08k
  } else if (yBottomI > iy) {
601
1.58k
    reset(gFalse, gFalse);
602
1.58k
  }
603
5.67k
  memset(line + x0, 0, x1 - x0 + 1);
604
605
5.67k
  *xMin = x1 + 1;
606
5.67k
  *xMax = x0 - 1;
607
608
5.67k
  if (xPath->isRect) {
609
14
    drawRectangleSpanBinary(line, y, x0, x1, xMin, xMax);
610
14
    return;
611
14
  }
612
613
5.65k
  if (yBottomI < iy) {
614
5.33k
    skip(iy, gFalse);
615
5.33k
  }
616
5.65k
  advance(gFalse);
617
5.65k
  generatePixelsBinary(x0, x1, line, xMin, xMax);
618
5.65k
}