1 /*========================================================================= 2 3 Program: Visualization Toolkit 4 Module: vtkImageRGBToHSI.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 // .NAME vtkImageRGBToHSI - Converts RGB components to HSI. 16 // .SECTION Description 17 // For each pixel with red, blue, and green components this 18 // filter output the color coded as hue, saturation and intensity. 19 // Output type must be the same as input type. 20 21 #ifndef vtkImageRGBToHSI_h 22 #define vtkImageRGBToHSI_h 23 24 #include "vtkImagingColorModule.h" // For export macro 25 #include "vtkThreadedImageAlgorithm.h" 26 27 class VTKIMAGINGCOLOR_EXPORT vtkImageRGBToHSI : public vtkThreadedImageAlgorithm 28 { 29 public: 30 static vtkImageRGBToHSI *New(); 31 vtkTypeMacro(vtkImageRGBToHSI,vtkThreadedImageAlgorithm); 32 void PrintSelf(ostream& os, vtkIndent indent); 33 34 // Description: 35 // Hue is an angle. Maximum specifies when it maps back to 0. HueMaximum 36 // defaults to 255 instead of 2PI, because unsigned char is expected as 37 // input. Maximum also specifies the maximum of the Saturation. 38 vtkSetMacro(Maximum,double); 39 vtkGetMacro(Maximum,double); 40 41 protected: 42 vtkImageRGBToHSI(); ~vtkImageRGBToHSI()43 ~vtkImageRGBToHSI() {} 44 45 double Maximum; 46 47 void ThreadedExecute (vtkImageData *inData, vtkImageData *outData, 48 int ext[6], int id); 49 50 private: 51 vtkImageRGBToHSI(const vtkImageRGBToHSI&); // Not implemented. 52 void operator=(const vtkImageRGBToHSI&); // Not implemented. 53 }; 54 55 #endif 56 57 58 59