From 5632ab913568171d37ecda967b8852886855a432 Mon Sep 17 00:00:00 2001 From: Seb James Date: Tue, 8 Jul 2025 14:55:15 +0100 Subject: [PATCH] RBGMono and RGBGrey both need same treatment as RGB in these VisualModels --- mplot/CartGridVisual.h | 8 ++++++-- mplot/GridVisual.h | 10 +++++++--- mplot/HexGridVisual.h | 4 +++- mplot/VoronoiVisual.h | 8 ++++++-- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/mplot/CartGridVisual.h b/mplot/CartGridVisual.h index 2209b217..fbe9ff5e 100644 --- a/mplot/CartGridVisual.h +++ b/mplot/CartGridVisual.h @@ -138,7 +138,9 @@ namespace mplot { this->dcolour3[i] = (*this->vectorData)[i][2]; } this->zScale.transform (veclens, this->dcopy); - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); this->colourScale2.transform (this->dcolour2, this->dcolour2); this->colourScale3.transform (this->dcolour3, this->dcolour3); @@ -210,7 +212,9 @@ namespace mplot { // Handle case where this->cm.getType() == mplot::ColourMapType::RGB and there is // exactly one colour. ColourMapType::RGB assumes R/G/B data all in range 0->1 // ALREADY and therefore they don't need to be re-scaled with this->colourScale. - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); // Dual axis colour maps like Duochrome and HSV will need to use colourScale2 to // transform their second colour/axis, diff --git a/mplot/GridVisual.h b/mplot/GridVisual.h index e610ad2b..3755f20b 100644 --- a/mplot/GridVisual.h +++ b/mplot/GridVisual.h @@ -394,9 +394,11 @@ namespace mplot { this->zScale.transform (veclens, this->dcopy); // Handle case where this->cm.getType() == mplot::ColourMapType::RGB and there is - // exactly one colour. ColourMapType::RGB assumes R/G/B data all in range 0->1 + // exactly one colour. ColourMapType::RGB (and RGBMono/Grey) assumes R/G/B data all in range 0->1 // ALREADY and therefore they don't need to be re-scaled with this->colourScale. - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); // Dual axis colour maps like Duochrome and HSV will need to use colourScale2 to // transform their second colour/axis, @@ -1195,7 +1197,9 @@ namespace mplot { this->dcolour2[i] = (*this->vectorData)[i][1]; this->dcolour3[i] = (*this->vectorData)[i][2]; } - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); this->colourScale2.transform (this->dcolour2, this->dcolour2); this->colourScale3.transform (this->dcolour3, this->dcolour3); diff --git a/mplot/HexGridVisual.h b/mplot/HexGridVisual.h index 94d241f3..5b699be8 100644 --- a/mplot/HexGridVisual.h +++ b/mplot/HexGridVisual.h @@ -127,7 +127,9 @@ namespace mplot { // Handle case where this->cm.getType() == mplot::ColourMapType::RGB and there is // exactly one colour. ColourMapType::RGB assumes R/G/B data all in range 0->1 // ALREADY and therefore they don't need to be re-scaled with this->colourScale. - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); // Dual axis colour maps like Duochrome and HSV will need to use colourScale2 to // transform their second colour/axis, diff --git a/mplot/VoronoiVisual.h b/mplot/VoronoiVisual.h index b5bb6c28..d61d65e2 100644 --- a/mplot/VoronoiVisual.h +++ b/mplot/VoronoiVisual.h @@ -384,7 +384,9 @@ namespace mplot { this->dcolour2[i] = (*this->vectorData)[i][1]; this->dcolour3[i] = (*this->vectorData)[i][2]; } - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); this->colourScale2.transform (this->dcolour2, this->dcolour2); this->colourScale3.transform (this->dcolour3, this->dcolour3); @@ -491,7 +493,9 @@ namespace mplot { // Handle case where this->cm.getType() == mplot::ColourMapType::RGB and there is // exactly one colour. ColourMapType::RGB assumes R/G/B data all in range 0->1 // ALREADY and therefore they don't need to be re-scaled with this->colourScale. - if (this->cm.getType() != mplot::ColourMapType::RGB) { + if (this->cm.getType() != mplot::ColourMapType::RGB + && this->cm.getType() != mplot::ColourMapType::RGBMono + && this->cm.getType() != mplot::ColourMapType::RGBGrey) { this->colourScale.transform (this->dcolour, this->dcolour); // Dual axis colour maps like Duochrome and HSV will need to use colourScale2 to // transform their second colour/axis,