[Liblas-commits] hg: color summarization logic was screwed. unscrew
it
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Dec 22 11:44:56 EST 2010
changeset 2c9aab8dcc05 in /Volumes/Data/www/liblas.org/hg
details: http://hg.liblas.orghg?cmd=changeset;node=2c9aab8dcc05
summary: color summarization logic was screwed. unscrew it
diffstat:
src/utility.cpp | 54 +++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 41 insertions(+), 13 deletions(-)
diffs (76 lines):
diff -r 34b4c42ff3ff -r 2c9aab8dcc05 src/utility.cpp
--- a/src/utility.cpp Wed Dec 22 10:09:22 2010 -0600
+++ b/src/utility.cpp Wed Dec 22 10:44:50 2010 -0600
@@ -247,31 +247,59 @@
if (bHaveColor)
{
liblas::Color const& color = p.GetColor();
-
+ liblas::Color::value_type min_red = min.GetColor().GetRed();
+ liblas::Color::value_type min_green = min.GetColor().GetGreen();
+ liblas::Color::value_type min_blue = min.GetColor().GetBlue();
+
+ liblas::Color::value_type max_red = max.GetColor().GetRed();
+ liblas::Color::value_type max_green = max.GetColor().GetGreen();
+ liblas::Color::value_type max_blue = max.GetColor().GetBlue();
+
bool bSetMinColor = false;
- if (color.GetRed() < min.GetColor().GetRed())
+ if (color.GetRed() < min_red)
+ {
bSetMinColor = true;
- if (color.GetGreen() < min.GetColor().GetGreen())
+ min_red = color.GetRed();
+ }
+ if (color.GetGreen() < min_green)
+ {
bSetMinColor = true;
- if (color.GetBlue() < min.GetColor().GetBlue())
+ min_green = color.GetGreen();
+ }
+ if (color.GetBlue() < min_blue)
+ {
bSetMinColor = true;
+ min_blue = color.GetBlue();
+ }
+
bool bSetMaxColor = false;
- if (color.GetRed() > max.GetColor().GetRed())
+ if (color.GetRed() > max_red)
+ {
bSetMaxColor = true;
- if (color.GetGreen() > max.GetColor().GetGreen())
+ max_red = color.GetRed();
+ }
+
+
+ if (color.GetGreen() > max_green)
+ {
bSetMaxColor = true;
- if (color.GetBlue() > max.GetColor().GetBlue())
+ max_green = color.GetGreen();
+ }
+ if (color.GetBlue() > max_blue)
+ {
bSetMaxColor = true;
+ max_blue = color.GetBlue();
+ }
if (bSetMinColor)
- min.SetColor(liblas::Color( color.GetRed(),
- color.GetGreen(),
- color.GetBlue()));
+ min.SetColor(liblas::Color( min_red,
+ min_green,
+ min_blue));
if (bSetMaxColor)
- max.SetColor(liblas::Color( color.GetRed(),
- color.GetGreen(),
- color.GetBlue()));
+ max.SetColor(liblas::Color( max_red,
+ max_green,
+ max_blue));
}
More information about the Liblas-commits
mailing list