GCC Code Coverage Report


Directory: ./
File: tasks/batkov_f_contrast_enh_lin_hist_stretch_seq/seq/src/ops_seq.cpp
Date: 2026-04-02 17:12:27
Exec Total Coverage
Lines: 18 18 100.0%
Functions: 5 5 100.0%
Branches: 6 10 60.0%

Line Branch Exec Source
1 #include "batkov_f_contrast_enh_lin_hist_stretch_seq/seq/include/ops_seq.hpp"
2
3 #include <algorithm>
4 #include <cstddef>
5 #include <cstdint>
6 #include <vector>
7
8 #include "batkov_f_contrast_enh_lin_hist_stretch_seq/common/include/common.hpp"
9
10 namespace batkov_f_contrast_enh_lin_hist_stretch_seq {
11
12
1/2
✓ Branch 1 taken 32 times.
✗ Branch 2 not taken.
32 BatkovFContrastEnhLinHistStretchSEQ::BatkovFContrastEnhLinHistStretchSEQ(const InType &in) {
13 SetTypeOfTask(GetStaticTypeOfTask());
14
1/2
✓ Branch 1 taken 32 times.
✗ Branch 2 not taken.
32 GetInput() = in;
15 32 }
16
17 32 bool BatkovFContrastEnhLinHistStretchSEQ::ValidationImpl() {
18 32 return !GetInput().empty();
19 }
20
21 32 bool BatkovFContrastEnhLinHistStretchSEQ::PreProcessingImpl() {
22 32 GetOutput().resize(GetInput().size());
23 32 return true;
24 }
25
26
1/2
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
32 bool BatkovFContrastEnhLinHistStretchSEQ::RunImpl() {
27 auto [min_it, max_it] = std::ranges::minmax_element(GetInput());
28 32 uint8_t min_el = *min_it;
29 32 uint8_t max_el = *max_it;
30
31
1/2
✓ Branch 0 taken 32 times.
✗ Branch 1 not taken.
32 if (max_el > min_el) {
32 32 double scale = 255.0 / (max_el - min_el);
33
2/2
✓ Branch 0 taken 42080000 times.
✓ Branch 1 taken 32 times.
42080032 for (size_t i = 0; i < GetInput().size(); ++i) {
34 42080000 GetOutput()[i] = static_cast<uint8_t>(std::min(255.0, (GetInput()[i] - min_el) * scale));
35 }
36 }
37
38 32 return true;
39 }
40
41 32 bool BatkovFContrastEnhLinHistStretchSEQ::PostProcessingImpl() {
42 32 return !GetOutput().empty();
43 }
44
45 } // namespace batkov_f_contrast_enh_lin_hist_stretch_seq
46