toCompositeImage() currently always flattens every surface in the file (see _compositeOrder() in src/atelier.ts). The Obsidian plugin wants to build a layer on/off toggle for its .spd viewer (philips/supernote-obsidian-plugin#138) — showing/hiding individual layers and re-rendering the composite — which needs a way to composite only a chosen subset of surfaces instead of always all of them.
Proposed: an optional parameter, e.g.
async toCompositeImage(visibleSurfaces?: Iterable<IAtelierSurfaceName>): Promise<Image | null>
undefined (default) keeps current behavior (every surface, via _compositeOrder()); when passed, _compositeOrder()'s result gets filtered down to just the requested surface names before compositing, preserving the existing bottom-to-top layers-based ordering.
Should include a test exercising a partial subset (e.g. hiding the reference layer) against tests/input/real-device.spd.
toCompositeImage()currently always flattens every surface in the file (see_compositeOrder()insrc/atelier.ts). The Obsidian plugin wants to build a layer on/off toggle for its.spdviewer (philips/supernote-obsidian-plugin#138) — showing/hiding individual layers and re-rendering the composite — which needs a way to composite only a chosen subset of surfaces instead of always all of them.Proposed: an optional parameter, e.g.
undefined(default) keeps current behavior (every surface, via_compositeOrder()); when passed,_compositeOrder()'s result gets filtered down to just the requested surface names before compositing, preserving the existing bottom-to-toplayers-based ordering.Should include a test exercising a partial subset (e.g. hiding the reference layer) against
tests/input/real-device.spd.