Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkBMPImageIO.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkBMPImageIO.h,v $
00005   Language:  C++
00006   Date:      $Date: 2004/05/14 15:12:37 $
00007   Version:   $1.0$
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012      This software is distributed WITHOUT ANY WARRANTY; without even 
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 #ifndef __itkBMPImageIO_h
00018 #define __itkBMPImageIO_h
00019 
00020 #ifdef _MSC_VER
00021 #pragma warning ( disable : 4786 )
00022 #endif
00023 
00024 #include <fstream>
00025 #include "itkImageIOBase.h"
00026 #include <stdio.h>
00027 
00028 namespace itk
00029 {
00030 
00036 class ITK_EXPORT BMPImageIO : public ImageIOBase
00037 {
00038 public:
00040   typedef BMPImageIO            Self;
00041   typedef ImageIOBase  Superclass;
00042   typedef SmartPointer<Self>  Pointer;
00043   
00045   itkNewMacro(Self);
00046 
00048   itkTypeMacro(BMPImageIO, Superclass);
00049 
00050   /*-------- This part of the interfaces deals with reading data. ----- */
00051 
00054   virtual bool CanReadFile(const char*) ;
00055 
00057   virtual void ReadImageInformation();
00058   
00060   virtual void Read(void* buffer);
00061 
00062   /*-------- This part of the interfaces deals with writing data. ----- */
00063 
00066   virtual bool CanWriteFile(const char*);
00067 
00069   virtual void WriteImageInformation();
00070   
00073   virtual void Write(const void* buffer);
00074 
00075 
00076   BMPImageIO();
00077   ~BMPImageIO();
00078   void PrintSelf(std::ostream& os, Indent indent) const;
00079   
00080 private:
00081   BMPImageIO(const Self&); //purposely not implemented
00082   void operator=(const Self&); //purposely not implemented
00083 
00084   void SwapBytesIfNecessary(void* buffer, unsigned long numberOfPixels);
00085  
00086   std::ifstream   m_Ifstream;
00087   std::ofstream   m_Ofstream;
00088   long            m_BitMapOffset;
00089   bool            m_FileLowerLeft;
00090   short           m_Depth;
00091   bool            m_Allow8BitBMP;
00092 };
00093 
00094 } // end namespace itk
00095 
00096 #endif // __itkBMPImageIO_h

Generated at Tue Mar 29 23:47:41 2005 for ITK by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2000