VoxelReady¶
Namespace Nfty.Core.Editing in assembly Nfty.Core.
Makes a book's art voxel-ready: every partially transparent pixel snaps at 50% to solid or clear, through AlphaSnap<TPixel>, so there is one snap rule. Depth maps are untouched — a pixel turning solid has no stored depth, so it rises at paper; one turning clear never had any.
Fields¶
Threshold¶
Alpha at or above this snaps solid; below it snaps clear.
Methods¶
Apply(LoadedCookBook)¶
Snaps every partial variant, returning a new graph. Clean variants and depth maps are shared with book, which is not disposed or modified.
Parameters
book(LoadedCookBook) - The book to make voxel-ready.
Returns. The snapped book plus what is needed to undo.
Plan(LoadedCookBook)¶
Lists what VoxelReady.Apply() would change. Writes nothing.
Parameters
book(LoadedCookBook) - The book to inspect.
Returns. One row per variant with partial alpha, ordinal by recipe, layer, variant.
Snap(Image<Rgba32>)¶
Snaps an image. The command's rule, applied to a copy.
Parameters
art(Image<Rgba32>) - The image to snap; left untouched.
Returns. A new image the caller owns.
Undo(LoadedCookBook, VoxelReadyResult)¶
Puts the pre-snap pixels back.
Parameters
current(LoadedCookBook) - The book as it stands now.applied(VoxelReadyResult) - WhatVoxelReady.Apply()returned.
Returns. A new graph with the original pixels restored (as clones; applied stays disposable).
Exceptions
InvalidOperationException- A snapped variant's pixels have changed sinceVoxelReady.Apply(); the message names each, and nothing is restored.