00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00028 #ifndef __vtkTIFFReader_h
00029 #define __vtkTIFFReader_h
00030
00031 #include "vtkImageReader2.h"
00032
00033
00034 class vtkTIFFReaderInternal;
00035
00036
00037 class VTK_IO_EXPORT vtkTIFFReader : public vtkImageReader2
00038 {
00039 public:
00040 static vtkTIFFReader *New();
00041 vtkTypeRevisionMacro(vtkTIFFReader,vtkImageReader2);
00042 virtual void PrintSelf(ostream& os, vtkIndent indent);
00043
00045 virtual int CanReadFile(const char* fname);
00046
00048
00050 virtual const char* GetFileExtensions()
00051 {
00052 return ".tif .tiff";
00053 }
00055
00057
00059 virtual const char* GetDescriptiveName()
00060 {
00061 return "TIFF";
00062 }
00064
00066 void InitializeColors();
00067
00068
00069 enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
00070
00071 void ReadImageInternal( void *, void *outPtr,
00072 int *outExt, unsigned int size );
00073
00075 vtkTIFFReaderInternal *GetInternalImage() { return this->InternalImage; }
00076
00077 int EvaluateImageAt( void*, void* );
00078
00079
00080 protected:
00081 vtkTIFFReader();
00082 ~vtkTIFFReader();
00083
00084 void GetColor( int index,
00085 unsigned short *r, unsigned short *g, unsigned short *b );
00086 unsigned int GetFormat();
00087 virtual void ExecuteInformation();
00088 virtual void ExecuteData(vtkDataObject *out);
00089
00090 private:
00091 vtkTIFFReader(const vtkTIFFReader&);
00092 void operator=(const vtkTIFFReader&);
00093
00094 unsigned short *ColorRed;
00095 unsigned short *ColorGreen;
00096 unsigned short *ColorBlue;
00097 int TotalColors;
00098 unsigned int ImageFormat;
00099 vtkTIFFReaderInternal *InternalImage;
00100 int *InternalExtents;
00101 };
00102 #endif
00103
00104