2 #include "ScannerVectorFrameBiDi.h"
9 ScannerVectorFrameBiDi::~ScannerVectorFrameBiDi() {
33 uint32_t imagepos = 0;
34 bool forthline =
true;
36 for ( uint32_t l = 0 ; l < ytotallines ; l++ ) {
37 for ( uint32_t x = 0 ; x < xtotalpixels ; x++ ) {
39 if ( (l >= cutofflines) && (l < scanlines) && (x >= xturnpixels)) {
41 lookup->at(datapos) = imagepos++;
43 lookup->at(datapos) = --imagepos;
50 if ( (l >= cutofflines) && (l < scanlines) )
51 imagepos += xtotalpixels - xturnpixels;
52 forthline = !forthline;
69 const double rangezoomed = range / zoom;
74 xrangezoomed = rangezoomed;
81 if ( center - 0.5*xrangezoomed < daqparameters->outputs->minoutputscanner() )
85 const double xminzoomed = center - 0.5*xrangezoomed;
86 const double xmaxzoomed = center + 0.5*xrangezoomed;
96 vecptr->at(i) = scaletodevice(xminzoomed + x * xslope);
99 if ( cx >= 4*framesamples)
104 vecptr->at(i) = scaletodevice(xminzoomed + x * xslope);
107 }
while ( cx < 4*framesamples );
116 const double zoom = tmp->
zoom();
118 const double rangezoomed = range / zoom;
126 yrangezoomed = rangezoomed;
129 double center = devicecenter + tmp->
yoffset()*0.5*range;
130 if ( center - 0.5*yrangezoomed < daqparameters->outputs->minoutputscanner() )
134 const double yminzoomed = center - 0.5*yrangezoomed;
135 const double ymaxzoomed = center + 0.5*yrangezoomed;
136 const double yscanslope = yrangezoomed /
static_cast<double>(tmp->
YScanLines());
138 const uint32_t yscanlinesamples = 4*tmp->
YScanLines()*linesamples;
140 uint32_t yretrace = 0;
145 if ( cy < (1 + yscanlinesamples) ) {
146 for (
size_t i = cy ; i < cy+4*linesamples ; i += 4 )
147 vecptr->at(i) = scaletodevice(yminzoomed + yscan * yscanslope);
152 for (
size_t i = cy ; i < cy+4*linesamples ; i += 4 ) {
153 vecptr->at(i) = scaletodevice(ymaxzoomed + yretrace * yretraceslope);
158 }
while ( cy < (4*framesamples + 1) );
174 for (
size_t i = cz ; i < cz + 4*linesamples ; i += 4 )
175 vecptr->at(i) = fastzoutdev;
177 }
while ( cz < (4*framesamples + 2) );
189 const int16_t pockelsdev = scaletodevice(tmp->
pockels());
195 if ( (cp < (3 + 4*cutofflines*linesamples))
196 || (cp > (3 + 4*scanlines*linesamples)) ) {
197 for (
size_t i = cp ; i < cp + 4*linesamples ; i += 4 )
198 vecptr->at(i) = scaletodevice(0.0);
202 for (
size_t i = cp ; i < cp + 4*linesamples ; i += 4 )
203 vecptr->at(i) = pockelsdev;
206 }
while ( cp < (4*framesamples + 2) );
virtual uint32_t XTotalPixels() const
std::unique_ptr< Outputs > outputs
the output parameters
ScopeNumber< double > pockels
pockels cell value
uint32_t YScanLines() const
Parameters for a ScannerVectorFrameBiDi.
uint32_t YTotalLines() const override
Parent class for frame scans.
ScopeNumber< double > xaspectratio
aspect ratio in x direction
Class for scaling to the full range of a datatype.
void UpdateVector() override
Calculate the scanner vector based on the current parameters.
ScopeNumber< double > yaspectratio
aspect ratio in y direction
Base class for all Scope datatypes here, provides a uniform interface (and saves typing...).
void FillP()
Fill the samples for the Pockels cell (cutoff&retrace blanking for x and y)
uint32_t TotalPixels() const override
This is the include file for standard system include files, or project specific include files that ar...
int32_t ScannerDelaySamples(const bool &_respectoversampling) const
uint32_t XTotalPixels() const override
uint32_t XTurnPixels() const
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
parameters::Daq * daqparameters
current daq parameter set
std::shared_ptr< std::vector< int16_t > > vecptr
the actual scanner vector (if fullframevector) with x, y, fast z, Pockels either interleaved (for ful...
ScannerVectorFrameBiDi(const ScannerVectorFillType &_filltype)
Describes the scanner vector type.
uint32_t YRetraceLines() const
ScopeNumber< double > yoffset
y offset
void FillZ()
Fill the samples for the fast z axis (stays constant here)
ScopeNumber< double > zoom
current zoom factor (from 1 to 20).
void FillLookup()
Fill in the lookup vector.
ScopeNumber< double > fastz
current fast z position
void FillY()
Fill the samples for the y scanner axis.
uint32_t TotalPixels() const override
uint32_t YCutoffLines() const
parameters::SCOPE_FPUZCONTROL_T * zparameters
current fast z parameter set
void FillX()
Fill the samples for the x scanner axis.