Skip to content

Commit

Permalink
Commit from der3318
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianFeldmann committed Aug 31, 2023
1 parent a62b7e8 commit dfab33a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions YUViewLib/src/video/yuv/videoHandlerYUV.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2725,18 +2725,21 @@ QLayout *videoHandlerYUV::createVideoHandlerControls(bool isSizeFixed)
ui.yuvFormatComboBox->setEnabled(!isSizeFixed);

// Set all the values of the properties widget to the values of this class
const auto hasChroma = (srcPixelFormat.getSubsampling() != Subsampling::YUV_400);
ui.colorComponentsComboBox->addItems(
functions::toQStringList(ComponentDisplayModeMapper.getNames()));
ui.colorComponentsComboBox->setCurrentIndex(
int(ComponentDisplayModeMapper.indexOf(this->conversionSettings.componentDisplayMode)));
ui.colorComponentsComboBox->setEnabled(hasChroma);
ui.chromaInterpolationComboBox->addItems(
functions::toQStringList(ChromaInterpolationMapper.getNames()));
ui.chromaInterpolationComboBox->setCurrentIndex(
int(ChromaInterpolationMapper.indexOf(this->conversionSettings.chromaInterpolation)));
ui.chromaInterpolationComboBox->setEnabled(srcPixelFormat.isChromaSubsampled());
ui.chromaInterpolationComboBox->setEnabled(hasChroma && srcPixelFormat.isChromaSubsampled());
ui.colorConversionComboBox->addItems(functions::toQStringList(ColorConversionMapper.getNames()));
ui.colorConversionComboBox->setCurrentIndex(
int(ColorConversionMapper.indexOf(this->conversionSettings.colorConversion)));
ui.colorConversionComboBox->setEnabled(hasChroma);
ui.lumaScaleSpinBox->setValue(this->conversionSettings.mathParameters[Component::Luma].scale);
ui.lumaOffsetSpinBox->setMaximum(1000);
ui.lumaOffsetSpinBox->setValue(this->conversionSettings.mathParameters[Component::Luma].offset);
Expand Down Expand Up @@ -2868,10 +2871,15 @@ void videoHandlerYUV::setSrcPixelFormat(PixelFormatYUV format, bool emitSignal)
if (ui.created())
{
// Every time the pixel format changed, see if the interpolation combo box is enabled/disabled
QSignalBlocker blocker1(ui.chromaInterpolationComboBox);
QSignalBlocker blocker2(ui.lumaOffsetSpinBox);
QSignalBlocker blocker3(ui.chromaOffsetSpinBox);
ui.chromaInterpolationComboBox->setEnabled(format.isChromaSubsampled());
const auto hasChroma = (srcPixelFormat.getSubsampling() != Subsampling::YUV_400);
QSignalBlocker blocker1(ui.colorComponentsComboBox);
QSignalBlocker blocker2(ui.chromaInterpolationComboBox);
QSignalBlocker blocker3(ui.colorConversionComboBox);
QSignalBlocker blocker4(ui.lumaOffsetSpinBox);
QSignalBlocker blocker5(ui.chromaOffsetSpinBox);
ui.colorComponentsComboBox->setEnabled(hasChroma);
ui.chromaInterpolationComboBox->setEnabled(hasChroma && format.isChromaSubsampled());
ui.colorConversionComboBox->setEnabled(hasChroma);
ui.lumaOffsetSpinBox->setValue(this->conversionSettings.mathParameters[Component::Luma].offset);
ui.chromaOffsetSpinBox->setValue(
this->conversionSettings.mathParameters[Component::Chroma].offset);
Expand Down

0 comments on commit dfab33a

Please sign in to comment.