Add comprehensive tests for image processing and mask functionalities

- Introduced tests for color image handling, ensuring source preservation and premultiplied alpha usage.
- Implemented tests for brush stroke operations, validating segment boundaries and brush anti-aliasing.
- Added tests for frame anti-aliasing, confirming correct rendering behavior with various alpha values and depth settings.
- Created tests for frame projection, ensuring accurate overlap calculations and half-plane clipping.
- Developed tests for image premultiplied retention, verifying behavior during loading and packing processes.
- Added undo functionality tests for mask operations, ensuring single transaction behavior during edits.
This commit is contained in:
2026-09-05 21:33:11 +08:00
parent bbaa4bff46
commit 1994d38ccd
111 changed files with 7691 additions and 2341 deletions

View File

@@ -5,11 +5,10 @@ from .operators.clipboard_image import CLASSES as CLIPBOARD_CLASSES
from .menu import AnyImageImageMenu, draw_image_context_menu
from .operators import CLASSES as OPERATOR_CLASSES
from .operators.cutout_tool import CutoutTool
from .operators.crop_tool import (
CropBoxTool,
CropLassoTool,
CropPerspectiveTool,
CropPolylineTool,
from .operators.image_edit_tool import (
FrameTool,
MaskTool,
RectifyTool,
)
from .panel import (
Ben2RemovalDebugPanel,
@@ -42,20 +41,15 @@ CLASSES = (
def register():
for class_type in CLASSES:
bpy.utils.register_class(class_type)
bpy.utils.register_tool(CropBoxTool, separator=True, group=True)
bpy.utils.register_tool(FrameTool, separator=True, group=True)
bpy.utils.register_tool(
CropLassoTool,
after={CropBoxTool.bl_idname},
MaskTool,
after={FrameTool.bl_idname},
separator=False,
)
bpy.utils.register_tool(
CropPolylineTool,
after={CropLassoTool.bl_idname},
separator=False,
)
bpy.utils.register_tool(
CropPerspectiveTool,
after={CropPolylineTool.bl_idname},
RectifyTool,
after={MaskTool.bl_idname},
separator=False,
)
bpy.utils.register_tool(CutoutTool)
@@ -70,10 +64,9 @@ def unregister():
runtime.unregister()
clipboard_image.unregister_keymaps()
bpy.utils.unregister_tool(CutoutTool)
bpy.utils.unregister_tool(CropPerspectiveTool)
bpy.utils.unregister_tool(CropPolylineTool)
bpy.utils.unregister_tool(CropLassoTool)
bpy.utils.unregister_tool(CropBoxTool)
bpy.utils.unregister_tool(RectifyTool)
bpy.utils.unregister_tool(MaskTool)
bpy.utils.unregister_tool(FrameTool)
bpy.types.VIEW3D_MT_object_context_menu.remove(draw_image_context_menu)
bpy.types.OUTLINER_MT_object.remove(draw_image_context_menu)
if hasattr(bpy.types.Scene, "anyimage_settings"):