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

Function create_precursor_bitmaps

src/laybasic/laybasic/layBitmapsToImage.cc:433–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433static void create_precursor_bitmaps (const std::vector<lay::ViewOp> &view_ops_in, const std::vector <unsigned int> &vo_map, const std::vector<lay::Bitmap *> &pbitmaps_in, const std::vector<unsigned int> &bm_map, const lay::LineStyles &ls, unsigned int width, unsigned int height, std::map<unsigned int, lay::Bitmap> &precursors, tl::Mutex *mutex)
434{
435 tl_assert (bm_map.size () == vo_map.size ());
436
437 // Styled lines with width > 1 are not rendered directly, but through an intermediate step.
438 // We prepare the necessary precursor bitmaps now
439 for (unsigned int i = 0; i < vo_map.size (); ++i) {
440
441 unsigned int vo_index = vo_map [i];
442 unsigned int bm_index = bm_map [i];
443
444 const ViewOp &op = view_ops_in [vo_index];
445 if (op.width () > 1 && ls.style (op.line_style_index ()).width () > 0) {
446
447 // lock bitmaps against change by the redraw thread
448 if (mutex) {
449 mutex->lock ();
450 }
451
452 lay::Bitmap &bp = precursors.insert (std::make_pair (bm_index, lay::Bitmap (width, height, 1.0, 1.0))).first->second;
453 const LineStyleInfo &ls_info = ls.style (op.line_style_index ()).scaled (op.width ());
454
455 for (unsigned int y = 0; y < height; y++) {
456 render_scanline_std_edge (ls_info.pattern (), ls_info.pattern_stride (), pbitmaps_in [bm_index], y, width, height, bp.scanline (y));
457 }
458
459 if (mutex) {
460 mutex->unlock ();
461 }
462
463 }
464
465 }
466}
467
468void
469bitmaps_to_image (const std::vector<lay::ViewOp> &view_ops_in,

Callers 1

bitmaps_to_imageFunction · 0.85

Calls 11

render_scanline_std_edgeFunction · 0.85
styleMethod · 0.80
BitmapClass · 0.70
scanlineMethod · 0.60
sizeMethod · 0.45
widthMethod · 0.45
lockMethod · 0.45
insertMethod · 0.45
scaledMethod · 0.45
patternMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected