ITK  4.9.0
Insight Segmentation and Registration Toolkit
itkPNGImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef itkPNGImageIO_h
19 #define itkPNGImageIO_h
20 #include "ITKIOPNGExport.h"
21 
22 
23 #include "itkImageIOBase.h"
24 
25 namespace itk
26 {
35 class ITKIOPNG_EXPORT PNGImageIO:public ImageIOBase
36 {
37 public:
39  typedef PNGImageIO Self;
42 
44  itkNewMacro(Self);
45 
47  itkTypeMacro(PNGImageIO, ImageIOBase);
48 
51  itkSetMacro(CompressionLevel, int);
52  itkGetConstMacro(CompressionLevel, int);
54 
55  /*-------- This part of the interface deals with reading data. ------ */
56 
59  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
60 
62  virtual void ReadImageInformation() ITK_OVERRIDE;
63 
65  virtual void Read(void *buffer) ITK_OVERRIDE;
66 
68  virtual void ReadVolume(void *buffer);
69 
70  /*-------- This part of the interfaces deals with writing data. ----- */
71 
74  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
75 
78  virtual void WriteImageInformation() ITK_OVERRIDE;
79 
82  virtual void Write(const void *buffer) ITK_OVERRIDE;
83 
84 protected:
85  PNGImageIO();
86  ~PNGImageIO();
87  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
88 
89  void WriteSlice(const std::string & fileName, const void *buffer);
90 
93  int m_CompressionLevel;
94 
95 private:
96  PNGImageIO(const Self &) ITK_DELETE_FUNCTION;
97  void operator=(const Self &) ITK_DELETE_FUNCTION;
98 };
99 } // end namespace itk
100 
101 #endif // itkPNGImageIO_h
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
SmartPointer< Self > Pointer
Definition: itkPNGImageIO.h:41
ImageIO object for reading and writing PNG images.
Definition: itkPNGImageIO.h:35
PNGImageIO Self
Definition: itkPNGImageIO.h:39
Control indentation during Print() invocation.
Definition: itkIndent.h:49
ImageIOBase Superclass
Definition: itkPNGImageIO.h:40