MCPcopy Create free account
hub / github.com/averne/Fizeau / new_range

Function new_range

application/src/gui.cpp:95–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93};
94
95bool new_range(auto name, auto labelcb, auto labello, auto labelhi, ColorRange &range) {
96 auto [width, height] = im::GetIO().DisplaySize;
97 im::PushItemWidth(im::GetWindowWidth() * 0.2f);
98 FZ_SCOPEGUARD([] { im::PopItemWidth(); });
99
100 bool is_full_range = (range.lo == MIN_RANGE) && (range.hi == MAX_RANGE);
101 bool ret = false;
102 im::TextUnformatted(name);
103 im::SameLine(); im::SetCursorPosX(0.08f * width);
104 if (im::Checkbox(labelcb, &is_full_range)) {
105 ret = true;
106 if (is_full_range)
107 range = DEFAULT_RANGE;
108 else
109 range = DEFAULT_LIMITED_RANGE;
110 }
111 im::SetCursorPosX(0.03f * width);
112 im::TextUnformatted("Min:"); im::SameLine();
113 im::SetCursorPosX(0.08f * width);
114 ret |= im::DragFloat(labello, &range.lo, 0.005f, 0.0f, range.hi, "%.02f");
115 ret |= swkbd::handle(labello, &range.lo, 0.0f, range.hi, "%.02f");
116 im::SameLine();
117 im::TextUnformatted("Max:"); im::SameLine();
118 ret |= im::DragFloat(labelhi, &range.hi, 0.005f, range.lo, 1.0f, "%.02f");
119 ret |= swkbd::handle(labelhi, &range.hi, range.lo, 1.0f, "%.02f");
120 return ret;
121}
122
123void new_plot(float *data, std::size_t data_size, const ImVec2 &scale, const ImVec4 &color, const ImRect &bb) {
124 ImGuiWindow* window = im::GetCurrentWindow();

Callers 1

draw_correction_tabFunction · 0.85

Calls 1

handleFunction · 0.85

Tested by

no test coverage detected