MCPcopy Create free account
hub / github.com/IENT/YUView / createVideoHandlerControls

Method createVideoHandlerControls

YUViewLib/src/video/rgb/videoHandlerRGB.cpp:235–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233}
234
235QLayout *videoHandlerRGB::createVideoHandlerControls(bool isSizeFixed)
236{
237 // Absolutely always only call this function once!
238 assert(!ui.created());
239
240 QVBoxLayout *newVBoxLayout = nullptr;
241 if (!isSizeFixed)
242 {
243 // Our parent (FrameHandler) also has controls to add. Create a new vBoxLayout and append the
244 // parent controls and our controls into that layout, separated by a line. Return that layout
245 newVBoxLayout = new QVBoxLayout;
246 newVBoxLayout->addLayout(FrameHandler::createFrameHandlerControls(isSizeFixed));
247
248 QFrame *line = new QFrame;
249 line->setObjectName(QStringLiteral("line"));
250 line->setFrameShape(QFrame::HLine);
251 line->setFrameShadow(QFrame::Sunken);
252 newVBoxLayout->addWidget(line);
253 }
254
255 ui.setupUi();
256
257 // Set all the values of the properties widget to the values of this class
258 ui.rgbFormatComboBox->addItems(functions::toQStringList(rgbPresetList.getFormattedNames()));
259 ui.rgbFormatComboBox->addItem("Custom...");
260 ui.rgbFormatComboBox->setEnabled(!isSizeFixed);
261 int idx = rgbPresetList.indexOf(srcPixelFormat);
262 if (idx == -1 && srcPixelFormat.isValid())
263 {
264 // Custom pixel format (but a known pixel format). Add and select it.
265 rgbPresetList.append(srcPixelFormat);
266 int nrItems = ui.rgbFormatComboBox->count();
267 ui.rgbFormatComboBox->insertItem(nrItems - 1, QString::fromStdString(srcPixelFormat.getName()));
268 idx = rgbPresetList.indexOf(srcPixelFormat);
269 ui.rgbFormatComboBox->setCurrentIndex(idx);
270 }
271 else if (idx > 0)
272 ui.rgbFormatComboBox->setCurrentIndex(idx);
273
274 ui.RScaleSpinBox->setValue(componentScale[0]);
275 ui.RScaleSpinBox->setMaximum(1000);
276 ui.GScaleSpinBox->setValue(componentScale[1]);
277 ui.GScaleSpinBox->setMaximum(1000);
278 ui.BScaleSpinBox->setValue(componentScale[2]);
279 ui.BScaleSpinBox->setMaximum(1000);
280 ui.AScaleSpinBox->setValue(componentScale[3]);
281 ui.AScaleSpinBox->setMaximum(1000);
282
283 ui.RInvertCheckBox->setChecked(this->componentInvert[0]);
284 ui.GInvertCheckBox->setChecked(this->componentInvert[1]);
285 ui.BInvertCheckBox->setChecked(this->componentInvert[2]);
286 ui.AInvertCheckBox->setChecked(this->componentInvert[3]);
287
288 ui.limitedRangeCheckBox->setChecked(this->limitedRange);
289
290 connect(ui.rgbFormatComboBox,
291 QOverload<int>::of(&QComboBox::currentIndexChanged),
292 this,

Callers

nothing calls this directly

Calls 9

toQStringListFunction · 0.85
createdMethod · 0.80
setupUiMethod · 0.80
indexOfMethod · 0.80
appendMethod · 0.80
getFormattedNamesMethod · 0.45
isValidMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected