1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkImageRGBToHSV.h 5 6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 7 All rights reserved. 8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 9 10 This software is distributed WITHOUT ANY WARRANTY; without even 11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 12 PURPOSE. See the above copyright notice for more information. 13 14 =========================================================================*/ 15 /** 16 * @class vtkImageRGBToHSV 17 * @brief Converts RGB components to HSV. 18 * 19 * For each pixel with red, blue, and green components this 20 * filter output the color coded as hue, saturation and value. 21 * Output type must be the same as input type. 22 */ 23 24 #ifndef vtkImageRGBToHSV_h 25 #define vtkImageRGBToHSV_h 26 27 28 #include "vtkImagingColorModule.h" // For export macro 29 #include "vtkThreadedImageAlgorithm.h" 30 31 class VTKIMAGINGCOLOR_EXPORT vtkImageRGBToHSV : public vtkThreadedImageAlgorithm 32 { 33 public: 34 static vtkImageRGBToHSV *New(); 35 vtkTypeMacro(vtkImageRGBToHSV,vtkThreadedImageAlgorithm); 36 void PrintSelf(ostream& os, vtkIndent indent) override; 37 38 39 // Hue is an angle. Maximum specifies when it maps back to 0. HueMaximum 40 // defaults to 255 instead of 2PI, because unsigned char is expected as 41 // input. Maximum also specifies the maximum of the Saturation. 42 vtkSetMacro(Maximum,double); 43 vtkGetMacro(Maximum,double); 44 45 protected: 46 vtkImageRGBToHSV(); ~vtkImageRGBToHSV()47 ~vtkImageRGBToHSV() override {} 48 49 double Maximum; 50 51 void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 52 int ext[6], int id) override; 53 private: 54 vtkImageRGBToHSV(const vtkImageRGBToHSV&) = delete; 55 void operator=(const vtkImageRGBToHSV&) = delete; 56 }; 57 58 #endif 59 60 61 62