| 132 | } |
| 133 | |
| 134 | void Buffer::get_pixel_info(std::stringstream& message, |
| 135 | const int x, |
| 136 | const int y) const { |
| 137 | if (x < 0 || static_cast<float>(x) >= buffer_width_f || y < 0 || |
| 138 | static_cast<float>(y) >= buffer_height_f) { |
| 139 | message << "[out of bounds]"; |
| 140 | return; |
| 141 | } |
| 142 | |
| 143 | const auto pos = channels * (y * step + x); |
| 144 | const auto [start_ch, end_ch] = get_channel_range( |
| 145 | display_channel_mode_, channels, pixel_layout_.data()); |
| 146 | |
| 147 | message << "["; |
| 148 | for (int c = start_ch; c < end_ch && c < channels; ++c) { |
| 149 | if (c > start_ch) { |
| 150 | message << " "; |
| 151 | } |
| 152 | format_pixel_value(message, type, buffer_, pos + c); |
| 153 | } |
| 154 | message << "]"; |
| 155 | } |
| 156 | |
| 157 | void Buffer::rotate(const float angle) { |
| 158 | angle_ += angle; |
no test coverage detected