MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / get_pixel_info

Method get_pixel_info

src/visualization/components/buffer.cpp:134–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void 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
157void Buffer::rotate(const float angle) {
158 angle_ += angle;

Callers 1

draw_status_barFunction · 0.80

Calls 3

get_channel_rangeFunction · 0.85
format_pixel_valueFunction · 0.85
dataMethod · 0.45

Tested by

no test coverage detected