ITK  5.0.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:
38  ITK_DISALLOW_COPY_AND_ASSIGN(JPEGImageIO);
39 
41  using Self = JPEGImageIO;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(JPEGImageIO, ImageIOBase);
50 
52  itkSetMacro(Quality, int);
53  itkGetConstMacro(Quality, int);
55 
57  itkSetMacro(Progressive, bool);
58  itkGetConstMacro(Progressive, bool);
60 
61  /*-------- This part of the interface deals with reading data. ------ */
62 
65  bool CanReadFile(const char *) override;
66 
68  void ReadImageInformation() override;
69 
71  void Read(void *buffer) override;
72 
74  virtual void ReadVolume(void *buffer);
75 
76  /*-------- This part of the interfaces deals with writing data. ----- */
77 
80  bool CanWriteFile(const char *) override;
81 
84  void WriteImageInformation() override;
85 
88  void Write(const void *buffer) override;
89 
90 protected:
91  JPEGImageIO();
92  ~JPEGImageIO() override;
93  void PrintSelf(std::ostream & os, Indent indent) const override;
94 
95  void WriteSlice(std::string & fileName, const void *buffer);
96 
99  int m_Quality;
100 
103 };
104 } // end namespace itk
105 
106 #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.
Control indentation during Print() invocation.
Definition: itkIndent.h:49
Base class for most ITK classes.
Definition: itkObject.h:60