1 /*=========================================================================
2 
3   Program: GDCM (Grassroots DICOM). A DICOM library
4 
5   Copyright (c) 2006-2011 Mathieu Malaterre
6   All rights reserved.
7   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8 
9      This software is distributed WITHOUT ANY WARRANTY; without even
10      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11      PURPOSE.  See the above copyright notice for more information.
12 
13 =========================================================================*/
14 /*=========================================================================
15 
16   Portions of this file are subject to the VTK Toolkit Version 3 copyright.
17 
18   Program:   Visualization Toolkit
19   Module:    $RCSfile: vtkLookupTable16.h,v $
20 
21   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
22   All rights reserved.
23   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
24 
25      This software is distributed WITHOUT ANY WARRANTY; without even
26      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
27      PURPOSE.  See the above copyright notice for more information.
28 
29 =========================================================================*/
30 // .NAME vtkLookupTable16 -
31 // .SECTION Description
32 //
33 // .SECTION Caveats
34 //
35 // .SECTION See Also
36 // vtkLookupTable
37 
38 #ifndef VTKLOOKUPTABLE16_H
39 #define VTKLOOKUPTABLE16_H
40 
41 #include "vtkLookupTable.h"
42 #include "vtkUnsignedShortArray.h"
43 
44 class VTK_EXPORT vtkLookupTable16 : public vtkLookupTable
45 {
46 public:
47   static vtkLookupTable16 *New();
48 
49   vtkTypeMacro(vtkLookupTable16,vtkLookupTable);
50   void PrintSelf(ostream& os, vtkIndent indent);
51 
52   void Build();
53 
54   void SetNumberOfTableValues(vtkIdType number);
55 
56   unsigned char *WritePointer(const vtkIdType id, const int number);
57 
GetPointer(const vtkIdType id)58   unsigned short *GetPointer(const vtkIdType id) {
59     return this->Table16->GetPointer(4*id); };
60 
61 protected:
62   vtkLookupTable16(int sze=256, int ext=256);
63   ~vtkLookupTable16();
64 
65   vtkUnsignedShortArray *Table16;
66 
67 void MapScalarsThroughTable2(void *input,
68                                              unsigned char *output,
69                                              int inputDataType,
70                                              int numberOfValues,
71                                              int inputIncrement,
72                                              int outputFormat);
73 
74 private:
75   vtkLookupTable16(const vtkLookupTable16&);  // Not implemented.
76   void operator=(const vtkLookupTable16&);  // Not implemented.
77 };
78 
79 //----------------------------------------------------------------------------
WritePointer(const vtkIdType id,const int number)80 inline unsigned char *vtkLookupTable16::WritePointer(const vtkIdType id,
81                                                    const int number)
82 {
83   //this->InsertTime.Modified();
84   return (unsigned char*)this->Table16->WritePointer(4*id,4*number);
85 }
86 
87 #endif
88