Rotate/crop dialog

The rotatecrop module provides a dialog box providing essential GUI elements for rotating (arbitrary angle) and cropping an image:

Reference

class plotpy.widgets.rotatecrop.RotateCropDialog(parent: QWidget, title: str | None = None, options: PlotOptions | dict[str, Any] | None = None, resize_to: tuple[int, int] | None = None, edit: bool = True, toolbar: bool = False)[source]

Rotate & Crop Dialog

Rotate and crop a TrImageItem plot item

Parameters:
  • parent – Parent widget

  • title – Dialog title

  • options – Options dict

  • resize_to – Resize dialog to (width, height)

  • edit – Show “Edit” button

  • toolbar – Show toolbar

add_buttons_to_layout(layout: QBoxLayout, edit: bool) None[source]

Add buttons to layout

Parameters:

layout – Layout

class plotpy.widgets.rotatecrop.RotateCropWidget(parent: QWidget, toolbar: bool = False, options: PlotOptions | dict[str, Any] | None = None)[source]

Rotate & Crop Widget

Rotate and crop a TrImageItem plot item

Parameters:
  • parent – Parent widget

  • toolbar – Show toolbar

  • options – Plot options

add_buttons_to_layout(layout: QBoxLayout) None[source]

Add tool buttons to layout

Parameters:

layout – Layout

apply_transformation() None[source]

Apply transformation

reset() None[source]

Reset transformation

reject_changes() None[source]

Reject changes

show_crop_rect(state: bool) None[source]

Show/hide cropping rectangle shape

Parameters:

state – Show/hide state