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

Method scanline

src/laybasic/laybasic/layBitmap.cc:92–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92uint32_t *
93Bitmap::scanline (unsigned int n)
94{
95 if (m_scanlines.empty ()) {
96 m_scanlines.resize (m_height, 0);
97 }
98
99 uint32_t *sl = m_scanlines [n];
100 if (sl == 0) {
101 unsigned int b = (m_width + 31) / 32;
102 if (! m_free.empty ()) {
103 sl = m_scanlines [n] = m_free.back ();
104 m_free.pop_back ();
105 } else {
106 sl = m_scanlines [n] = new uint32_t [b];
107 }
108 for (uint32_t *p = sl; b > 0; --b) {
109 *p++ = 0;
110 }
111 if (m_first_sl > n) {
112 m_first_sl = n;
113 }
114 if (m_last_sl <= n) {
115 m_last_sl = n + 1;
116 }
117 }
118 return sl;
119}
120
121void
122Bitmap::clear ()

Callers 1

mergeMethod · 0.60

Calls 4

emptyMethod · 0.45
resizeMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected