ITK  6.0.0
Insight Toolkit
itkJPEG2000ImageIO.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 itkJPEG2000ImageIO_h
19#define itkJPEG2000ImageIO_h
20
21
22#include <fstream>
23#include "ITKIOJPEG2000Export.h"
25#include "memory"
26
27
28namespace itk
29{
30
31class JPEG2000ImageIOInternal;
32class JPEG2000ImageIOInternalEnums;
38{
39public:
44 enum class DecodingFormat : uint8_t
45 {
46 J2K_CFMT = 0,
47 JP2_CFMT = 1,
48 JPT_CFMT = 2,
49 MJ2_CFMT = 3
50 };
51
57 enum class DecodingFormat : uint8_t
58 {
59 J2K_CFMT = 0,
60 JP2_CFMT = 1,
61 JPT_CFMT = 2,
62 MJ2_CFMT = 3
63 };
64 * \ingroup ITKIOJPEG2000
65 * */
66 enum class DFMFormat : uint8_t
67 {
68 PXM_DFMT = 0,
69 PGX_DFMT = 1,
70 BMP_DFMT = 2,
71 YUV_DFMT = 3
72 };
73};
74// Define how to print enumeration
75extern ITKIOJPEG2000_EXPORT std::ostream &
76 operator<<(std::ostream & out, const JPEG2000ImageIOInternalEnums::DecodingFormat value);
77extern ITKIOJPEG2000_EXPORT std::ostream &
78 operator<<(std::ostream & out, const JPEG2000ImageIOInternalEnums::DFMFormat value);
99class ITKIOJPEG2000_EXPORT JPEG2000ImageIO : public StreamingImageIOBase
100{
101public:
103
108
111
114
115 /*-------- This part of the interfaces deals with reading data. ----- */
116
119 bool
120 CanReadFile(const char *) override;
121
123 void
125
127 void
128 Read(void * buffer) override;
129
130 /*-------- This part of the interfaces deals with writing data. ----- */
131
134 bool
135 CanWriteFile(const char *) override;
136
138 void
140
143 void
144 Write(const void * buffer) override;
145
151 GenerateStreamableReadRegionFromRequestedRegion(const ImageIORegion & requestedRegion) const override;
152
155 GetHeaderSize() const override;
156
158 void
159 SetTileSize(int x, int y);
160
166 bool
167 CanStreamWrite() override;
168
169protected:
172
173 void
174 PrintSelf(std::ostream & os, Indent indent) const override;
175
176private:
177 std::unique_ptr<JPEG2000ImageIOInternal> m_Internal;
178
181
182 void
183 ComputeRegionInTileBoundaries(unsigned int dimension, SizeValueType tileSize, ImageIORegion & streamableRegion) const;
184};
185} // end namespace itk
186
187#endif // itkJPEG2000ImageIO_h
itk::intmax_t SizeType
itk::SizeValueType SizeValueType
itk::IndexValueType IndexValueType
An ImageIORegion represents a structured region of data.
itk::SizeValueType SizeValueType
itk::IndexValueType IndexValueType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
This class contains all enum classes used by JPEG2000ImageIOInternal class.
Supports for the JPEG2000 file format based on openjpeg.
void WriteImageInformation() override
ITK_DISALLOW_COPY_AND_MOVE(JPEG2000ImageIO)
void SetTileSize(int x, int y)
void ComputeRegionInTileBoundaries(unsigned int dimension, SizeValueType tileSize, ImageIORegion &streamableRegion) const
~JPEG2000ImageIO() override
void Write(const void *buffer) override
bool CanStreamWrite() override
bool CanWriteFile(const char *) override
void Read(void *buffer) override
void PrintSelf(std::ostream &os, Indent indent) const override
bool CanReadFile(const char *) override
std::unique_ptr< JPEG2000ImageIOInternal > m_Internal
SizeType GetHeaderSize() const override
itkOverrideGetNameOfClassMacro(JPEG2000ImageIO)
void ReadImageInformation() override
ImageIORegion GenerateStreamableReadRegionFromRequestedRegion(const ImageIORegion &requestedRegion) const override
Light weight base class for most itk classes.
Base class for most ITK classes.
Definition: itkObject.h:62
A base class for specific ImageIO file formats which support streaming.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)