1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkBMPReader.h,v $
6 Date: $Date: 2002/11/25 11:14:50 $
7 Version: $Revision: 1.28 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
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.
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.
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
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).
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).
41 #ifndef __vtkBMPReader_h
42 #define __vtkBMPReader_h
44 #include "vtkImageReader.h"
47 class VTK_IO_EXPORT vtkBMPReader : public vtkImageReader
50 static vtkBMPReader *New();
51 vtkTypeRevisionMacro(vtkBMPReader,vtkImageReader);
53 void PrintSelf(ostream& os, vtkIndent indent);
56 // Returns the depth of the BMP, either 8 or 24.
57 vtkGetMacro(Depth,int);
59 // Description: is the given file name a BMP file?
60 virtual int CanReadFile(const char* fname);
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()
71 // Return a descriptive name for the file format that might be useful in a GUI.
72 virtual const char* GetDescriptiveName()
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
81 vtkSetMacro(Allow8BitBMP,int);
82 vtkGetMacro(Allow8BitBMP,int);
83 vtkBooleanMacro(Allow8BitBMP,int);
85 vtkLookupTable *GetLookupTable(void);
89 // Returns the color lut.
90 vtkGetMacro(Colors,unsigned char *);
97 unsigned char *Colors;
100 vtkLookupTable *LookupTable;
102 virtual void ComputeDataIncrements();
103 virtual void ExecuteInformation();
104 virtual void ExecuteData(vtkDataObject *out);
106 vtkBMPReader(const vtkBMPReader&); // Not implemented.
107 void operator=(const vtkBMPReader&); // Not implemented.