VTK  9.7.20260805
vtkBMPReader.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
33
34#ifndef vtkBMPReader_h
35#define vtkBMPReader_h
36
37#include "vtkIOImageModule.h" // For export macro
38#include "vtkImageReader.h"
39VTK_ABI_NAMESPACE_BEGIN
40class vtkLookupTable;
41
42class VTKIOIMAGE_EXPORT vtkBMPReader : public vtkImageReader
43{
44public:
45 static vtkBMPReader* New();
47
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
51
54 vtkGetMacro(Depth, int);
56
58
63 int CanReadFile(VTK_FILEPATH const char* fname) override;
64 int CanReadFile(vtkResourceStream* stream) override;
66
72 const char* GetFileExtensions() override { return ".bmp"; }
73
77 const char* GetDescriptiveName() override { return "Windows BMP"; }
78
80
87 vtkBooleanMacro(Allow8BitBMP, vtkTypeBool);
89
90 vtkGetObjectMacro(LookupTable, vtkLookupTable);
91
93
96 vtkGetMacro(Colors, unsigned char*);
98
99protected:
101 ~vtkBMPReader() override;
102
103 unsigned char* Colors = nullptr;
104 short Depth = 0;
105 bool Validated = false;
108
109 void ComputeDataIncrements() override;
110 void ExecuteInformation() override;
112
113private:
114 vtkBMPReader(const vtkBMPReader&) = delete;
115 void operator=(const vtkBMPReader&) = delete;
116
117 bool ReadAndCheckHeader(
118 vtkResourceStream* stream, bool quiet, vtkTypeInt32& offset, vtkTypeInt32& infoSize) const;
119};
120VTK_ABI_NAMESPACE_END
121#endif
int CanReadFile(const char *fname) override
Return 1 if, after a quick check of file header, it looks like the provided file or stream can be rea...
const char * GetDescriptiveName() override
Return a descriptive name for the file format that might be useful in a GUI.
const char * GetFileExtensions() override
Get the file extensions for this format.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void ExecuteDataWithInformation(vtkDataObject *out, vtkInformation *outInfo) override
This is a convenience method that is implemented in many subclasses instead of RequestData.
void ExecuteInformation() override
~vtkBMPReader() override
void ComputeDataIncrements() override
int CanReadFile(vtkResourceStream *stream) override
Return 1 if, after a quick check of file header, it looks like the provided file or stream can be rea...
static vtkBMPReader * New()
vtkLookupTable * LookupTable
unsigned char * Colors
vtkTypeBool Allow8BitBMP
general representation of visualization data
a simple class to control print indentation
Definition vtkIndent.h:29
Store vtkAlgorithm input/output information.
map scalar values into colors via a lookup table
Abstract class used for custom streams.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_FILEPATH