00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkGiplImageIO_h
00018 #define __itkGiplImageIO_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
00031 class GiplImageIOInternals;
00032
00033
00039 class ITK_EXPORT GiplImageIO : public ImageIOBase
00040 {
00041 public:
00043 typedef GiplImageIO Self;
00044 typedef ImageIOBase Superclass;
00045 typedef SmartPointer<Self> Pointer;
00046
00048 itkNewMacro(Self);
00049
00051 itkTypeMacro(GiplImageIO, Superclass);
00052
00053
00054
00057 virtual bool CanReadFile(const char*) ;
00058
00060 virtual void ReadImageInformation();
00061
00063 virtual void Read(void* buffer);
00064
00065
00066
00069 virtual bool CanWriteFile(const char*);
00070
00072 virtual void WriteImageInformation();
00073
00076 virtual void Write(const void* buffer);
00077
00078
00079 GiplImageIO();
00080 ~GiplImageIO();
00081 void PrintSelf(std::ostream& os, Indent indent) const;
00082
00083 private:
00084 GiplImageIO(const Self&);
00085 void operator=(const Self&);
00086
00087 void SwapBytesIfNecessary(void* buffer, unsigned long numberOfPixels);
00088 bool CheckExtension(const char*);
00089
00090 std::ifstream m_Ifstream;
00091 std::ofstream m_Ofstream;
00092 bool m_IsCompressed;
00093 GiplImageIOInternals * m_Internal;
00094 };
00095
00096 }
00097
00098 #endif // __itkGiplImageIO_h