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

Function skip_quad

src/laybasic/laybasic/layRedrawThreadWorker.cc:95–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95static bool
96skip_quad (const db::Box &qb, const lay::Bitmap *vertex_bitmap, const db::CplxTrans &trans)
97{
98 double threshold = 32 / trans.mag (); // only check cells below 32x32 pixels
99 if (qb.empty () || qb.width () > threshold || qb.height () > threshold || !vertex_bitmap) {
100 return false;
101 }
102
103 db::DBox qb_trans = (trans * qb) & db::DBox (0, 0, vertex_bitmap->width () - 1.0 - 1e-6, vertex_bitmap->height () - 1.0 - 1e-6);
104 if (qb_trans.empty ()) {
105 return true;
106 }
107
108 int ixmin = (unsigned int)(qb_trans.left () + 0.5);
109 int ixmax = (unsigned int)(qb_trans.right () + 0.5);
110 int iymin = (unsigned int)(qb_trans.bottom () + 0.5);
111 int iymax = (unsigned int)(qb_trans.top () + 0.5);
112 if (! has_zero_bit (vertex_bitmap, ixmin, iymin, ixmax, iymax)) {
113 return true; // skip
114 } else {
115 return false;
116 }
117}
118
119inline void
120copy_bitmap (const lay::Bitmap *from, lay::Bitmap *to, int dx, int dy)

Callers 3

draw_boxes_implMethod · 0.70
draw_text_layerMethod · 0.70
draw_layer_wo_cacheMethod · 0.70

Calls 8

has_zero_bitFunction · 0.85
leftMethod · 0.80
rightMethod · 0.80
bottomMethod · 0.80
topMethod · 0.80
emptyMethod · 0.45
widthMethod · 0.45
heightMethod · 0.45

Tested by

no test coverage detected