mirror of
https://github.com/f4exb/sdrangel.git
synced 2026-06-05 15:34:57 -04:00
APT demod: send full image to GUI every 20 lines only else send an unprocessed line
This commit is contained in:
@@ -157,8 +157,14 @@ void APTDemodImageWorker::resetDecoder()
|
||||
void APTDemodImageWorker::processPixels(const float *pixels)
|
||||
{
|
||||
std::copy(pixels, pixels + APT_PROW_WIDTH, m_image.prow[m_image.nrow]);
|
||||
|
||||
if (m_image.nrow % 20 == 0) { // send full image only every 20 lines
|
||||
sendImageToGUI();
|
||||
} else { // else send unprocessed line just to show stg is moving
|
||||
sendLineToGUI();
|
||||
}
|
||||
|
||||
m_image.nrow++;
|
||||
sendImageToGUI();
|
||||
}
|
||||
|
||||
void APTDemodImageWorker::sendImageToGUI()
|
||||
@@ -172,6 +178,40 @@ void APTDemodImageWorker::sendImageToGUI()
|
||||
}
|
||||
}
|
||||
|
||||
void APTDemodImageWorker::sendLineToGUI()
|
||||
{
|
||||
if (m_messageQueueToGUI)
|
||||
{
|
||||
float *pixels = m_image.prow[m_image.nrow];
|
||||
uchar *line;
|
||||
APTDemod::MsgLine *msg = APTDemod::MsgLine::create(&line);
|
||||
|
||||
if (m_settings.m_channels == APTDemodSettings::BOTH_CHANNELS)
|
||||
{
|
||||
for (int i = 0; i < APT_IMG_WIDTH; i++) {
|
||||
line[i] = roundAndClip(pixels[i]);
|
||||
}
|
||||
msg->setSize(APT_IMG_WIDTH);
|
||||
}
|
||||
else if (m_settings.m_channels == APTDemodSettings::CHANNEL_A)
|
||||
{
|
||||
for (int i = 0; i < APT_CH_WIDTH; i++) {
|
||||
line[i] = roundAndClip(pixels[i + APT_CHA_OFFSET]);
|
||||
}
|
||||
msg->setSize(APT_CH_WIDTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < APT_CH_WIDTH; i++) {
|
||||
line[i] = roundAndClip(pixels[i + APT_CHB_OFFSET]);
|
||||
}
|
||||
msg->setSize(APT_CH_WIDTH);
|
||||
}
|
||||
|
||||
m_messageQueueToGUI->push(msg);
|
||||
}
|
||||
}
|
||||
|
||||
QImage APTDemodImageWorker::processImage(QStringList& imageTypes)
|
||||
{
|
||||
copyImage(&m_tempImage, &m_image);
|
||||
|
||||
Reference in New Issue
Block a user