From 701a31a5382d1f79e9cc075c42c23d84c4a23bd5 Mon Sep 17 00:00:00 2001 From: janos Date: Sat, 17 Oct 2020 16:25:38 +0200 Subject: [PATCH] add Smooth-Cool-Warm colormap --- doc/colormap-cool-warm-bent.png | Bin 0 -> 288 bytes doc/colormap-cool-warm-smooth.png | Bin 0 -> 301 bytes doc/generated/colormaps.cpp | 4 +- src/Magnum/DebugTools/ColorMap.cpp | 145 +++++++++++++++++++++++++++++ src/Magnum/DebugTools/ColorMap.h | 48 ++++++++++ 5 files changed, 196 insertions(+), 1 deletion(-) create mode 100644 doc/colormap-cool-warm-bent.png create mode 100644 doc/colormap-cool-warm-smooth.png diff --git a/doc/colormap-cool-warm-bent.png b/doc/colormap-cool-warm-bent.png new file mode 100644 index 0000000000000000000000000000000000000000..718d16aeea71a6f6260ac20c8a36738a515ac27a GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5csQ7VB-7F_|A5qUPZ!6KjK;TI2D7v zQoM4rG^TF<^ez8((!aMN>t5O~PQ8%!Lh9z+)iX8EroWE4Vs>>~^=psg8FH6+PtTmS zE%aI7x;p99$wpUOT4r5odHr8G_Wt${lj67}f+g4wOgYAAu(XiDCsT$YSPDD$C+ni$ V4h)}?_dEjyfTydU%Q~loCIEjSdxro3 literal 0 HcmV?d00001 diff --git a/doc/colormap-cool-warm-smooth.png b/doc/colormap-cool-warm-smooth.png new file mode 100644 index 0000000000000000000000000000000000000000..be90ce5264c84beabc3820ebbd8db897a62f0321 GIT binary patch literal 301 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5csQ7VB-7F_|A5pNPZ!6KjK;TN?;<92< z+vTi3Hg=im9NIErpR0su?q6_`E+Bwg+|9q7Z~=pt3F@aX7eU7_j3H}?D{qRf41G@GdX*(gmKp5mrN$^msvCV xmT_N@@fBZSIZMx>*d(^$S;j7gvln3sKC?4P1T!o-KQRRq8lJ9xF6*2UngB2(f0F viridis() { return Containers::StaticArrayView<256, const Vector3ub>{reinterpret_cast(&Viridis[0][0])}; } +Containers::StaticArrayView<256, const Vector3ub> coolWarmSmooth() { + return Containers::StaticArrayView<256, const Vector3ub>{reinterpret_cast(&CoolWarmSmooth[0][0])}; +} + +Containers::StaticArrayView<256, const Vector3ub> coolWarmBent() { + return Containers::StaticArrayView<256, const Vector3ub>{reinterpret_cast(&CoolWarmBent[0][0])}; +} + }}} diff --git a/src/Magnum/DebugTools/ColorMap.h b/src/Magnum/DebugTools/ColorMap.h index e998a9543..928fb2287 100644 --- a/src/Magnum/DebugTools/ColorMap.h +++ b/src/Magnum/DebugTools/ColorMap.h @@ -114,6 +114,26 @@ See @ref building, @ref cmake and @ref debug-tools for more information. @endparblock +@parblock + +@m_div{m-col-l-8 m-push-l-3 m-col-m-8 m-push-m-4 m-nopadt} +@image html colormap-cool-warm-smooth.png width=100% +@m_enddiv + +@m_div{m-col-l-2 m-pull-l-7 m-col-m-4 m-pull-m-8 m-text-center m-nopadt} @ref coolWarmSmooth() @m_enddiv + +@endparblock + +@parblock + +@m_div{m-col-l-8 m-push-l-3 m-col-m-8 m-push-m-4 m-nopadt} +@image html colormap-cool-warm-bent.png width=100% +@m_enddiv + +@m_div{m-col-l-2 m-pull-l-7 m-col-m-4 m-pull-m-8 m-text-center m-nopadt} @ref coolWarmBent() @m_enddiv + +@endparblock + For all color maps the returned data is the sRGB colorspace. Desired usage is by uploading to a texture with linear filtering, depending on the use case with either clamp or repeat wrapping. For a sRGB workflow don't forget to set the @@ -204,6 +224,34 @@ MAGNUM_DEBUGTOOLS_EXPORT Containers::StaticArrayView<256, const Vector3ub> infer */ MAGNUM_DEBUGTOOLS_EXPORT Containers::StaticArrayView<256, const Vector3ub> viridis(); +/** +@brief Smooth Cool-Warm colormap +@m_since{2020,06} + +@image html colormap-cool_warm_smooth.png width=100% + +@m_class{m-block m-primary} + +@thirdparty Created by [Kenneth Moreland](https://www.kennethmoreland.com/color-advice/). + It is a diverging (double-ended) color map with a smooth transition in the middle to prevent artifacts at the midpoint. + Although not isoluminant, this color map avoids dark colors to allow shading cues throughout. +*/ +MAGNUM_DEBUGTOOLS_EXPORT Containers::StaticArrayView<256, const Vector3ub> coolWarmSmooth(); + +/** +@brief Bent Cool-Warm colormap +@m_since{2020,06} + +@image html colormap-cool_warm_bent.png width=100% + +@m_class{m-block m-primary} + +@thirdparty Created by [Kenneth Moreland](https://www.kennethmoreland.com/color-advice/). + This color map is similar @ref coolWarmSmooth() except that the luminance is interpolated linearly with a sharp bend in the middle. + This makes for less washed out colors in the middle, but also creates an artifact at the midpoint. +*/ +MAGNUM_DEBUGTOOLS_EXPORT Containers::StaticArrayView<256, const Vector3ub> coolWarmBent(); + } }}