Wrap a raw kernel shape into a properly branded type.
Performs a downcast and wraps in a disposable handle.
Note: When D is '2D', Shell/Solid/CompSolid are not valid members
of AnyShape<'2D'>. If the kernel shape happens to be one of these types,
they will be cast unsoundly. For normal usage, call castShape() without a
dimension (it defaults to '3D') or castShape3D, which does the same.
Wrap a raw kernel shape into a properly branded type. Performs a downcast and wraps in a disposable handle.
Note: When
Dis'2D', Shell/Solid/CompSolid are not valid members ofAnyShape<'2D'>. If the kernel shape happens to be one of these types, they will be cast unsoundly. For normal usage, callcastShape()without a dimension (it defaults to'3D') or castShape3D, which does the same.