ITK  6.0.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 * https://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
25namespace itk
26{
39class ITKIOJPEG_EXPORT JPEGImageIO : public ImageIOBase
40{
41public:
42 ITK_DISALLOW_COPY_AND_MOVE(JPEGImageIO);
43
48
50 itkNewMacro(Self);
51
53 itkOverrideGetNameOfClassMacro(JPEGImageIO);
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 }
69 itkSetMacro(Progressive, bool);
70 itkGetConstMacro(Progressive, bool);
71 itkBooleanMacro(Progressive);
75 itkSetMacro(CMYKtoRGB, bool);
76 itkGetConstMacro(CMYKtoRGB, bool);
77 itkBooleanMacro(CMYKtoRGB);
80 /*-------- This part of the interface deals with reading data. ------ */
81
84 bool
85 CanReadFile(const char *) override;
86
88 void
90
92 void
93 Read(void * buffer) override;
94
96 virtual void
97 ReadVolume(void * buffer);
98
99 /*-------- This part of the interfaces deals with writing data. ----- */
100
103 bool
104 CanWriteFile(const char *) override;
105
108 void
110
113 void
114 Write(const void * buffer) override;
115
116protected:
118 ~JPEGImageIO() override;
119 void
120 PrintSelf(std::ostream & os, Indent indent) const override;
121
122 void
123 WriteSlice(const std::string & fileName, const void * const buffer);
124
125 bool m_Progressive{ true };
126
127 bool m_CMYKtoRGB{ true };
128
129 bool m_IsCMYK{ false };
130};
131} // end namespace itk
132
133#endif // itkJPEGImageIO_h
Abstract superclass defines image IO interface.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
ImageIO object for reading and writing JPEG images.
void PrintSelf(std::ostream &os, Indent indent) const override
virtual int GetQuality() const
virtual void ReadVolume(void *buffer)
bool CanWriteFile(const char *) override
void ReadImageInformation() override
bool CanReadFile(const char *) override
void Write(const void *buffer) override
void WriteImageInformation() override
virtual void SetQuality(int _JPEGQuality)
void WriteSlice(const std::string &fileName, const void *const buffer)
~JPEGImageIO() override
void Read(void *buffer) override
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....