pub fn roi_from_draw(kind: RoiDrawKind, params: &DrawParams) -> Option<Roi>Expand description
Build the Roi from a finished draw’s DrawParams, the
setFirstShapePoints equivalent per ROI class (items/roi.py,
items/_arc_roi.py, items/_band_roi.py). Returns None for a
(kind, params) pair that roi_draw_mode can never produce together
(e.g. an HLine/VLine/FreeHand params for any ROI kind), so an
unexpected pairing is dropped rather than mis-built.
Geometry per kind (each silx default cited inline):
Rect<-Rectangle{x,y,w,h}(silx_setBound,items/roi.py:558).Line<-Lineendpoints (silxsetEndPoints,items/roi.py:254).Polygon<-Polygonvertices (silxsetPoints,items/roi.py:1236).Point/Cross<-Point(silxsetPosition(points[0]),items/roi.py:89/:176).Circle<-Line:center = start,radius = |end - start|(silxCircleROI._setRay,items/roi.py:782).Ellipse<-Ellipse{center, semi_axes}:radii = semi_axes(the silxSelectEllipseinteraction; seeroi_draw_mode).HRange<-Line:y = (min, max)of the two endpoint Ys (the band over a Y range; silxHorizontalRangeROI.setFirstShapePointsis the X analogue,items/roi.py:1420).VRange<-Line:x = (min, max)of the two endpoint Xs (silxHorizontalRangeROI.setFirstShapePoints,items/roi.py:1420).Arc<-Line: the faithful silx default arc from the 2 diameter points (silxArcROI.setFirstShapePoints+_createGeometryFromControlPoints,items/_arc_roi.py:363/:622); seearc_from_two_points.Band<-Line:begin = start,end = end,width = 0.1 * |end - begin|(silxBandGeometry.createdefault width,items/_band_roi.py:64-66).