feat(selection): separate selection geometry from image content processing
- Introduced a new design for selection rasterization that decouples the selection geometry from the image content, ensuring that the SelectionMask is independent of the source image's alpha and color. - Updated the `rasterize_selection_path` function to only accept selection paths and image dimensions, removing parameters related to source alpha and alpha thresholds. - Implemented a new approach for handling selection paths using non-zero winding fill, ensuring overlapping areas are preserved. - Enhanced performance by utilizing a scanline algorithm for rasterization, significantly reducing processing time for high-resolution images. - Updated internal documentation and added comprehensive tests to validate the new behavior and performance improvements. - Ensured backward compatibility by maintaining existing interfaces where necessary while introducing breaking changes in the selection processing logic.
This commit is contained in:
@@ -10,7 +10,7 @@ sys.path.insert(
|
||||
str(next((PROJECT_ROOT / "src" / "anyimage" / "wheels").glob("blendjob-*.whl"))),
|
||||
)
|
||||
|
||||
from anyimage.common.object import (
|
||||
from anyimage.common.material import (
|
||||
DEPTH_MATERIAL_NODE_GROUP_NAME,
|
||||
IMAGE_MATERIAL_NODE_GROUP_NAME,
|
||||
)
|
||||
@@ -62,7 +62,6 @@ def main():
|
||||
"Geometry",
|
||||
"Subdivide",
|
||||
"Thickness",
|
||||
"Material",
|
||||
]
|
||||
assert depth_plane.bl_idname == "GeometryNodeTree"
|
||||
assert depth_plane.is_modifier
|
||||
@@ -70,12 +69,30 @@ def main():
|
||||
"Geometry",
|
||||
"Subdivide",
|
||||
"Thickness",
|
||||
"Depth Amount",
|
||||
"Reference Depth",
|
||||
"Depth Scale",
|
||||
"Base Plane Depth",
|
||||
"Uniform Scale",
|
||||
"Depth Image",
|
||||
"Material",
|
||||
]
|
||||
depth_panels = [
|
||||
item for item in depth_plane.interface.items_tree if item.item_type == "PANEL"
|
||||
]
|
||||
assert [panel.name for panel in depth_panels] == ["Options", "Data"]
|
||||
assert [item.name for item in depth_panels[0].interface_items] == [
|
||||
"Base Plane Depth"
|
||||
]
|
||||
assert [item.name for item in depth_panels[1].interface_items] == [
|
||||
"Uniform Scale",
|
||||
"Depth Image",
|
||||
]
|
||||
assert all(panel.default_closed for panel in depth_panels)
|
||||
assert all(item.hide_in_modifier for item in depth_panels[1].interface_items)
|
||||
depth_subdivide = next(
|
||||
item
|
||||
for item in depth_plane.interface.items_tree
|
||||
if item.item_type == "SOCKET" and item.name == "Subdivide"
|
||||
)
|
||||
assert depth_subdivide.default_value == 6
|
||||
assert image_layer.bl_idname == "ShaderNodeTree"
|
||||
assert input_names(image_layer) == [
|
||||
"Color",
|
||||
|
||||
Reference in New Issue
Block a user