ITK  4.13.0
Insight Segmentation and Registration Toolkit
itkJPEGImageIO.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 itkJPEGImageIO_h
19 #define itkJPEGImageIO_h
20 #include "ITKIOJPEGExport.h"
21 
22 
23 #include "itkImageIOBase.h"
24 
25 namespace itk
26 {
35 class ITKIOJPEG_EXPORT JPEGImageIO:public ImageIOBase
36 {
37 public:
39  typedef JPEGImageIO Self;
42 
44  itkNewMacro(Self);
45 
47  itkTypeMacro(JPEGImageIO, ImageIOBase);
48 
50  itkSetMacro(Quality, int);
51  itkGetConstMacro(Quality, int);
53 
55  itkSetMacro(Progressive, bool);
56  itkGetConstMacro(Progressive, bool);
58 
59  /*-------- This part of the interface deals with reading data. ------ */
60 
63  virtual bool CanReadFile(const char *) ITK_OVERRIDE;
64 
66  virtual void ReadImageInformation() ITK_OVERRIDE;
67 
69  virtual void Read(void *buffer) ITK_OVERRIDE;
70 
72  virtual void ReadVolume(void *buffer);
73 
74  /*-------- This part of the interfaces deals with writing data. ----- */
75 
78  virtual bool CanWriteFile(const char *) ITK_OVERRIDE;
79 
82  virtual void WriteImageInformation() ITK_OVERRIDE;
83 
86  virtual void Write(const void *buffer) ITK_OVERRIDE;
87 
88 protected:
89  JPEGImageIO();
90  ~JPEGImageIO() ITK_OVERRIDE;
91  virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE;
92 
93  void WriteSlice(std::string & fileName, const void *buffer);
94 
97  int m_Quality;
98 
100  bool m_Progressive;
101 
102 private:
103  ITK_DISALLOW_COPY_AND_ASSIGN(JPEGImageIO);
104 };
105 } // end namespace itk
106 
107 #endif // itkJPEGImageIO_h
ImageIO object for reading and writing JPEG images.
Light weight base class for most itk classes.
Abstract superclass defines image IO interface.
JPEGImageIO Self
SmartPointer< Self > Pointer
ImageIOBase Superclass
Control indentation during Print() invocation.
Definition: itkIndent.h:49