Improve framing tool usability

* Rename "Resize" to "Resize & Framing" from discoverability
* Add ColorPreview class for displaying a solid color
* Add border color preview
This commit is contained in:
Daniel Gao
2024-11-18 12:14:19 -05:00
parent 2458ba4a29
commit 57ef07f3f6
7 changed files with 165 additions and 7 deletions

View File

@@ -1069,7 +1069,9 @@ Imagefloat* ImProcFunctions::drawFrame(Imagefloat* rgb, const FramingParams& par
Imagefloat* framed = new Imagefloat(dims.framedWidth, dims.framedHeight);
auto clip = [](int v) { return std::max(0, std::min(v, 65535)); };
// Color::gamma2curve expects a 16-bit value, but the GUI sliders are
// using 8-bit values. Step up the user value to 16-bits.
auto clip = [](int v) { return std::max(0, std::min(v, 255)) * 256; };
float r = Color::gamma2curve[clip(params.borderRed)];
float g = Color::gamma2curve[clip(params.borderGreen)];