| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <algorithm> | ||
| 4 | #include <cstddef> | ||
| 5 | #include <task/include/task.hpp> | ||
| 6 | #include <tuple> | ||
| 7 | #include <vector> | ||
| 8 | |||
| 9 | namespace makovskiy_i_gauss_filter_vert { | ||
| 10 | |||
| 11 | using InType = std::tuple<std::vector<int>, int, int>; | ||
| 12 | using OutType = std::vector<int>; | ||
| 13 | |||
| 14 | using BaseTask = ppc::task::Task<InType, OutType>; | ||
| 15 | |||
| 16 | inline int GetPixel(const std::vector<int> &image, int x, int y, int width, int height) { | ||
| 17 | 1983 | int clamped_x = std::clamp(x, 0, width - 1); | |
| 18 | 1821 | int clamped_y = std::clamp(y, 0, height - 1); | |
| 19 | 1983 | return image[(static_cast<size_t>(clamped_y) * width) + clamped_x]; | |
| 20 | } | ||
| 21 | |||
| 22 | } // namespace makovskiy_i_gauss_filter_vert | ||
| 23 |