Commit Graph

6098 Commits

Author SHA1 Message Date
Matthias Köfferlein 3c6b342448
Merge pull request #2387 from querielo/kirill/pixelbuffer-to-bytes
Add PixelBuffer#to_bytes for zero-overhead pixel access
2026-07-16 22:58:35 +02:00
Kirill Osipov 9a606ec4e9 Cap PixelBuffer.from_bytes dimensions at 64k x 64k
Following review feedback, the reader now rejects a header claiming a
width or height beyond 65536, guarding against malformed byte streams
that would otherwise trigger an unreasonable allocation. The writer
stays full 32-bit ('unlimited'), and native little-endian order and the
transparency mask are kept as-is. Adds Ruby and Python tests for the
oversized-header rejection.

Ref: https://github.com/KLayout/klayout/pull/2387#issuecomment-4984941409
2026-07-16 19:03:34 +02:00
Kirill Osipov 2fa7b24345 Add PixelBuffer#from_bytes and width/height header to to_bytes 2026-07-16 19:03:34 +02:00
Matthias Köfferlein 4ac26d686d
Merge pull request #2388 from KLayout/bugfix/issue-2384
Fixed issue #2384
2026-07-12 00:23:03 +02:00
Matthias Koefferlein 43a5d8c548 Fixed issue #2384
Problem was that the magnification was applied twice
when running the checks inside compound DRC checks.
2026-07-09 23:43:25 +02:00
Kirill Osipov 35ec1107b6 Add PixelBuffer#to_bytes for zero-overhead RGBA pixel access
Exposes a GSI method on tl::PixelBuffer that returns the raw ARGB32
contents as a byte vector (4 bytes per pixel, row-major, top to bottom)
via a single memcpy. Unlike to_png_data this skips all image encoding,
which is useful when the caller just wants direct pixel data.
2026-07-06 12:55:26 +02:00
Kirill Osipov 7d6aa2e728 Use multiple drawing workers for image_with_options rendering
LayoutCanvas::image_with_options always rendered the layout with a
single thread (workers = 0), which serialized image generation even on
views configured for parallel drawing. Now it honors the view's
drawing_workers() count when the view is not in synchronous mode, and
waits for the asynchronous workers to finish before reading back the
rendered bitmaps. This speeds up image export on large layouts while
preserving the original single-threaded behavior in synchronous mode.
2026-07-06 11:09:28 +02:00
Matthias Koefferlein 6270877110 Updating stubs 2026-05-27 23:47:09 +02:00
Matthias Koefferlein 7d5f61db59 Issue #2360: Implemented name sorting by default (can be turned off) for 'make_top_level_pins' 2026-05-26 23:26:16 +02:00
Matthias Koefferlein 6e0d968058 Python stubs regenerated, DRC/LVS doc updated 2026-05-25 22:01:03 +02:00
Matthias Koefferlein 4db6afb5f3 Merge remote-tracking branch 'origin/bugfix/issue-2356' into wip 2026-05-25 20:51:55 +02:00
Matthias Koefferlein be8b165b6a Merge remote-tracking branch 'origin/bugfix/issue-2350' into wip 2026-05-25 20:51:42 +02:00
Matthias Koefferlein 7508c8e4a4 Enabling context writing also for top cells - this allows the OASIS writer to generate proxy cells on output during fix of issue #2350 2026-05-25 01:13:58 +02:00
Matthias Koefferlein 37977d21e9 Fixing issue #2350 (strm2oas writes empty OAS)
Problem was that the OASIS writer was simply ignoring
all top level proxy cells (PCells, Library references).

The original bug #1835 fixed that by changing the
reader behavior, so it would keep top level proxies.
However, doing the spin through the writer got them
removed and in addition, the cleanup happing during
editing would also remove them.

Solution is to centralize the strategy of cleaning
cells. The cleanup now is changed to not remove
proxy top cells if they are the only ones. This is
consistent with the previous reader-only behavior.

The writer implements the same behavior by means
dropping cells marked for cleanup, instead of simply
skipping all proxy cells.
2026-05-25 00:09:38 +02:00
Matthias Koefferlein 249de43350 Fixed some compiler warnings 2026-05-25 00:07:30 +02:00
Matthias Koefferlein 95271e3edc Fixing color interpolation of false color maps
Problem was when an interval was separated from
the rest through a discontinuous color and did not have any
color range (start and end color same).

The new scheme fixes the problem by computing a
data mapping that has two slightly distinct values
for the two discontinuous colors.
2026-05-24 19:17:33 +02:00
Matthias Koefferlein 472a7aa7fd Adding Gaussian hat average mode to density map 2026-05-24 19:17:23 +02:00
Matthias Koefferlein 0648ee1bd0 Merge branch 'wip' 2026-05-24 15:26:19 +02:00
Matthias Koefferlein 8992222d9d Enabling Qt-less builds 2026-05-24 15:10:21 +02:00
Matthias Koefferlein 378d2cd961 Changed visibility management of tool options (aka "Editor options")
Now, the tool options dock is either visible or not. Visibility
can be configured like for the other docks. Key binding stays
"F3" by default for the dock visibility.

The dock is populated with pages depending on the tool. It may
also be empty.
2026-05-24 14:10:45 +02:00
Matthias Koefferlein 4cc1d2ff9a Fixed a potential crash
This bug was triggered during development and happened
because the tool bar build code was invalidating
QAction objects indirectly while they are used for
building the main menu.

Solution is to separate building of menu bar and
tool bar / context menus.
2026-05-24 14:09:08 +02:00
Matthias Koefferlein cb918203c7 Adding the ruler options widget and disabling editor options in viewer mode 2026-05-24 00:17:25 +02:00
Matthias Koefferlein c8362d16f1 Adding a ruler options widget page 2026-05-24 00:16:35 +02:00
Matthias Koefferlein 98a8d370aa Tweaking the snap behavior on ruler move a little. 2026-05-24 00:15:51 +02:00
Matthias Koefferlein 3371333dd7 img plugin does not need editor options pages. 2026-05-24 00:14:18 +02:00
Matthias Koefferlein e42bb63e8a Renaming 'editor options' to 'tool options' 2026-05-24 00:13:51 +02:00
Matthias Koefferlein 4d77056da1 For more clarity change 'snap to objects (unless disabled in template)' to 'never snap to object' (inverted) in rulers config. 2026-05-24 00:11:57 +02:00
Matthias Koefferlein b5be4fc497 Small bugfix on object snap - observe snap directions
Problem: snapping with angle constraints and object snapping
sometimes gave results not conforming to the angle constaints.
This happened when shape edges are parallel to the cutlines that
define the angle constraint.
2026-05-24 00:00:30 +02:00
Matthias Koefferlein 014f3d0644 [consider merging] tab order in density map dialog 2026-05-23 21:19:57 +02:00
Matthias Koefferlein aa50562e38 [consider merging] Fixed a type bug in l2n reader 2026-05-23 21:19:52 +02:00
Matthias Koefferlein 4afe2e5e8a Merge remote-tracking branch 'origin/master' into feature/issue-2337 2026-05-20 19:07:39 +02:00
Matthias Köfferlein 0eed5d6ea5
Merge pull request #2354 from KLayout/wip
Wip
2026-05-20 19:06:25 +02:00
Matthias Köfferlein 10860d5a68
Merge pull request #2352 from KLayout/bugfix/issue-2345
A contribution to issue #2345 mitigation
2026-05-20 19:06:12 +02:00
Matthias Köfferlein 0ca31fb9a6
Merge pull request #2347 from KLayout/bugfix/issue-2344
Fixing issue #2344 (preserving properties on PCell instantiation with…
2026-05-20 19:04:14 +02:00
Matthias Köfferlein 337c910ce0
Merge pull request #2346 from KLayout/bugfix/issue-2343
Fixed issue #2343 (loss of collinear points in copy_tree and other pl…
2026-05-20 19:03:59 +02:00
Matthias Köfferlein 8488c59c15
Merge pull request #2342 from KLayout/feature/issue-2335
Fixing issue #2335
2026-05-20 19:03:40 +02:00
Matthias Köfferlein 41ef531d37
Merge pull request #2341 from KLayout/bugfix/issue-2339
Fixing issue #2339
2026-05-20 19:03:04 +02:00
Matthias Koefferlein f74e71f728 Implementing averaging window for density map 2026-05-19 00:04:06 +02:00
Matthias Koefferlein f2b1e389bd Enhancements to density map feature 2026-05-18 22:25:43 +02:00
Matthias Koefferlein ae46712f45 WIP on density map feature 2026-05-11 23:48:55 +02:00
Matthias Koefferlein 974a300bdc First draft for density map feature. 2026-05-11 22:19:12 +02:00
Matthias Koefferlein 5c9ccf34f7 Fixing a glitch in the data mapping widget (when editing the value, the node got deselected, but the colors boxes were still enabled) 2026-05-09 23:09:11 +02:00
Matthias Koefferlein 485ec8a413 Fixing builds 2026-05-07 00:11:39 +02:00
Matthias Koefferlein 838b2409b0 Maintaining data_id during modification of layer inside device extractor -> this way, the name-to-layer link is maintained inside the DRC engine 2026-05-07 00:10:22 +02:00
Matthias Koefferlein 9630bff240 A contribution to issue #2345 mitigation
With this patch, empty layers can be used to place device
terminals on and these shapes are visible on those layers.
This allows splitting the terminal shapes and used those
shapes to connect down to different substrates.

The patch turns EmptyLayer into a DeepLayer when used
as terminal layer for device extraction.
2026-05-05 23:08:09 +02:00
Matthias Koefferlein c85be6bce5 Adding string serialization "from_s" for objects with properties (CAUTION: side effect!)
Problem was that "to_s" did not deliver a parsable string for the
properties. This is fixed, but the format of the properties part
of the string changes.
2026-05-03 20:27:15 +02:00
Matthias Koefferlein 77fb74e072 Supporting to_bytes and from_bytes also for the ..WithProperties types 2026-05-03 18:10:00 +02:00
Matthias Koefferlein 1de28f2d6b Refactoring, some enhancements to tl::Variant
- Split binary and regular streams
- Binary serialization of tl::Variant
- Fixing tl::Variant parsable string representation for byte arrays and char
  (Format is '...'b for byte arrays and '.'c for chars).
- tl::to_quoted_string now allows 0 characters in the string
  (escapes to '\000')
2026-05-03 16:24:14 +02:00
Matthias Koefferlein 7f6071db31 Some refactoring, bug fixes 2026-05-03 00:15:47 +02:00
Matthias Koefferlein fdaa93d234 First implementation of to_bytes/from_bytes for Vector,Point,Box,Polygon,SimplePolygon,Trans,CplxTrans,Text,Path,Edge,EdgePair and variants 2026-05-02 23:21:35 +02:00