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

Method screenshot

src/laybasic/laybasic/layLayoutCanvas.cc:917–945  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

915}
916
917tl::PixelBuffer
918LayoutCanvas::screenshot ()
919{
920 // if required, start the redraw thread ..
921 prepare_drawing ();
922
923 tl::PixelBuffer img (m_viewport.width (), m_viewport.height ());
924 img.fill (m_background);
925
926 DetachedViewObjectCanvas vo_canvas (background_color (), foreground_color (), active_color (), m_viewport_l.width (), m_viewport_l.height (), resolution (), font_resolution (), &img);
927
928 // and paint the background objects. It uses "img" to paint on.
929 do_render_bg (m_viewport_l, vo_canvas);
930
931 // paint the layout bitmaps
932 to_image (scaled_view_ops (1.0 / resolution ()), dither_pattern (), line_styles (), 1.0 / resolution (), background_color (), foreground_color (), active_color (), this, *vo_canvas.bg_image (), m_viewport_l.width (), m_viewport_l.height ());
933
934 // subsample current image to provide the background for the foreground objects
935 vo_canvas.make_background ();
936
937 // render the foreground parts ..
938 do_render (m_viewport_l, vo_canvas, true);
939 vo_canvas.transfer_to_image (dither_pattern (), line_styles (), m_viewport.width (), m_viewport.height ());
940
941 do_render (m_viewport_l, vo_canvas, false);
942 vo_canvas.transfer_to_image (dither_pattern (), line_styles (), m_viewport.width (), m_viewport.height ());
943
944 return img;
945}
946
947void
948LayoutCanvas::resize_event (unsigned int width, unsigned int height)

Callers 6

loadResourceMethod · 0.80
details_textMethod · 0.80
update_screenshotMethod · 0.80
get_screenshotMethod · 0.80
get_screenshot_pbMethod · 0.80
save_screenshotMethod · 0.80

Calls 12

dither_patternFunction · 0.85
make_backgroundMethod · 0.80
transfer_to_imageMethod · 0.80
background_colorFunction · 0.70
foreground_colorFunction · 0.70
active_colorFunction · 0.70
resolutionFunction · 0.70
font_resolutionFunction · 0.70
widthMethod · 0.45
heightMethod · 0.45
fillMethod · 0.45
bg_imageMethod · 0.45

Tested by

no test coverage detected