Skip to content

SupernoteAtelier.toCompositeImage(): support filtering to a subset of layers #35

Description

@philips-clanker

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions