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
00041 class ITK_EXPORT GiplImageIO : public ImageIOBase
00042 {
00043 public:
00045 typedef GiplImageIO Self;
00046 typedef ImageIOBase Superclass;
00047 typedef SmartPointer<Self> Pointer;
00048
00050 itkNewMacro(Self);
00051
00053 itkTypeMacro(GiplImageIO, Superclass);
00054
00055
00056
00059 virtual bool CanReadFile(const char*) ;
00060
00062 virtual void ReadImageInformation();
00063
00065 virtual void Read(void* buffer);
00066
00067
00068
00071 virtual bool CanWriteFile(const char*);
00072
00074 virtual void WriteImageInformation();
00075
00078 virtual void Write(const void* buffer);
00079
00080
00081 GiplImageIO();
00082 ~GiplImageIO();
00083 void PrintSelf(std::ostream& os, Indent indent) const;
00084
00085 private:
00086 GiplImageIO(const Self&);
00087 void operator=(const Self&);
00088
00089 void SwapBytesIfNecessary(void* buffer, unsigned long numberOfPixels);
00090 bool CheckExtension(const char*);
00091
00092 std::ifstream m_Ifstream;
00093 std::ofstream m_Ofstream;
00094 bool m_IsCompressed;
00095 GiplImageIOInternals * m_Internal;
00096 };
00097
00098 }
00099
00100 #endif // __itkGiplImageIO_h
00101