1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-10 10:33:29 -05:00

ATV Modulator: added checkbox pattern

This commit is contained in:
f4exb 2017-03-07 22:55:11 +01:00
parent 71d4776a93
commit 5e8f17ba8c
3 changed files with 22 additions and 9 deletions

View File

@ -145,7 +145,7 @@ void ATVMod::modulateSample()
void ATVMod::pullVideo(Real& sample)
{
if ((m_lineCount < 21) || (m_lineCount > 621) || ((m_lineCount > 309) && (m_lineCount < 333)))
if ((m_lineCount < 5 + m_nbBlankLines) || (m_lineCount > 621) || ((m_lineCount > 309) && (m_lineCount < 317 + m_nbBlankLines)))
{
pullVSyncLine(sample);
}
@ -318,16 +318,17 @@ void ATVMod::applyStandard()
m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3/1.008 us)
// what is left in a 64/1.008 us line for the image
m_pointsPerImgLine = 64 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
m_pointsPerHBar = 10 * m_pointsPerTU; // set a bar length to 10/1.008 us (~5 bars per line)
m_linesPerVBar = 30;
m_nbLines = 525;
m_nbLines2 = 262;
m_nbImageLines = 510;
m_nbImageLines2 = 205;
m_interlaced = true;
m_nbHorizPoints = 64 * m_pointsPerTU; // full line
m_hBarIncrement = m_spanLevel / 5.0f;
m_vBarIncrement = m_spanLevel / 10.0f;
m_nbBlankLines = 16;
m_pointsPerHBar = m_pointsPerImgLine / 6;
m_linesPerVBar = m_nbImageLines2 / 6;
m_hBarIncrement = m_spanLevel / 6.0f;
m_vBarIncrement = m_spanLevel / 6.0f;
break;
case ATVStdPAL625:
default:
@ -337,15 +338,16 @@ void ATVMod::applyStandard()
m_pointsPerFSync = (uint32_t) roundf(2.3f * m_pointsPerTU); // equalizing pulse (2.3 us)
// what is left in a 64 us line for the image
m_pointsPerImgLine = 64 * m_pointsPerTU - m_pointsPerSync - m_pointsPerBP - m_pointsPerFP;
m_pointsPerHBar = 10 * m_pointsPerTU; // set a bar length to 10 us (~5 bars per line)
m_linesPerVBar = 30;
m_nbLines = 625;
m_nbLines2 = 312;
m_nbImageLines = 610;
m_nbImageLines2 = 305;
m_interlaced = true;
m_nbHorizPoints = 64 * m_pointsPerTU; // full line
m_hBarIncrement = m_spanLevel / 5.0f;
m_vBarIncrement = m_spanLevel / 10.0f;
m_nbBlankLines = 16;
m_pointsPerHBar = m_pointsPerImgLine / 6;
m_linesPerVBar = m_nbImageLines2 / 6;
m_hBarIncrement = m_spanLevel / 6.0f;
m_vBarIncrement = m_spanLevel / 6.0f;
}
}

View File

@ -43,6 +43,7 @@ public:
ATVModInputUniform,
ATVModInputHBars,
ATVModInputVBars,
ATVModInputCheckbox,
ATVModInputHGradient,
ATVModInputVGradient
} ATVModInput;
@ -171,6 +172,7 @@ private:
uint32_t m_nbImageLines;
uint32_t m_nbImageLines2;
uint32_t m_nbHorizPoints; //!< number of line points per horizontal line
uint32_t m_nbBlankLines;
float m_hBarIncrement;
float m_vBarIncrement;
bool m_interlaced; //!< true if image is interlaced (2 half frames per frame)
@ -218,6 +220,10 @@ private:
case ATVModInputVBars:
sample = (iLine / m_linesPerVBar) * m_vBarIncrement + m_blackLevel;
break;
case ATVModInputCheckbox:
sample = (((iLine / m_linesPerVBar)*5 + (pointIndex / m_pointsPerHBar)) % 2) * m_spanLevel * m_running.m_uniformLevel + m_blackLevel;
break;
case ATVModInputHGradient:
sample = (pointIndex / (float) m_pointsPerImgLine) * m_spanLevel + m_blackLevel;
break;

View File

@ -370,6 +370,11 @@
<string>V Bars</string>
</property>
</item>
<item>
<property name="text">
<string>Chekbox</string>
</property>
</item>
<item>
<property name="text">
<string>H Grad</string>