Logo Search packages:      
Sourcecode: qsstv version File versions  Download package

void fft::draw (  )  [private]

No descriptions

Definition at line 230 of file fft.cpp.

Referenced by paintEvent().

{
  int i;
  int t;
  QColor c;

      int bw=lineWidth();
  QPainter p(this);

      // shift up image 1 line
  for (i=0;i<(h-1);i++)
      {
            memmove(im->scanLine(i),im->scanLine(i+1),w*sizeof(uint));
      }
  uint *ptr=(uint *)im->scanLine(h-1);

  // pseudo-coloring
      for (i=0; i<w;i++)
            {
                  if (volAvg==0) volAvg=1;
                  int ind=(i*span)/w;
//                double temp=20+50*log( ((double)arMag[ind])/(double)volAvg);
                  //scale between 0 and 1;
                  fftTempArray[i]=fftTempArray[i]*(1-FFTAVERAGING)+FFTAVERAGING*(( (float)arMag[ind])/(float)volAvg); // maximum of 1;
                  uint val=(uint)(fftTempArray[i]*255);
                  if (val>255) val=255;
                  c.setHsv(255-val,255,255);
                  ptr[i]=c.rgb();
//                val=fftArray[i]=3*fftArray[i]/4+val;
//                val=fftArray[i]=fftArray[i]/4+val;
                  t=bw+h-(val*h)/255;
      t=(t<bw ? bw : t);
      FFTArray->setPoint(i,i,t);
            }
      if(showWaterfall)
            {
                  p.drawImage(0,0,*im);
            }
      else
            {
            p.eraseRect(contentsRect());
                  p.setPen(red);
            t=bw+((1200)*w/FFTSPAN);
            p.drawLine(t,bw,t,h+bw);
            p.setPen(blue);
            t=bw+((1500)*w/FFTSPAN);
            p.drawLine(t,bw,t,h+bw);
            t=bw+((2300)*w/FFTSPAN);
            p.drawLine(t,bw,t,h+bw);
            p.setPen(white);
            for (i=0;i<7;i++)
                  {
                  t=bw+(((1600+i*100))*w/FFTSPAN);
                        p.drawLine(t,bw,t,h+bw);
                  }
            p.setPen(green);
                  p.drawPolyline(*FFTArray);
            }
}


Generated by  Doxygen 1.6.0   Back to index