ccColorLevelsDlg.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //##########################################################################
  2. //# #
  3. //# CLOUDCOMPARE #
  4. //# #
  5. //# This program is free software; you can redistribute it and/or modify #
  6. //# it under the terms of the GNU General Public License as published by #
  7. //# the Free Software Foundation; version 2 or later of the License. #
  8. //# #
  9. //# This program is distributed in the hope that it will be useful, #
  10. //# but WITHOUT ANY WARRANTY; without even the implied warranty of #
  11. //# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
  12. //# GNU General Public License for more details. #
  13. //# #
  14. //# COPYRIGHT: EDF R&D / TELECOM ParisTech (ENST-TSI) #
  15. //# #
  16. //##########################################################################
  17. #ifndef CC_COLOR_LEVELS_DLG_HEADER
  18. #define CC_COLOR_LEVELS_DLG_HEADER
  19. //Qt
  20. #include <QColor>
  21. #include <ui_colorLevelsDlg.h>
  22. class ccHistogramWindow;
  23. class ccGenericPointCloud;
  24. //! Dialog to change the color levels
  25. class ccColorLevelsDlg : public QDialog, public Ui::ColorLevelsDialog
  26. {
  27. Q_OBJECT
  28. public:
  29. //! Default constructor
  30. ccColorLevelsDlg(QWidget* parent, ccGenericPointCloud* pointCloud);
  31. //! Scales some RGB fields of the input cloud
  32. static bool ScaleColorFields(ccGenericPointCloud* cloud, int inputLevelMin, int inputLevelMax, int outputLevelMin, int outputLevelMax, const bool applyRGB[3]);
  33. protected:
  34. void onChannelChanged(int);
  35. void onApply();
  36. protected:
  37. //! Channels
  38. enum CHANNELS { RGB = 0, RED = 1, GREEN = 2, BLUE = 3 };
  39. //! Updates histogram
  40. void updateHistogram();
  41. //! Associated histogram view
  42. ccHistogramWindow* m_histogram;
  43. //! Associated point cloud (color source)
  44. ccGenericPointCloud* m_cloud;
  45. };
  46. #endif //CC_COLOR_LEVELS_DLG_HEADER