Scope
ScannerVectorFrameSaw.cpp
1 #include "StdAfx.h"
2 #include "ScannerVectorFrameSaw.h"
3 #include "controllers/ScopeLogger.h"
4 
5 namespace scope {
6 
8  : ScannerVectorFrameBasic(ScannerVectorTypeHelper::Sawtooth, _filltype) {
9 }
10 
11 ScannerVectorFrameSaw::~ScannerVectorFrameSaw() {
12 
13 }
14 
16 #ifdef _DEBUG
17  LARGE_INTEGER countspre;
18  LARGE_INTEGER countspost;
19  LARGE_INTEGER countfreq;
20  QueryPerformanceCounter(&countspre);
21 #endif
22 
23  switch ( filltype ) {
24  case ScannerVectorFillTypeHelper::FullframeXYZP:
25  // interleaved samples for x,y,z,pockels
26  vecptr->resize(4*svparameters->TotalPixels());
27  FillX();
28  FillY();
29  FillZ();
30  FillP();
31  break;
32  case ScannerVectorFillTypeHelper::LineXPColumnYZ:
33  // interleaved samples for x,p + interleaved samples for y,z
35  FillXP();
36  FillYZ();
37  break;
38  case ScannerVectorFillTypeHelper::LineZP:
39  vecptr->resize(2*svparameters->TotalPixels());
40  FillZ();
41  FillP();
42  break;
43  default:
44  throw ScopeException("ScannerVectorFillType not yet implemented");
45  }
46 
47  lookup->resize(svparameters->TotalPixels());
48  FillLookup();
49 
50 #ifdef _DEBUG
51  QueryPerformanceCounter(&countspost);
52  QueryPerformanceFrequency(&countfreq);
53  double time = static_cast<double>((countspost.QuadPart-countspre.QuadPart))/static_cast<double>(countfreq.QuadPart) * 1000;
54  DBOUT(L"Time for updating vector " << time << L" ms");
55 #endif
56 }
57 
60  const uint32_t cutofflines = tmp->YCutoffLines();
61  const uint32_t scanlines = tmp->YScanLines();
62  const uint32_t cutoffpixels = tmp->XCutoffPixels();
63  const uint32_t scanpixels = tmp->XScanPixels();
64  const uint32_t ytotallines = tmp->YTotalLines();
65  const uint32_t xtotalpixels = tmp->XTotalPixels();
66  uint32_t datapos = 0;
67  uint32_t imagepos = 0;
68  // advance datapos on every sampled pixel, advance imagepos only on pixels that are inside the image -> build up the lookup vector
69  for ( uint32_t l = 0 ; l < ytotallines ; l++ ) {
70  for ( uint32_t x = 0 ; x < xtotalpixels ; x++ ) {
71  if ( (l >= cutofflines) && (l < scanlines) && (x >= cutoffpixels) && (x < scanpixels) )
72  lookup->at(datapos) = imagepos++;
73  else
74  lookup->at(datapos) = 0;
75  datapos++;
76  }
77  }
78 
79  // Adjust for the scannerdelay by rotating the lookup vector (do not respect oversampling, since lookup is done on downsampled data
81  if ( lookup_rotation > 0 )
82  std::rotate(std::begin(*lookup), std::begin(*lookup)+lookup_rotation, std::end(*lookup));
83  if ( lookup_rotation < 0 )
84  std::rotate(std::begin(*lookup), std::end(*lookup)+lookup_rotation, std::end(*lookup));
85 }
86 
89  const uint32_t framesamples(tmp->TotalPixels());
90  const uint32_t linesamples(tmp->XTotalPixels());
91  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
92  const double zoom = tmp->zoom();
93  const double range = daqparameters->outputs->maxoutputscanner() - daqparameters->outputs->minoutputscanner();
94  const double rangezoomed = range / zoom;
95 
96  // choose the maximum scanner amplitude for the larger frame side
97  double xrangezoomed;
98  if(tmp->xaspectratio >= tmp->yaspectratio) {
99  xrangezoomed = rangezoomed;
100  }
101  else {
102  xrangezoomed = static_cast<double>(tmp->xaspectratio) / static_cast<double>(tmp->yaspectratio) * rangezoomed;
103  }
104  const double devicecenter = (daqparameters->outputs->minoutputscanner() + daqparameters->outputs->maxoutputscanner()) * 0.5; // center of the device range (e.g. scanner takes +-3V -> center is 0V)
105  double center = devicecenter + tmp->xoffset()*0.5*range; // center of the frame, offset +-1 means maximum offset
106  if ( center - 0.5*xrangezoomed < daqparameters->outputs->minoutputscanner() )
107  center = daqparameters->outputs->minoutputscanner()+0.5*xrangezoomed;
108  if ( center + 0.5*xrangezoomed > daqparameters->outputs->maxoutputscanner() )
109  center = daqparameters->outputs->maxoutputscanner()-0.5*xrangezoomed;
110  const double xminzoomed = center - 0.5*xrangezoomed; // minimum x value after zoom
111  const double xmaxzoomed = center + 0.5*xrangezoomed; // maximum x value after zoom
112  const double xscanslope = xrangezoomed / static_cast<double>(tmp->XScanPixels());
113  const double xretraceslope = -xrangezoomed / static_cast<double>(tmp->XRetracePixels());
114  const uint32_t xscansamples = 4*tmp->XScanPixels();
115  const uint32_t xtotalsamples = 4*tmp->XTotalPixels();
116 
117  uint32_t x = 0;
118  size_t cx = 0;
119 
120  do {
121  // fill in XCutoffSamples()+XImageSamples() with increasing values (scanning) in X
122  x = 0;
123  for ( size_t i = cx ; i < cx+xscansamples ; i += 4, x++ )
124  vecptr->at(i) = scaletodevice(xminzoomed + x * xscanslope);
125 
126  // fill in XRetraceSamples() with decreasing values (retracing) in X
127  x = 0;
128  for ( size_t i = cx+xscansamples ; i < cx+xtotalsamples ; i += 4, x++ )
129  vecptr->at(i) = scaletodevice(xmaxzoomed + x * xretraceslope);
130 
131  cx += 4*linesamples;
132  } while ( cx < 4*framesamples );
133 }
134 
137  const uint32_t framesamples(tmp->TotalPixels());
138  const uint32_t linesamples(tmp->XTotalPixels());
139  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
140  const double zoom = tmp->zoom();
141  const double range = daqparameters->outputs->maxoutputscanner() - daqparameters->outputs->minoutputscanner();
142  const double rangezoomed = range / zoom;
143 
144  // choose the maximum scanner amplitude for the larger frame side
145  double yrangezoomed;
146  if(tmp->xaspectratio >= tmp->yaspectratio) {
147  yrangezoomed = static_cast<double>(tmp->yaspectratio) / static_cast<double>(tmp->xaspectratio) * rangezoomed;
148  }
149  else {
150  yrangezoomed = rangezoomed;
151  }
152  const double devicecenter = (daqparameters->outputs->minoutputscanner() + daqparameters->outputs->maxoutputscanner()) * 0.5; // center of the device range (e.g. scanner takes +-3V -> center is 0V)
153  double center = devicecenter + tmp->yoffset()*0.5*range; // center of the frame, offset +-1 means maximum offset
154  if ( center - 0.5*yrangezoomed < daqparameters->outputs->minoutputscanner() )
155  center = daqparameters->outputs->minoutputscanner()+0.5*yrangezoomed;
156  if ( center + 0.5*yrangezoomed > daqparameters->outputs->maxoutputscanner() )
157  center = daqparameters->outputs->maxoutputscanner()-0.5*yrangezoomed;
158  const double yminzoomed = center - 0.5*yrangezoomed; // minimum y value after zoom
159  const double ymaxzoomed = center + 0.5*yrangezoomed; // maximum y value after zoom
160  const double yscanslope = yrangezoomed / static_cast<double>(tmp->YScanLines());
161  const double yretraceslope = -yrangezoomed / static_cast<double>(tmp->YRetraceLines() * tmp->XTotalPixels());
162  const uint32_t yscanlinesamples = 4*tmp->YScanLines()*linesamples;
163  uint32_t yscan = 0;
164  uint32_t yretrace = 0;
165  size_t cy = 1; // y starts at sample 1
166 
167  do {
168  // fill in linesamples with the same value for scanning
169  if ( cy < (1 + yscanlinesamples) ) {
170  for ( size_t i = cy ; i < cy+4*linesamples ; i += 4 )
171  vecptr->at(i) = scaletodevice(yminzoomed + yscan * yscanslope);
172  yscan++;
173  }
174  else {
175  // do a smoother retracing
176  for ( size_t i = cy ; i < cy+4*linesamples ; i += 4 ) {
177  vecptr->at(i) = scaletodevice(ymaxzoomed + yretrace * yretraceslope);
178  yretrace++;
179  }
180  }
181  cy += 4*linesamples;
182  } while ( cy < (4*framesamples + 1) );
183 }
184 
187  const uint32_t framesamples(tmp->TotalPixels());
188  const uint32_t linesamples(tmp->XTotalPixels());
189  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
190  const int16_t fastzoutdev = scaletodevice(zparameters->PositionToVoltage(svparameters->fastz())); // get the voltage corresponding to current ETL position in micron and scale to device
191  size_t cz, cz_init, step_size;
192  // Decide vector storage locations and step_size based on Master/Slave
193  if (filltype == ScannerVectorFillTypeHelper::FullframeXYZP) {
194  cz = 2; cz_init = 2; step_size = 4;
195  }
196  if (filltype == ScannerVectorFillTypeHelper::LineZP) {
197  cz = 0; cz_init = 0; step_size = 2;
198  }
199 
200  do {
201  // Fast z position stays constant during normal frame scanning
202  for ( size_t i = cz ; i < cz + step_size*linesamples ; i += step_size )
203  vecptr->at(i) = fastzoutdev;
204  cz += step_size*linesamples;
205  } while ( cz < (step_size*framesamples + cz_init) );
206 }
207 
210  const uint32_t framesamples(tmp->TotalPixels());
211  const uint32_t linesamples(tmp->XTotalPixels());
212  const uint32_t cutofflines = tmp->YCutoffLines();
213  const uint32_t scanlines = tmp->YScanLines();
214  const uint32_t cutoffpixels = tmp->XCutoffPixels();
215  const uint32_t scanpixels = tmp->XScanPixels();
216  const double pockelsoutval = (tmp->pockels()-tmp->pockels.ll())/(tmp->pockels.ul()-tmp->pockels.ll())
217  *daqparameters->outputs->maxoutputpockels()+daqparameters->outputs->minoutputpockels(); // scale pockels value from displayed value (e.g. 0..1) to device value (e.g. 0..2)
218  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
219  size_t cp, cp_init, step_size;
220  // Decide vector storage locations and step_size based on Master/Slave
221  if (filltype == ScannerVectorFillTypeHelper::FullframeXYZP) {
222  cp = 3; cp_init = 3; step_size = 4;
223  }
224  if (filltype == ScannerVectorFillTypeHelper::LineZP) {
225  cp = 1; cp_init = 1; step_size = 2;
226  }
227 
228  do {
229  // Pockels blanking during Y cutoff and retrace
230  if ( (cp < (cp_init + step_size*cutofflines*linesamples))
231  || (cp > (cp_init + step_size*scanlines*linesamples)) ) {
232  for ( size_t i = cp ; i < cp + step_size*linesamples ; i += step_size )
233  vecptr->at(i) = scaletodevice(0.0);
234  }
235  else {
236  // Pockels blanking during X cutoff and X retrace, pockels during image
237  for ( size_t i = cp ; i < cp+step_size*cutoffpixels ; i += step_size )
238  vecptr->at(i) = scaletodevice(0.0);
239  for ( size_t i = cp+step_size*cutoffpixels ; i < cp+step_size*scanpixels ; i += step_size )
240  vecptr->at(i) = scaletodevice(pockelsoutval);
241  for ( size_t i = cp+step_size*scanpixels ; i < cp+4*linesamples ; i += step_size )
242  vecptr->at(i) = scaletodevice(0.0);
243  }
244  cp += step_size*linesamples;
245  } while ( cp < (step_size*framesamples + cp_init) );
246 
247  // Adjust for the scannerdelay by rotating the pockels vector (do not respect oversampling, since pockels vector is with pixels, not oversampled input samples)
248  const int32_t pockels_rotation = daqparameters->ScannerDelaySamples(false);
249  if ( pockels_rotation > 0 ) {
250  auto length = vecptr->size() / step_size;
251  size_t p = 0;
252  size_t pr = p + pockels_rotation;
253  for ( uint32_t i = 0 ; i < length ; ++i ) {
254  std::swap(vecptr->at(cp_init+step_size*p), vecptr->at(cp_init+step_size*pr));
255  // Modulo does the turnaround
256  p = (p+1)%length;
257  pr = (pr+1)%length;
258  }
259  }
260  if ( pockels_rotation < 0 ) {
261  auto length = vecptr->size() / step_size;
262  size_t p = 0; // from reverse p starts at 1
263  size_t pr = p - pockels_rotation;
264  for ( uint32_t i = 0 ; i < length ; ++i) {
265  std::swap(vecptr->at(step_size*(length-p)-1), vecptr->at(step_size*(length-pr)-1));
266  // Modulo does the turnaround
267  p = (p+1)%length;
268  pr = (pr+1)%length;
269  }
270  }
271 }
272 
275  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
276  const double zoom = tmp->zoom();
277  const double range = daqparameters->outputs->maxoutputscanner() - daqparameters->outputs->minoutputscanner();
278  const double rangezoomed = range / zoom;
279 
280  // choose the maximum scanner amplitude for the larger frame side
281  double xrangezoomed;
282  if(tmp->xaspectratio >= tmp->yaspectratio) {
283  xrangezoomed = rangezoomed;
284  }
285  else {
286  xrangezoomed = static_cast<double>(tmp->xaspectratio) / static_cast<double>(tmp->yaspectratio) * rangezoomed;
287  }
288  const double devicecenter = (daqparameters->outputs->minoutputscanner() + daqparameters->outputs->maxoutputscanner()) * 0.5; // center of the device range (e.g. scanner takes +-3V -> center is 0V)
289  double center = devicecenter + tmp->xoffset()*0.5*range; // center of the frame, offset +-1 means maximum offset
290  if ( center - 0.5*xrangezoomed < daqparameters->outputs->minoutputscanner() )
291  center = daqparameters->outputs->minoutputscanner()+0.5*xrangezoomed;
292  if ( center + 0.5*xrangezoomed > daqparameters->outputs->maxoutputscanner() )
293  center = daqparameters->outputs->maxoutputscanner()-0.5*xrangezoomed;
294  const double xminzoomed = center - 0.5*xrangezoomed; // minimum x value after zoom
295  const double xmaxzoomed = center + 0.5*xrangezoomed; // maximum x value after zoom
296  const double xscanslope = xrangezoomed / static_cast<double>(tmp->XScanPixels());
297  const double xretraceslope = -xrangezoomed / static_cast<double>(tmp->XRetracePixels());
298  // *2 since samples for x and p are interleaved
299  const uint32_t xcutoffsamples = 2*tmp->XCutoffPixels();
300  const uint32_t ximagesamples = 2*tmp->XImagePixels();
301  const uint32_t xtotalsamples = 2*tmp->XTotalPixels();
302  // scale pockels value from displayed value (e.g. 0..1) to device value (e.g. 0..2 V)
303  const double pockelsoutval = (tmp->pockels()-tmp->pockels.ll())/(tmp->pockels.ul()-tmp->pockels.ll())
304  *daqparameters->outputs->maxoutputpockels()+daqparameters->outputs->minoutputpockels();
305 
306  uint32_t x = 0;
307  const size_t cx = 0; // xp interleaved starts at index 0
308 
309  // fill in XCutoffSamples()+XImageSamples() with increasing values (scanning) in X
310  for ( size_t i = cx ; i < cx+xcutoffsamples ; i += 2, ++x ) {
311  // x galvo ramps up
312  vecptr->at(i) = scaletodevice(xminzoomed + x * xscanslope);
313  // Pockels cell is blanked/closed
314  vecptr->at(i+1) = 0;
315  }
316  for ( size_t i = cx+xcutoffsamples ; i < cx+xcutoffsamples+ximagesamples ; i += 2, ++x ) {
317  // x galvo ramps further up
318  vecptr->at(i) = scaletodevice(xminzoomed + x * xscanslope);
319  // Pockels cell is open now
320  vecptr->at(i+1) = scaletodevice(pockelsoutval);
321  }
322  // fill in XRetraceSamples() with decreasing values (retracing) in X
323  x = 0; // restart sloping
324  for ( size_t i = cx+xcutoffsamples+ximagesamples ; i < cx+xtotalsamples ; i += 2, ++x ) {
325  // x galvo quickly ramps down
326  vecptr->at(i) = scaletodevice(xmaxzoomed + x * xretraceslope);
327  // Pockels cell blanked/closed again
328  vecptr->at(i+1) = 0;
329  }
330 
331  // Adjust for the scannerdelay by rotating the pockels vector (do not respect oversampling, since pockels vector is with pixels, not oversampled input samples)
332  const int32_t pockels_rotation = daqparameters->ScannerDelaySamples(false);
333  if ( pockels_rotation > 0 ) {
334  auto length = xtotalsamples;
335  size_t p = 1; // pockels starts at 2nd sample
336  size_t pr = p + pockels_rotation*2; // every 2nd sample is pockels
337  for ( uint32_t i = 0 ; i < length ; ++i ) {
338  std::swap(vecptr->at(p), vecptr->at(pr));
339  // Modulo does the turnaround
340  p = (p+2)%length;
341  pr = (pr+2)%length;
342  }
343  }
344  if ( pockels_rotation < 0 ) {
345  auto length = xtotalsamples;
346  size_t p = 0; // from reverse pockels starts at 0
347  size_t pr = p + pockels_rotation*2; // every 2nd sample is pockels
348  for ( uint32_t i = 0 ; i < length ; ++i) {
349  std::swap(vecptr->at(length-p), vecptr->at(length-pr));
350  // Modulo does the turnaround
351  p = (p+2)%length;
352  pr = (pr+2)%length;
353  }
354  }
355 }
356 
359  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
360  const double zoom = tmp->zoom();
361  const double range = daqparameters->outputs->maxoutputscanner() - daqparameters->outputs->minoutputscanner();
362  const double rangezoomed = range / zoom;
363  // choose the maximum scanner amplitude for the larger frame side
364  double yrangezoomed;
365  if(tmp->xaspectratio >= tmp->yaspectratio) {
366  yrangezoomed = static_cast<double>(tmp->yaspectratio) / static_cast<double>(tmp->xaspectratio) * rangezoomed;
367  }
368  else {
369  yrangezoomed = rangezoomed;
370  }
371  const double devicecenter = (daqparameters->outputs->minoutputscanner() + daqparameters->outputs->maxoutputscanner()) * 0.5; // center of the device range (e.g. scanner takes +-3V -> center is 0V)
372  double center = devicecenter + tmp->yoffset()*0.5*range; // center of the frame, offset +-1 means maximum offset
373  if ( center - 0.5*yrangezoomed < daqparameters->outputs->minoutputscanner() )
374  center = daqparameters->outputs->minoutputscanner()+0.5*yrangezoomed;
375  if ( center + 0.5*yrangezoomed > daqparameters->outputs->maxoutputscanner() )
376  center = daqparameters->outputs->maxoutputscanner()-0.5*yrangezoomed;
377  const double yminzoomed = center - 0.5*yrangezoomed; // minimum y value after zoom
378  const double ymaxzoomed = center + 0.5*yrangezoomed; // maximum y value after zoom
379  const double yscanslope = yrangezoomed / static_cast<double>(tmp->YScanLines());
380  const double yretraceslope = -yrangezoomed / static_cast<double>(tmp->YRetraceLines());
381  // *2 since samples for y and z are interleaved
382  const uint32_t ycutoffsamples = 2*tmp->YCutoffLines();
383  const uint32_t yimagesamples = 2*tmp->YImageLines();
384  const uint32_t ytotalsamples = 2*tmp->YTotalLines();
385 
386  const Scaler<int16_t> scaletodevicez(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
387  const int16_t fastzoutdev = scaletodevicez(zparameters->PositionToVoltage(svparameters->fastz())); // get the voltage corresponding to current ETL position in micron an
388 
389  uint32_t y = 0;
390  const size_t cy = 2*tmp->XTotalPixels(); // yz interleaved starts after 2*XTotalPixels (for xp)
391 
392  // fill in YCutoffSamples()+YImageSamples() with increasing values (scanning) in Y
393  for ( size_t i = cy ; i < cy+ycutoffsamples+yimagesamples ; i += 2, ++y ) {
394  // y galvo ramps up
395  vecptr->at(i) = scaletodevice(yminzoomed + y * yscanslope);
396  // fast z stays
397  vecptr->at(i+1) = fastzoutdev;
398  }
399  // fill in YRetraceSamples() with decreasing values (retracing) in Y
400  y = 0; // restart sloping
401  for ( size_t i = cy+ycutoffsamples+yimagesamples ; i < cy+ytotalsamples ; i += 2, ++y ) {
402  // y galvo quickly ramps down
403  vecptr->at(i) = scaletodevice(ymaxzoomed + y * yretraceslope);
404  // fast z stays
405  vecptr->at(i+1) = fastzoutdev;
406  }
407 
408 }
409 
412  const Scaler<int16_t> scaletodevice(-daqparameters->outputs->range(), daqparameters->outputs->range()); // convert full device range to full range of int16_t
413  const int16_t pockelsoutval = scaletodevice((tmp->pockels()-tmp->pockels.ll())/(tmp->pockels.ul()-tmp->pockels.ll())
414  *daqparameters->outputs->maxoutputpockels()+daqparameters->outputs->minoutputpockels());
415  const int16_t fastzoutdev = scaletodevice(zparameters->PositionToVoltage(svparameters->fastz())); // get the voltage corresponding to current ETL position in micron an
416  // *2 since samples for z and p are interleaved
417  const uint32_t xcutoffsamples = 2*tmp->XCutoffPixels();
418  const uint32_t ximagesamples = 2*tmp->XImagePixels();
419  const uint32_t xtotalsamples = 2*tmp->XTotalPixels();
420 
421  // Fast z is the same the whole line, Pockels is closed/0 during cutoff and retrace
422  for ( size_t i = 0 ; i < xcutoffsamples ; i+=2 ) {
423  vecptr->operator[](i) = fastzoutdev;
424  vecptr->operator[](i+1) = 0;
425  }
426  for ( size_t i = xcutoffsamples ; i < xcutoffsamples+ximagesamples ; i+=2 ) {
427  vecptr->operator[](i) = fastzoutdev;
428  vecptr->operator[](i+1) = pockelsoutval;
429  }
430  for ( size_t i = xcutoffsamples+ximagesamples ; i < xtotalsamples ; i+=2 ) {
431  vecptr->operator[](i) = fastzoutdev;
432  vecptr->operator[](i+1) = 0;
433  }
434 
435 }
436 
437 void ScannerVectorFrameSaw::RotateP(const size_t& _pstart, const size_t& _interleavedfactor, const int32_t& _rotateby) {
438  const size_t length = vecptr->size();
439  if ( _rotateby > 0 ) {
440  size_t p = _pstart;
441  size_t pr = p + _rotateby*_interleavedfactor;
442  for ( uint32_t i = 0 ; i < length ; i += _interleavedfactor ) {
443  std::swap(vecptr->at(p), vecptr->at(pr));
444  // Modulo does the turnaround
445  p = (p+_interleavedfactor)%length;
446  pr = (pr+_interleavedfactor)%length;
447  }
448  }
449  if ( _rotateby < 0 ) {
450  size_t p = 0; // from reverse pockels starts at 0
451  size_t pr = p + _rotateby*_interleavedfactor;
452  for ( uint32_t i = 0 ; i < vecptr->size() ; i += _interleavedfactor ) {
453  std::swap(vecptr->at(length-p), vecptr->at(length-pr));
454  // Modulo does the turnaround
455  p = (p+_interleavedfactor)%length;
456  pr = (pr+_interleavedfactor)%length;
457  }
458  }
459 }
460 
461 }
virtual uint32_t YTotalLines() const
Definition: Framescan.h:181
virtual uint32_t XTotalPixels() const
Definition: Framescan.h:178
std::unique_ptr< Outputs > outputs
the output parameters
Definition: IO.h:767
uint32_t TotalPixels() const override
Definition: Framescan.h:289
ScopeNumber< double > pockels
pockels cell value
Definition: Framescan.h:163
void FillZP()
Fill the samples for fast z and Pockels for one line, used for slave areas.
Simple exception class for Scope.
Definition: ScopeException.h:9
void UpdateVector() override
Calculate the scanner vector based on the current parameters.
virtual uint32_t XImagePixels() const
Definition: Framescan.h:172
Parent class for frame scans.
void FillP()
Fill the samples for the Pockels cell (cutoff&retrace blanking for x and y)
ScannerVectorFrameSaw(const ScannerVectorFillType &_filltype)
ScopeNumber< double > xaspectratio
aspect ratio in x direction
Definition: Framescan.h:141
Class for scaling to the full range of a datatype.
Definition: helpers.h:113
void FillYZ()
Fill the samples for y and fast z for one column (one sample per line).
ScopeNumber< double > yaspectratio
aspect ratio in y direction
Definition: Framescan.h:144
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
void FillLookup()
Fill in the lookup vector.
This is the include file for standard system include files, or project specific include files that ar...
int32_t ScannerDelaySamples(const bool &_respectoversampling) const
Definition: IO.cpp:655
parameters::ScannerVectorFrameBasic * svparameters
current scanner vector parameter set (needs to be pointer for dynamic_cast in derived classes and bec...
int32_t lookup_rotation
how much is the current lookup vector rotated to adjust for scannerdelay
std::shared_ptr< std::vector< std::size_t > > lookup
gives the position in the image vector for each position in the acquired data vector (keep in mind th...
ScopeNumber< double > xoffset
x offset
Definition: Framescan.h:154
#define DBOUT(s)
A debug output to the debug console.
Definition: helpers.h:153
const ScannerVectorFillTypeHelper::Mode filltype
The fill type.
parameters::Daq * daqparameters
current daq parameter set
uint32_t YTotalLines() const override
Definition: Framescan.h:286
Parameters for a ScannerVectorFrameSaw.
Definition: Framescan.h:210
std::shared_ptr< std::vector< int16_t > > vecptr
the actual scanner vector (if fullframevector) with x, y, fast z, Pockels either interleaved (for ful...
void RotateP(const size_t &_pstart, const size_t &_interleavedfactor, const int32_t &_rotateby)
Rotate the Pockels samples in the scanner vector.
Describes the scanner vector type.
ScopeNumber< double > yoffset
y offset
Definition: Framescan.h:157
ScopeNumber< double > zoom
current zoom factor (from 1 to 20).
Definition: Framescan.h:151
ScopeNumber< double > fastz
current fast z position
Definition: Framescan.h:160
uint32_t TotalPixels() const override
Definition: Framescan.h:183
void FillY()
Fill the samples for the y scanner axis.
uint32_t XTotalPixels() const override
Definition: Framescan.h:274
parameters::SCOPE_FPUZCONTROL_T * zparameters
current fast z parameter set
void FillXP()
Fill the samples for x and Pockels cell for one line.
void FillZ()
Fill the samples for the fast z axis (stays constant here)
void FillX()
Fill the samples for the x scanner axis.
virtual uint32_t YImageLines() const
Definition: Framescan.h:175