ITK  5.3.0
Insight Toolkit
itkJPEGImageIO.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright NumFOCUS
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 {
39 class ITKIOJPEG_EXPORT JPEGImageIO : public ImageIOBase
40 {
41 public:
42  ITK_DISALLOW_COPY_AND_MOVE(JPEGImageIO);
43 
45  using Self = JPEGImageIO;
48 
50  itkNewMacro(Self);
51 
53  itkTypeMacro(JPEGImageIO, ImageIOBase);
54 
56  virtual void
57  SetQuality(int _JPEGQuality)
58  {
59  this->SetCompressionLevel(_JPEGQuality);
60  }
61  virtual int
62  GetQuality() const
63  {
64  return this->GetCompressionLevel();
65  }
67 
69  itkSetMacro(Progressive, bool);
70  itkGetConstMacro(Progressive, bool);
72 
73  /*-------- This part of the interface deals with reading data. ------ */
74 
77  bool
78  CanReadFile(const char *) override;
79 
81  void
82  ReadImageInformation() override;
83 
85  void
86  Read(void * buffer) override;
87 
89  virtual void
90  ReadVolume(void * buffer);
91 
92  /*-------- This part of the interfaces deals with writing data. ----- */
93 
96  bool
97  CanWriteFile(const char *) override;
98 
101  void
102  WriteImageInformation() override;
103 
106  void
107  Write(const void * buffer) override;
108 
109 protected:
110  JPEGImageIO();
111  ~JPEGImageIO() override;
112  void
113  PrintSelf(std::ostream & os, Indent indent) const override;
114 
115  void
116  WriteSlice(std::string & fileName, const void * buffer);
117 
120 };
121 } // end namespace itk
122 
123 #endif // itkJPEGImageIO_h
itk::ImageIOBase
Abstract superclass defines image IO interface.
Definition: itkImageIOBase.h:77
itk::JPEGImageIO
ImageIO object for reading and writing JPEG images.
Definition: itkJPEGImageIO.h:39
itk::SmartPointer< Self >
itk::Indent
Control indentation during Print() invocation.
Definition: itkIndent.h:49
itk::JPEGImageIO::GetQuality
virtual int GetQuality() const
Definition: itkJPEGImageIO.h:62
itk::LightObject
Light weight base class for most itk classes.
Definition: itkLightObject.h:59
itk::JPEGImageIO::SetQuality
virtual void SetQuality(int _JPEGQuality)
Definition: itkJPEGImageIO.h:57
itkImageIOBase.h
itk
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Definition: itkAnnulusOperator.h:24
itk::Object
Base class for most ITK classes.
Definition: itkObject.h:62
itk::JPEGImageIO::m_Progressive
bool m_Progressive
Definition: itkJPEGImageIO.h:119
fileName
std::string fileName
Definition: itkTestDriverInclude.h:118