OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I386LINUX / util / I386LINUX / include / vtk / vtkBMPReader.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkBMPReader.h,v $
5   Language:  C++
6   Date:      $Date: 2002/11/25 11:14:50 $
7   Version:   $Revision: 1.28 $
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 vtkBMPReader - read Windows BMP files
19 // .SECTION Description
20 // vtkBMPReader is a source object that reads Windows BMP files.
21 // This includes indexed and 24bit bitmaps
22 // Usually, all BMPs are converted to 24bit RGB, but BMPs may be output
23 // as 8bit images with a LookupTable if the Allow8BitBMP flag is set.
24 //
25 // BMPReader creates structured point datasets. The dimension of the 
26 // dataset depends upon the number of files read. Reading a single file 
27 // results in a 2D image, while reading more than one file results in a 
28 // 3D volume.
29 //
30 // To read a volume, files must be of the form "FileName.<number>"
31 // (e.g., foo.bmp.0, foo.bmp.1, ...). You must also specify the image 
32 // range. This range specifies the beginning and ending files to read (range
33 // can be any pair of non-negative numbers). 
34 //
35 // The default behavior is to read a single file. In this case, the form
36 // of the file is simply "FileName" (e.g., foo.bmp).
37
38 // .SECTION See Also
39 // vtkBMPWriter
40
41 #ifndef __vtkBMPReader_h
42 #define __vtkBMPReader_h
43
44 #include "vtkImageReader.h"
45 class vtkLookupTable;
46
47 class VTK_IO_EXPORT vtkBMPReader : public vtkImageReader
48 {
49 public:
50   static vtkBMPReader *New();
51   vtkTypeRevisionMacro(vtkBMPReader,vtkImageReader);
52
53   void PrintSelf(ostream& os, vtkIndent indent);
54
55   // Description:
56   // Returns the depth of the BMP, either 8 or 24.
57   vtkGetMacro(Depth,int);
58   
59   // Description: is the given file name a BMP file?
60   virtual int CanReadFile(const char* fname);
61   // Description:
62   // Get the file extensions for this format.
63   // Returns a string with a space separated list of extensions in 
64   // the format .extension
65   virtual const char* GetFileExensions()
66     {
67       return ".bmp";
68     }
69
70   // Description: 
71   // Return a descriptive name for the file format that might be useful in a GUI.
72   virtual const char* GetDescriptiveName()
73     {
74       return "Windows BMP";
75     }
76   
77   // Description:
78   // If this flag is set and the BMP reader encounters an 8bit file,
79   // the data will be kept as unsigned chars and a lookuptable will be
80   // exported
81   vtkSetMacro(Allow8BitBMP,int);
82   vtkGetMacro(Allow8BitBMP,int);
83   vtkBooleanMacro(Allow8BitBMP,int);
84
85   vtkLookupTable *GetLookupTable(void);
86
87 //BTX
88   // Description:
89   // Returns the color lut.
90   vtkGetMacro(Colors,unsigned char *);
91 //ETX
92
93 protected:
94   vtkBMPReader();
95   ~vtkBMPReader();
96
97   unsigned char *Colors;
98   short Depth;
99   int Allow8BitBMP;
100   vtkLookupTable *LookupTable;
101   
102   virtual void ComputeDataIncrements();
103   virtual void ExecuteInformation();
104   virtual void ExecuteData(vtkDataObject *out);
105 private:
106   vtkBMPReader(const vtkBMPReader&);  // Not implemented.
107   void operator=(const vtkBMPReader&);  // Not implemented.
108 };
109 #endif
110
111