ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkPNGImageIO.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkPNGImageIO_h
00019 #define __itkPNGImageIO_h
00020 
00021 
00022 #include "itkImageIOBase.h"
00023 
00024 namespace itk
00025 {
00034 class ITK_EXPORT PNGImageIO:public ImageIOBase
00035 {
00036 public:
00038   typedef PNGImageIO           Self;
00039   typedef ImageIOBase          Superclass;
00040   typedef SmartPointer< Self > Pointer;
00041 
00043   itkNewMacro(Self);
00044 
00046   itkTypeMacro(PNGImageIO, ImageIOBase);
00047 
00050   itkSetMacro(CompressionLevel, int);
00051   itkGetConstMacro(CompressionLevel, int);
00053 
00054   /*-------- This part of the interface deals with reading data. ------ */
00055 
00058   virtual bool CanReadFile(const char *);
00059 
00061   virtual void ReadImageInformation();
00062 
00064   virtual void Read(void *buffer);
00065 
00067   virtual void ReadVolume(void *buffer);
00068 
00069   /*-------- This part of the interfaces deals with writing data. ----- */
00070 
00073   virtual bool CanWriteFile(const char *);
00074 
00077   virtual void WriteImageInformation();
00078 
00081   virtual void Write(const void *buffer);
00082 
00083 protected:
00084   PNGImageIO();
00085   ~PNGImageIO();
00086   void PrintSelf(std::ostream & os, Indent indent) const;
00087 
00088   void WriteSlice(const std::string & fileName, const void *buffer);
00089 
00092   int m_CompressionLevel;
00093 private:
00094   PNGImageIO(const Self &);     //purposely not implemented
00095   void operator=(const Self &); //purposely not implemented
00096 };
00097 } // end namespace itk
00099 
00100 #endif // __itkPNGImageIO_h
00101