Пример #1
0
void OnePole::setup (double scale,
                     double pole,
                     double zero)
{
  setOnePole (pole, zero);
  applyScale (scale);
}
Пример #2
0
void Transformation::applySizeTransformation(SDL_Size size){
	SDL_Point p;
	p.x = size.width;
	p.y = size.height;
	applyScale(p);
	size.width=p.x;
	size.height=p.y;
}
Пример #3
0
void Transformation::applySizeTransformation(Uint16 &w, Uint16 &h) {
	SDL_Point p;
	p.x = w;
	p.y = h;
	applyScale(p);
	w = p.x;
	h = p.y;
}
Пример #4
0
void TwoPole::setup (double scale,
                     double poleRho,
                     double poleTheta,
                     double zeroRho,
                     double zeroTheta)
{
  complex_t pole = std::polar (poleRho, poleTheta);
  complex_t zero = std::polar (zeroRho, zeroTheta);

  setTwoPole (pole, zero, std::conj(pole), std::conj(zero));
  applyScale (scale);
}
Пример #5
0
void Cascade::setLayout (const LayoutBase& proto)
{
    const int numPoles = proto.getNumPoles();
    m_numStages = (numPoles + 1)/ 2;
    assert (m_numStages <= m_maxStages);

    Biquad* stage = m_stageArray;
    for (int i = 0; i < m_numStages; ++i, ++stage)
        stage->setPoleZeroPair (proto[i]);

    applyScale (proto.getNormalGain() /
                std::abs (response (proto.getNormalW() / (2 * doublePi))));
}
Пример #6
0
	void Cascade::setLayout (const LayoutBase& proto)
	{
		const int numPoles = proto.getNumPoles();
		m_numStages = (numPoles + 1)/ 2;
		if (m_numStages > m_maxStages)
			throw std::invalid_argument("Number of stages is larger than the max stages.");

		Biquad* stage = m_stageArray;
		for (int i = 0; i < m_numStages; ++i, ++stage)
			stage->setPoleZeroPair (proto[i]);
  
		applyScale (proto.getNormalGain() /
			    std::abs (response (proto.getNormalW() / (2 * doublePi))));
	}
Пример #7
0
FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent)
{
    ui = new histogramUI(this);
    tab = static_cast<FITSTab *> (parent);
    type   = FITS_AUTO;

    customPlot = ui->histogramPlot;

    customPlot->setBackground(QBrush(Qt::black));

    customPlot->xAxis->setBasePen(QPen(Qt::white, 1));
    customPlot->yAxis->setBasePen(QPen(Qt::white, 1));

    customPlot->xAxis->setTickPen(QPen(Qt::white, 1));
    customPlot->yAxis->setTickPen(QPen(Qt::white, 1));

    customPlot->xAxis->setSubTickPen(QPen(Qt::white, 1));
    customPlot->yAxis->setSubTickPen(QPen(Qt::white, 1));

    customPlot->xAxis->setTickLabelColor(Qt::white);
    customPlot->yAxis->setTickLabelColor(Qt::white);

    customPlot->xAxis->setLabelColor(Qt::white);
    customPlot->yAxis->setLabelColor(Qt::white);

    customPlot->xAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine));
    customPlot->yAxis->grid()->setPen(QPen(QColor(140, 140, 140), 1, Qt::DotLine));
    customPlot->xAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine));
    customPlot->yAxis->grid()->setSubGridPen(QPen(QColor(80, 80, 80), 1, Qt::DotLine));
    customPlot->xAxis->grid()->setZeroLinePen(Qt::NoPen);
    customPlot->yAxis->grid()->setZeroLinePen(Qt::NoPen);

    r_graph = customPlot->addGraph();
    r_graph->setBrush(QBrush(QColor(170, 40, 80)));
    r_graph->setPen(QPen(Qt::red));
    //r_graph->setLineStyle(QCPGraph::lsImpulse);

    connect(ui->applyB, SIGNAL(clicked()), this, SLOT(applyScale()));

    connect(customPlot, SIGNAL(mouseMove(QMouseEvent*)), this, SLOT(updateValues(QMouseEvent*)));

    connect(ui->minEdit, SIGNAL(valueChanged(double)), this, SLOT(updateLimits(double)));
    connect(ui->maxEdit, SIGNAL(valueChanged(double)), this, SLOT(updateLimits(double)));
    connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), this, SLOT(checkRangeLimit(QCPRange)));

    constructHistogram();
}
Пример #8
0
FITSHistogram::FITSHistogram(QWidget *parent) : QDialog(parent)
{
    ui = new histogramUI(this);

    tab = (FITSTab *) parent;

    type   = FITS_AUTO;
    napply = 0;

    connect(ui->applyB, SIGNAL(clicked()), this, SLOT(applyScale()));
    connect(ui->minOUT, SIGNAL(editingFinished()), this, SLOT(updateLowerLimit()));
    connect(ui->maxOUT, SIGNAL(editingFinished()), this, SLOT(updateUpperLimit()));

    connect(ui->minSlider, SIGNAL(valueChanged(int)), this, SLOT(minSliderUpdated(int)));
    connect(ui->maxSlider, SIGNAL(valueChanged(int)), this, SLOT(maxSliderUpdated(int)));

    ui->histFrame->init();

    constructHistogram(ui->histFrame->getHistWidth(), ui->histFrame->getHistHeight());
}
Пример #9
0
void BiquadBase::setPoleZeroForm (const BiquadPoleState& bps)
{
  setPoleZeroPair (bps);
  applyScale (bps.gain);
}
Пример #10
0
/**
 * align actions
 */
void alignAction(int action) {
  vector actionVector;

  switch(action) {
    case 'a': /* turn animation on or off */
      if(TRUE == (animate = !animate)) {
        glutTimerFunc(framePeriod, alignTimerEvent, 0);
      }
      else {
        displayImg = 1;
      }
      redisplay();
      break;
    case 'c': /* set the rotation center */
      settingRotCenter = TRUE;
      break;
    case 'y': /* speed up the flickering */
      switchPeriod -= switchPerIncrement;
      if(switchPeriod < 0) switchPeriod = 0;
      break;
    case 't': /* slow down the flickering */
      switchPeriod += switchPerIncrement;
      if(switchPeriod > MAX_SWITCH_PERIOD) switchPeriod = MAX_SWITCH_PERIOD;
      break;
    case 'e': /* toggle previous slice tack display */
      showPrevTacks = !showPrevTacks;
      redisplay();
      break;
    case 'w': /* toggle curent slice tack display */
      showCurTacks = !showCurTacks;
      redisplay();
      break;
    case 'Q':
      displayImg = !displayImg;
      redisplay();
      break;
    case 'p': /* print the action list */
    case 'P':
      fprintf(stdout,"---------------------------------------\n");
      dumpActionList(actions);
      fprintf(stdout,"---------------------------------------\n");
      break;
      /*   case 'r': /\* reset the position of the reference image to unmoved *\/ */
      /*     resetImage(); */
      /*     break; */
      /*   case 'u': /\* undo the last action *\/ */
      /*   case 'U': */
      /*     undoLastAction(); */
      /*     break; */
      /* fine direction stuff using numeric keypad */
    case '1': /* down and left */
      actionVector.x = -transIncrX;
      actionVector.y = -transIncrY;
      applyTranslation(actionVector);
      break;
    case '2': /* down */
      actionVector.x = 0;
      actionVector.y = -transIncrY;
      applyTranslation(actionVector);
      break;
    case '3': /* down and right */
      actionVector.x = transIncrX;
      actionVector.y = -transIncrY;
      applyTranslation(actionVector);
      break;
    case '4': /* left */
      actionVector.x = -transIncrX;
      actionVector.y = 0;
      applyTranslation(actionVector);
      break;
    case '6': /* right */
      actionVector.x = transIncrX;
      actionVector.y = 0;
      applyTranslation(actionVector);
      break;
    case '7': /* up and left  */
      actionVector.x = -transIncrX;
      actionVector.y = transIncrY;
      applyTranslation(actionVector);
      break;
    case '8': /* up */
      actionVector.x = 0;
      actionVector.y = transIncrY;
      applyTranslation(actionVector);
      break;
    case '9': /* up and right */
      actionVector.x = transIncrX;
      actionVector.y = transIncrY;
      applyTranslation(actionVector);
      break;
    case '=': /* grow the slice */
    case '+':
      actionVector.x = scaleIncrX;
      actionVector.y = scaleIncrY;
      applyScale(actionVector);
      break;
    case '-': /* shrink the slice */
    case '_':
      actionVector.x = -scaleIncrX;
      actionVector.y = -scaleIncrY;
      applyScale(actionVector);
      break;
    default:
      break;
  }
}
Пример #11
0
void Transformation::applyTransformation(SDL_Point &p) {
	applyTranslation(p);
	applyScale(p);
}