feat: add outline raster component#11
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
Outlineraster effect that wraps aRasterComponentand paints a solid-colored ring around the outside of the child's alpha shape. MirrorsDropShadowin shape: it owns awidth(logical units) and acolor, expandspaint_boundsso the stroke isn't clipped, leaveslayout_boxuntouched, and routes the child render throughctx.render(...)so the inner subtree is memoized independently.tellur-renderer::outline(new):Outline { width, color, child }.paint_boundswidens the child rect bywidthon all sides;layoutis pass-through.renderrasterizes the child once, dilates the alpha channel bywidth, subtracts the original alpha to leave only the ring, appliescolor, and compositesoutlinethenchildsource-over.round(width * sx)/round(width * sy), so the output image is exactly the size ofpaint_bounds * (sx, sy). Usingmax(sx, sy)(matching the existingDropShadowpattern) would have pushed the outline past the buffer edge under anisotropic ratios and gotten silently clipped bycomposite_at.make_outline's ring =saturating_sub(dilated, original), so pixels fully inside the child contribute zero and only the outside band carries color.color.amultiplies through, matchingDropShadow's convention.timeline_to_mp4'sBouncingDotis nowCircle → Outline (white, 4px) → DropShadow, so the shadow falls behind the combined stroked shape. Added an unquantized first track (rawt) ahead of the 60/30/24/16 fps tracks so the smooth motion is the explicit baseline.Outlineis registered ontellur-renderer::liband re-exported alongsideDropShadow.CachingRenderContextpicks it up automatically — in the example the entireOutlinesubtree is one miss + 1199 hits across the timeline.