OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkImageMapToColors.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkImageMapToColors.h,v $
5   Language:  C++
6   Date:      $Date: 2002/12/11 14:26:22 $
7   Version:   $Revision: 1.19 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkImageMapToColors - map the input image through a lookup table
19 // .SECTION Description
20 // The vtkImageMapToColors filter will take an input image of any valid
21 // scalar type, and map the first component of the image through a
22 // lookup table.  The result is an image of type VTK_UNSIGNED_CHAR.
23 // If the lookup table is not set, or is set to NULL, then the input
24 // data will be passed through if it is already of type UNSIGNED_CHAR.
25
26 // .SECTION See Also
27 // vtkLookupTable vtkScalarsToColors
28
29 #ifndef __vtkImageMapToColors_h
30 #define __vtkImageMapToColors_h
31
32
33 #include "vtkImageToImageFilter.h"
34
35 class vtkScalarsToColors;
36
37 class VTK_IMAGING_EXPORT vtkImageMapToColors : public vtkImageToImageFilter
38 {
39 public:
40   static vtkImageMapToColors *New();
41   vtkTypeRevisionMacro(vtkImageMapToColors,vtkImageToImageFilter);
42   void PrintSelf(ostream& os, vtkIndent indent);
43
44   // Description:
45   // Set the lookup table.
46   virtual void SetLookupTable(vtkScalarsToColors*);
47   vtkGetObjectMacro(LookupTable,vtkScalarsToColors);
48
49   // Description:
50   // Set the output format, the default is RGBA.  
51   vtkSetMacro(OutputFormat,int);
52   vtkGetMacro(OutputFormat,int);
53   void SetOutputFormatToRGBA() { this->OutputFormat = VTK_RGBA; };
54   void SetOutputFormatToRGB() { this->OutputFormat = VTK_RGB; };
55   void SetOutputFormatToLuminanceAlpha() { this->OutputFormat = VTK_LUMINANCE_ALPHA; };
56   void SetOutputFormatToLuminance() { this->OutputFormat = VTK_LUMINANCE; };
57
58   // Description:
59   // Set the component to map for multi-component images (default: 0)
60   vtkSetMacro(ActiveComponent,int);
61   vtkGetMacro(ActiveComponent,int);
62
63   // Description:
64   // Use the alpha component of the input when computing the alpha component
65   // of the output (useful when converting monochrome+alpha data to RGBA)
66   vtkSetMacro(PassAlphaToOutput,int);
67   vtkBooleanMacro(PassAlphaToOutput,int);
68   vtkGetMacro(PassAlphaToOutput,int);
69
70   // Description:
71   // We need to check the modified time of the lookup table too.
72   unsigned long GetMTime();
73
74 protected:
75   vtkImageMapToColors();
76   ~vtkImageMapToColors();
77
78   void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
79   void ExecuteInformation() {
80     this->vtkImageToImageFilter::ExecuteInformation(); };
81   void ThreadedExecute(vtkImageData *inData, vtkImageData *outData,
82                        int extent[6], int id);
83   
84   void ExecuteData(vtkDataObject *output);
85
86   vtkScalarsToColors *LookupTable;
87   int OutputFormat;
88   
89   int ActiveComponent;
90   int PassAlphaToOutput;
91
92   int DataWasPassed;
93 private:
94   vtkImageMapToColors(const vtkImageMapToColors&);  // Not implemented.
95   void operator=(const vtkImageMapToColors&);  // Not implemented.
96 };
97
98 #endif
99
100
101
102
103
104
105