#ifndef SSTVPARAM_H #define SSTVPARAM_H /** \file */ /** SSTV Parameter functions @author Johan Maes - ON4QZ */ #define NUMMODES 22 //!< Number of Modes for RX and TX //#define NUMBEROFSTATES 18 #define REDLINE 0 //!< index for red line buffer #define GREENLINE 1 //!< index for green line buffer #define BLUELINE 2 //!< index for blue line buffer #define YLINEODD 3 //!< index for intensity line buffer 0 #define YLINEEVEN 4 //!< index for intensity line buffer 1 #define VIDEOBW 800 #define MAXLINES 800 #define MINSYNC 25 // minimum syncduration in samples /** SSTV image decoding types @enum sstvType RGB for Martin 1 and 2 \p GBR used for Scottie 1 and 2 */ enum sstvType {RGB,GBR,GBR2,XYZOE,XYZOE2}; enum sstvMode {M1,M2,S1,S2,SDX,WS2,R24,R36,R72,P3,P5,P7,BW8,BW12,PD50,PD90,PD120,PD160,PD180,PD240,PD290,CALIB,NOTVALID}; /** struc used in frequency detection */ struct sTimeFreq { double t; // time in sec double dt; // minimum duration in sec unsigned int f; // frequency to detect (freq=0 if any freq) }; /** struc used to descibe the different sstv modes */ struct sSSTVParam { char name[20]; char shortName[10]; double imageTime; unsigned int numberOfPixels; // NumberOfPixels per Line unsigned int numberOfLines; unsigned short int VISCode; float sync; //used for rx float fp; float bp; float blank; float synct; // used for tx float fpt; float bpt; float blankt; }; void printActiveSSTVParam(); extern const char *modesText[NUMMODES]; extern sSSTVParam SSTVTable[NUMMODES]; extern sSSTVParam activeSSTVParam; extern double lineTimeTable[MAXLINES+1]; void setupLineTimeTable(sstvMode modeIndex,double clock); void adaptLineTimeTable(unsigned int lineNumber,int diff); void adaptLineTimeTable(double imageDuration,int numberOfLines,float clock); /** initialize the active parameter table using the VIS code */ sstvMode initializeParametersVIS(unsigned int viscode); /** initialize the active parameter table using the modeIndex */ bool initializeParametersIndex(sstvMode modeIndex); sstvMode lookupVIS(unsigned int vc); /* unsigned int lookupModeString(const char *s); unsigned int lookupModeCode(unsigned int x); */ const char* getMode(unsigned int t); const char* getModeShort(unsigned int t); sstvMode modeLookup(unsigned int lineLength,double clock); //eTxRxState getNextState(eTxRxState OldState); #endif