mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-06 03:29:12 -04:00
ATV demod: implement video inversion
This commit is contained in:
parent
71181c94fb
commit
481923f8ff
@ -95,7 +95,8 @@ void ATVDemod::configure(
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
bool blnHSync,
|
||||
bool blnVSync)
|
||||
bool blnVSync,
|
||||
bool blnInvertVideo)
|
||||
{
|
||||
Message* msgCmd = MsgConfigureATVDemod::create(
|
||||
fltLineDurationUs,
|
||||
@ -105,7 +106,8 @@ void ATVDemod::configure(
|
||||
fltVoltLevelSynchroTop,
|
||||
fltVoltLevelSynchroBlack,
|
||||
blnHSync,
|
||||
blnVSync);
|
||||
blnVSync,
|
||||
blnInvertVideo);
|
||||
objMessageQueue->push(msgCmd);
|
||||
}
|
||||
|
||||
@ -371,6 +373,8 @@ void ATVDemod::demod(Complex& c)
|
||||
fltVal = 0.0f;
|
||||
}
|
||||
|
||||
fltVal = m_objRunning.m_blnInvertVideo ? 1.0f - fltVal : fltVal;
|
||||
|
||||
m_fltAmpLineAverage += fltVal;
|
||||
|
||||
//********** gray level **********
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
float m_fltVoltLevelSynchroBlack;
|
||||
bool m_blnHSync;
|
||||
bool m_blnVSync;
|
||||
bool m_blnInvertVideo;
|
||||
|
||||
ATVConfig() :
|
||||
m_intSampleRate(0),
|
||||
@ -73,7 +74,8 @@ public:
|
||||
m_fltVoltLevelSynchroTop(0.0f),
|
||||
m_fltVoltLevelSynchroBlack(1.0f),
|
||||
m_blnHSync(false),
|
||||
m_blnVSync(false)
|
||||
m_blnVSync(false),
|
||||
m_blnInvertVideo(false)
|
||||
{
|
||||
}
|
||||
};
|
||||
@ -132,7 +134,8 @@ public:
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
bool blnHSync,
|
||||
bool blnVSync);
|
||||
bool blnVSync,
|
||||
bool blnInvertVideo);
|
||||
|
||||
void configureRF(MessageQueue* objMessageQueue,
|
||||
ATVModulation enmModulation,
|
||||
@ -176,7 +179,8 @@ private:
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
bool blnHSync,
|
||||
bool blnVSync)
|
||||
bool blnVSync,
|
||||
bool blnInvertVideo)
|
||||
{
|
||||
return new MsgConfigureATVDemod(
|
||||
fltLineDurationUs,
|
||||
@ -186,7 +190,8 @@ private:
|
||||
fltVoltLevelSynchroTop,
|
||||
fltVoltLevelSynchroBlack,
|
||||
blnHSync,
|
||||
blnVSync);
|
||||
blnVSync,
|
||||
blnInvertVideo);
|
||||
}
|
||||
|
||||
ATVConfig m_objMsgConfig;
|
||||
@ -200,7 +205,8 @@ private:
|
||||
float fltVoltLevelSynchroTop,
|
||||
float fltVoltLevelSynchroBlack,
|
||||
bool blnHSync,
|
||||
bool blnVSync) :
|
||||
bool blnVSync,
|
||||
bool blnInvertVideo) :
|
||||
Message()
|
||||
{
|
||||
m_objMsgConfig.m_fltVoltLevelSynchroBlack = fltVoltLevelSynchroBlack;
|
||||
@ -211,6 +217,7 @@ private:
|
||||
m_objMsgConfig.m_fltRatioOfRowsToDisplay = flatRatioOfRowsToDisplay;
|
||||
m_objMsgConfig.m_blnHSync = blnHSync;
|
||||
m_objMsgConfig.m_blnVSync = blnVSync;
|
||||
m_objMsgConfig.m_blnInvertVideo = blnInvertVideo;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -83,6 +83,14 @@ void ATVDemodGUI::resetToDefaults()
|
||||
ui->hSync->setChecked(true);
|
||||
ui->vSync->setChecked(true);
|
||||
ui->halfImage->setChecked(false);
|
||||
ui->invertVideo->setChecked(false);
|
||||
|
||||
//********** RF Default values **********
|
||||
ui->decimatorEnable->setChecked(false);
|
||||
ui->rfFiltering->setChecked(false);
|
||||
ui->rfBW->setValue(10);
|
||||
ui->rfOppBW->setValue(10);
|
||||
ui->bfo->setValue(0);
|
||||
|
||||
blockApplySettings(false);
|
||||
applySettings();
|
||||
@ -106,6 +114,7 @@ QByteArray ATVDemodGUI::serialize() const
|
||||
s.writeS32(12, ui->rfBW->value());
|
||||
s.writeS32(13, ui->rfOppBW->value());
|
||||
s.writeS32(14, ui->bfo->value());
|
||||
s.writeBool(15, ui->invertVideo->isChecked());
|
||||
|
||||
return s.final();
|
||||
}
|
||||
@ -163,6 +172,8 @@ bool ATVDemodGUI::deserialize(const QByteArray& arrData)
|
||||
ui->rfOppBW->setValue(tmp);
|
||||
d.readS32(14, &tmp, 10);
|
||||
ui->bfo->setValue(tmp);
|
||||
d.readBool(15, &booltmp, true);
|
||||
ui->invertVideo->setChecked(booltmp);
|
||||
|
||||
blockApplySettings(false);
|
||||
m_objChannelMarker.blockSignals(false);
|
||||
@ -322,7 +333,8 @@ void ATVDemodGUI::applySettings()
|
||||
ui->synchLevel->value() / 1000.0f,
|
||||
ui->blackLevel->value() / 1000.0f,
|
||||
ui->hSync->isChecked(),
|
||||
ui->vSync->isChecked());
|
||||
ui->vSync->isChecked(),
|
||||
ui->invertVideo->isChecked());
|
||||
|
||||
qDebug() << "ATVDemodGUI::applySettings:"
|
||||
<< " m_objChannelizer.inputSampleRate: " << m_objChannelizer->getInputSampleRate()
|
||||
@ -466,6 +478,11 @@ void ATVDemodGUI::on_vSync_clicked()
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_invertVideo_clicked()
|
||||
{
|
||||
applySettings();
|
||||
}
|
||||
|
||||
void ATVDemodGUI::on_halfImage_clicked()
|
||||
{
|
||||
applySettings();
|
||||
|
@ -69,6 +69,7 @@ private slots:
|
||||
void on_topTime_valueChanged(int value);
|
||||
void on_hSync_clicked();
|
||||
void on_vSync_clicked();
|
||||
void on_invertVideo_clicked();
|
||||
void on_halfImage_clicked();
|
||||
void on_modulation_currentIndexChanged(int index);
|
||||
void on_fps_currentIndexChanged(int index);
|
||||
|
@ -494,6 +494,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="invertVideo">
|
||||
<property name="toolTip">
|
||||
<string>Toggle video inversion</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Inv</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="halfImage">
|
||||
<property name="toolTip">
|
||||
|
Loading…
Reference in New Issue
Block a user