dox/IO/vtkExtTIFFReader.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkExtTIFFReader.h,v $
00005   Language:  C++
00006 
00007 
00008 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen 
00009 Copyright (c) 2005 Kalle Pahajoki. Modifications for raw mode support
00010 All rights reserved.
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided that the following conditions are met:
00014 
00015  * Redistributions of source code must retain the above copyright notice,
00016    this list of conditions and the following disclaimer.
00017 
00018  * Redistributions in binary form must reproduce the above copyright notice,
00019    this list of conditions and the following disclaimer in the documentation
00020    and/or other materials provided with the distribution.
00021 
00022  * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
00023    of any contributors may be used to endorse or promote products derived
00024    from this software without specific prior written permission.
00025 
00026  * Modified source versions must be plainly marked as such, and must not be
00027    misrepresented as being the original software.
00028 
00029 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00030 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00031 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00032 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00033 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00034 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00035 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00036 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00037 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00038 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00039 
00040 =========================================================================*/
00054 #ifndef __vtkExtTIFFReader_h
00055 #define __vtkExtTIFFReader_h
00056 
00057 #include "vtkImageReader2.h"
00058 
00059 //BTX
00060 class vtkExtTIFFReaderInternal;
00061 //ETX
00062 
00063 class VTK_IO_EXPORT vtkExtTIFFReader : public vtkImageReader2
00064 {
00065 public:
00066   static vtkExtTIFFReader *New();
00067   vtkTypeRevisionMacro(vtkExtTIFFReader,vtkImageReader2);
00068   virtual void PrintSelf(ostream& os, vtkIndent indent);
00069 
00071   virtual int CanReadFile(const char* fname);
00072 
00074 
00076   virtual const char* GetFileExtensions()
00077     {
00078     return ".tif .tiff";
00079     }
00081 
00083 
00085   virtual const char* GetDescriptiveName()
00086     {
00087     return "TIFF";
00088     }
00090 
00092   void InitializeColors();
00093  
00094   vtkSetMacro(RawMode,int);
00095   vtkGetMacro(RawMode,int);
00096   vtkBooleanMacro(RawMode,int);
00097      
00098      
00099 //BTX
00100   enum { NOFORMAT, RGB, GRAYSCALE, PALETTE_RGB, PALETTE_GRAYSCALE, OTHER, RAW };
00101 
00102 
00103 
00104   void ReadImageInternal( void *, void *outPtr,  
00105                           int *outExt, unsigned int size );
00106   
00107 
00109 
00110   vtkExtTIFFReaderInternal *GetInternalImage()
00111     { return this->InternalImage; }
00113 //ETX
00114 
00115 protected:
00116   vtkExtTIFFReader();
00117   ~vtkExtTIFFReader();
00118 
00119   void GetColor( int index, 
00120                  unsigned short *r, unsigned short *g, unsigned short *b );
00121   unsigned int  GetFormat();
00122   virtual void ExecuteInformation();
00123   virtual void ExecuteData(vtkDataObject *out);
00124 
00125   void ReadGenericImage( void *out, 
00126                          unsigned int width, unsigned int height,
00127                          unsigned int size );
00128   
00129   int EvaluateImageAt( void*, void* ); 
00130 
00131 private:
00132   vtkExtTIFFReader(const vtkExtTIFFReader&);  // Not implemented.
00133   void operator=(const vtkExtTIFFReader&);  // Not implemented.
00134 
00135   unsigned short *ColorRed;
00136   unsigned short *ColorGreen;
00137   unsigned short *ColorBlue;
00138   int TotalColors;
00139   unsigned int ImageFormat;
00140   vtkExtTIFFReaderInternal *InternalImage;
00141   int *InternalExtents;
00142   int RawMode;
00143 };
00144 #endif
00145 
00146 

Generated on Sat Dec 30 06:06:59 2006 for VTK by  doxygen 1.5.1