MCPcopy Create free account
hub / github.com/KLayout/klayout / fill

Method fill

src/laybasic/laybasic/layBitmap.cc:353–382  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

351static const uint32_t all_ones = 0xffffffff;
352
353void
354Bitmap::fill (unsigned int y, unsigned int x1, unsigned int x2)
355{
356 unsigned int b1 = x1 / 32;
357
358 uint32_t *sl = scanline (y);
359 sl += b1;
360
361 unsigned int b = x2 / 32 - b1;
362 if (b == 0) {
363
364 *sl |= (masks [x2 % 32] & ~masks [x1 % 32]);
365
366 } else if (b > 0) {
367
368 *sl++ |= ~masks [x1 % 32];
369 while (b > 1) {
370 *sl++ |= all_ones;
371 b--;
372 }
373
374 unsigned int m = masks [x2 % 32];
375 // Hint: if x2==width and width%32==0, sl must not be accessed. This is guaranteed by
376 // checking if m != 0.
377 if (m) {
378 *sl |= m;
379 }
380
381 }
382}
383
384void
385Bitmap::clear (unsigned int y, unsigned int x1, unsigned int x2)

Callers 15

startDragMethod · 0.45
create_pixmap_forMethod · 0.45
updateMethod · 0.45
colored_iconFunction · 0.45
startDragMethod · 0.45
update_patternMethod · 0.45
build_color_menuMethod · 0.45
set_color_internalMethod · 0.45
loadResourceMethod · 0.45
dataMethod · 0.45
layBitmap.ccFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected