| 139 | } |
| 140 | |
| 141 | QWidget* ImageLayer::createConfigWidget(QWidget* parent) { |
| 142 | auto* widget = new QWidget(parent); |
| 143 | auto* layout = new QFormLayout(widget); |
| 144 | layout->setContentsMargins(0, 0, 0, 0); |
| 145 | |
| 146 | auto* rectify = new ToggleSwitch(widget); |
| 147 | rectify->setChecked(rectify_enabled_, /*animate=*/false); // snap to state without emitting toggled |
| 148 | rectify->setToolTip( |
| 149 | tr("Rectify (lens-undistort) the image using its camera calibration when a matching\n" |
| 150 | "CameraInfo is available. Turn off to show the raw image — e.g. when the stream is\n" |
| 151 | "already rectified and would otherwise be undistorted twice.")); |
| 152 | layout->addRow(tr("Rectify"), rectify); |
| 153 | connect(rectify, &ToggleSwitch::toggled, this, [this](bool on) { setRectifyEnabled(on); }); |
| 154 | |
| 155 | return widget; |
| 156 | } |
| 157 | |
| 158 | void ImageLayer::onBeforeDetach() { |
| 159 | image_source_ = nullptr; |
no test coverage detected