1#ifndef TTTRLIB_CLSMLINE_H
2#define TTTRLIB_CLSMLINE_H
16 std::vector<CLSMPixel> pixels;
17 int pixel_duration = -1;
31 this->pixel_duration = v;
35 if(pixel_duration < 0){
38 return pixel_duration;
46 pixels.resize(old_line.pixels.size());
47 pixels = old_line.pixels;
49 for(
auto &p: pixels) p.clear();
57 CLSMLine(
int line_start,
unsigned int n_pixel){
59 pixels.resize(n_pixel);
65 pixels.emplace_back(pixel);
69 return &pixels[i_pixel];
72 void crop(
int pixel_start,
int pixel_stop){
73 pixel_stop = std::min(pixel_stop, (
int)
size());
74 pixel_start = std::max(0, pixel_start);
76 #ifdef VERBOSE_TTTRLIB
77 std::clog <<
"Crop line" << std::endl;
78 std::clog <<
"-- Pixel range: " << pixel_start <<
", " << pixel_stop << std::endl;
81 pixels.erase(pixels.begin() + pixel_stop, pixels.end());
82 pixels.erase(pixels.begin(), pixels.begin() + pixel_start);
86 for(
size_t i = 0; i < pixels.size(); i++){
87 pixels[i] += rhs.pixels[i];
Definition CLSMFrame.h:12
Definition CLSMImage.h:161
CLSMLine & operator+=(const CLSMLine &rhs)
Definition CLSMLine.h:85
void crop(int pixel_start, int pixel_stop)
Definition CLSMLine.h:72
CLSMPixel * operator[](unsigned int i_pixel)
Definition CLSMLine.h:68
size_t size() final
Get the number of pixels per line a frame of the CLSMImage.
Definition CLSMLine.h:22
CLSMLine(const CLSMLine &old_line, bool fill=true)
Definition CLSMLine.h:44
virtual ~CLSMLine()=default
std::vector< CLSMPixel > & get_pixels()
Definition CLSMLine.h:26
unsigned long long get_pixel_duration()
Definition CLSMLine.h:34
void set_pixel_duration(int v)
Definition CLSMLine.h:30
CLSMLine(int line_start, unsigned int n_pixel)
Definition CLSMLine.h:57
CLSMLine(unsigned int line_start)
Definition CLSMLine.h:53
void append(CLSMPixel &pixel)
Definition CLSMLine.h:64
unsigned int get_duration(TTTR *tttr)
Gets the duration between the start and stop times of the TTTR range.
Definition TTTRRange.h:170
itlib::flat_set< int > _tttr_indices
Set of TTTR indices in the range.
Definition TTTRRange.h:23
Definition TTTRSelection.h:8
TTTR * _tttr
Definition TTTRSelection.h:12