/*************************************************************************** * Copyright (C) 2004 by Johan Maes - ON4QZ * * on4qz@telenet.be * * http://users.telenet.be/on4qz * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "gbrmode.h" #include "configdialog.h" #include "dspfunctions.h" #include "imageview.h" #include "qsstvglobal.h" #include gbrMode::gbrMode(QObject *parent, const char *name) : modeBase(parent, name) { } gbrMode::~gbrMode() { } /*! \fn gbrMode::setupLine(int &subln,unsigned char **buf) \brief Decode a Martin mode sstv image \param subln every line to display is divided in a number of sublines \param buf pointer to the pixel array. \return next phase off the display */ embState gbrMode::setupLine(int &subln,unsigned char **buf) { double start=0; if(lineCounter!=0) start=lineTimeTable[lineCounter-1]; switch(subln) { case 0: calcPixelPositionTable(GREENLINE,FALSE); *buf=greenArray; // debug("setup green samplecount=%d",sampleCounter); return PIXELS; case 1: debugPtr->state=stG1; marker=(unsigned int)round(start+bp+blank+visibleLineLength); return RXWAIT; case 2: calcPixelPositionTable(BLUELINE,FALSE); *buf=blueArray; // debug("setup blue samplecount=%d",sampleCounter); return PIXELS; case 3: debugPtr->state=stG2; marker=(unsigned int)round(start+bp+2*blank+2*visibleLineLength); return RXWAIT; case 4: calcPixelPositionTable(REDLINE,FALSE); // debug("setup red samplecount=%d",sampleCounter); *buf=redArray; return PIXELS; case 5: // if (lineCounterstate=stSync; syncPosition=(unsigned int) round(lineTimeTable[lineCounter]); return SYNC; // } // else return ENDOFIMAGE; break; default: return ENDOFLINE; } } void gbrMode::calcPixelPositionTable(unsigned int colorLine,bool tx) { unsigned int i; int ofx=0; if(tx) ofx=1; double start=0; if(lineCounter!=0) start=lineTimeTable[lineCounter-1]; debugPtr->state=colorLine; switch (colorLine) { case GREENLINE: start+=bp; break; case BLUELINE: start+=(bp+visibleLineLength+blank); break; case REDLINE: start+=(bp+2.*visibleLineLength+2.*blank); break; } for(i=0;i