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: 2005/09/28 15:41:54 $
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 
00038 class ITK_EXPORT BMPImageIO : public ImageIOBase
00039 {
00040 public:
00042   typedef BMPImageIO            Self;
00043   typedef ImageIOBase  Superclass;
00044   typedef SmartPointer<Self>  Pointer;
00045   
00047   itkNewMacro(Self);
00048 
00050   itkTypeMacro(BMPImageIO, Superclass);
00051 
00052   /*-------- This part of the interfaces deals with reading data. ----- */
00053 
00056   virtual bool CanReadFile(const char*) ;
00057 
00059   virtual void ReadImageInformation();
00060   
00062   virtual void Read(void* buffer);
00063 
00064   /*-------- This part of the interfaces deals with writing data. ----- */
00065 
00068   virtual bool CanWriteFile(const char*);
00069 
00071   virtual void WriteImageInformation();
00072   
00075   virtual void Write(const void* buffer);
00076 
00077 
00078   BMPImageIO();
00079   ~BMPImageIO();
00080   void PrintSelf(std::ostream& os, Indent indent) const;
00081   
00082 private:
00083   BMPImageIO(const Self&); //purposely not implemented
00084   void operator=(const Self&); //purposely not implemented
00085 
00086   void SwapBytesIfNecessary(void* buffer, unsigned long numberOfPixels);
00087  
00088   std::ifstream   m_Ifstream;
00089   std::ofstream   m_Ofstream;
00090   long            m_BitMapOffset;
00091   bool            m_FileLowerLeft;
00092   short           m_Depth;
00093   bool            m_Allow8BitBMP;
00094 };
00095 
00096 } // end namespace itk
00097 
00098 #endif // __itkBMPImageIO_h

Generated at Wed May 24 22:52:28 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000