Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtkTIFFReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkTIFFReader.h,v $
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00039 #ifndef __vtkTIFFReader_h
00040 #define __vtkTIFFReader_h
00041 
00042 #include "vtkImageReader2.h"
00043 
00044 //BTX
00045 class vtkTIFFReaderInternal;
00046 //ETX
00047 
00048 class VTK_IO_EXPORT vtkTIFFReader : public vtkImageReader2
00049 {
00050 public:
00051   static vtkTIFFReader *New();
00052   vtkTypeRevisionMacro(vtkTIFFReader,vtkImageReader2);
00053   virtual void PrintSelf(ostream& os, vtkIndent indent);
00054 
00056   virtual int CanReadFile(const char* fname);
00057 
00059 
00061   virtual const char* GetFileExtensions()
00062     {
00063     return ".tif .tiff";
00064     }
00066 
00068 
00070   virtual const char* GetDescriptiveName()
00071     {
00072     return "TIFF";
00073     }
00075 
00077   void InitializeColors();
00078 
00079 //BTX
00080   enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER };
00081 
00082   void ReadImageInternal( void *, void *outPtr,  
00083                           int *outExt, unsigned int size );
00084   
00085 
00087 
00088   vtkTIFFReaderInternal *GetInternalImage()
00089     { return this->InternalImage; }
00091 //ETX
00092 
00093 protected:
00094   vtkTIFFReader();
00095   ~vtkTIFFReader();
00096 
00097   void GetColor( int index, 
00098                  unsigned short *r, unsigned short *g, unsigned short *b );
00099   unsigned int  GetFormat();
00100   virtual void ExecuteInformation();
00101   virtual void ExecuteData(vtkDataObject *out);
00102 
00103   void ReadGenericImage( void *out, 
00104                          unsigned int width, unsigned int height,
00105                          unsigned int size );
00106   
00107   int EvaluateImageAt( void*, void* ); 
00108 
00109 private:
00110   vtkTIFFReader(const vtkTIFFReader&);  // Not implemented.
00111   void operator=(const vtkTIFFReader&);  // Not implemented.
00112 
00113   unsigned short *ColorRed;
00114   unsigned short *ColorGreen;
00115   unsigned short *ColorBlue;
00116   int TotalColors;
00117   unsigned int ImageFormat;
00118   vtkTIFFReaderInternal *InternalImage;
00119   int *InternalExtents;
00120 };
00121 #endif
00122 
00123