spacr.qt.widgets.channel_picker¶
Compact RGB channel controls for image-view settings.
The widget presents R, G, and B as independent toggles while preserving the canonical comma-separated value used by existing settings files. This keeps the active channels visible without accepting ambiguous free-form spellings.
Classes¶
Select RGB channels with three checkboxes. |
Functions¶
Module Contents¶
- class spacr.qt.widgets.channel_picker.ChannelPicker(value: Any = '', parent: PySide6.QtWidgets.QWidget | None = None, *, allow_none: bool = True)[source]¶
Bases:
PySide6.QtWidgets.QWidgetSelect RGB channels with three checkboxes.
The public value is a canonical comma-separated string such as
"r,g,b". Clearing every channel can be allowed for normalization controls or refused for displays that must retain a visible channel.Initialize the picker.
- Parameters:
value (Any, default='') – Initial channel selection.
parent (QWidget, optional) – Parent widget.
allow_none (bool, default=True) – Allow every channel to be cleared. Image displays normally set this to
False; normalization controls may use an empty value to mean that no channel is normalized.
- setText(value: Any) None[source]¶
Set the picker from a settings string.
NAMED FOR QLineEdit’s method on purpose: the settings form writes every field the same way, so a control that took a different setter would have to be special-cased everywhere it is poured into.
- Parameters:
value – the channels, as the settings dict spells them.
- spacr.qt.widgets.channel_picker.parse(value: Any) tuple[source]¶
Return the recognized channels in canonical RGB order.
- Parameters:
value (Any) – A comma-separated string, an iterable of names, or an empty value.
- Returns:
tuple of str – Recognized channel names in
('r', 'g', 'b')order. Unknown names are omitted rather than inferred.