in src/open_vp_cal/widgets/swatch_analysis_widget.py [0:0]
def __init__(self, project_settings, parent=None):
super().__init__(parent)
self.led_walls = []
self.view = ImageViewerGraphicsView()
self.scene = QGraphicsScene()
self.view.setScene(self.scene)
self.project_settings = project_settings
# slider for exposure control
self.slider = QSlider(Qt.Horizontal)
self.slider.setRange(-10, 10)
self.slider.setValue(0)
self.slider.valueChanged.connect(self.exposure_changed)
# spin box for displaying slider value
self.spin_box = QSpinBox()
self.spin_box.setRange(-10, 10)
self.spin_box.setValue(0)
self.slider.valueChanged.connect(self.spin_box.setValue)
self.spin_box.valueChanged.connect(self.slider.setValue)
display_space_layout = QHBoxLayout()
self.display_transform_combo_box = QComboBox()
self.display_transform_label = QLabel("Display")
display_space_layout.addWidget(self.display_transform_label)
display_space_layout.addWidget(self.display_transform_combo_box)
view_space_layout = QHBoxLayout()
self.view_combo_box = QComboBox()
self.view_label = QLabel("View")
view_space_layout.addWidget(self.view_label)
view_space_layout.addWidget(self.view_combo_box)
preview_calibration_layout = QHBoxLayout()
self.preview_calibration_checkbox = QCheckBox()
self.preview_calibration_checkbox.setChecked(False)
self.preview_calibration_checkbox.stateChanged.connect(self.preview_calibration_changed)
self.preview_calibration_label = QLabel("Preview Calibration")
preview_calibration_layout.addWidget(self.preview_calibration_label)
preview_calibration_layout.addWidget(self.preview_calibration_checkbox)
apply_white_balance_layout = QHBoxLayout()
self.apply_white_balance_checkbox = QCheckBox()
self.apply_white_balance_checkbox.setChecked(True)
self.apply_white_balance_checkbox.stateChanged.connect(self.preview_calibration_changed)
self.apply_white_balance_label = QLabel("Apply White Balance Preview")
apply_white_balance_layout.addWidget(self.apply_white_balance_label)
apply_white_balance_layout.addWidget(self.apply_white_balance_checkbox)
# label for the slider
self.label = QLabel("Exposure")
layout = QVBoxLayout()
layout.addWidget(self.view)
# layout for slider and its label
slider_layout = QHBoxLayout()
slider_layout.addWidget(self.label)
slider_layout.addWidget(self.slider)
slider_layout.addWidget(self.spin_box)
controls_layout = QHBoxLayout()
controls_layout.addLayout(slider_layout)
controls_layout.addLayout(display_space_layout)
controls_layout.addLayout(view_space_layout)
controls_layout.addLayout(apply_white_balance_layout)
controls_layout.addLayout(preview_calibration_layout)
layout.addLayout(controls_layout)
self.setLayout(layout)
self.ocio_config = None
self._image_cache = {}
self.init()