ITK  6.0.0
Insight Toolkit
itkGiplImageIO.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 itkGiplImageIO_h
19#define itkGiplImageIO_h
20#include "ITKIOGIPLExport.h"
21
22
23#include <fstream>
24#include "itkImageIOBase.h"
25#include <cstdio>
26#include <memory> // For unique_ptr.
27
28namespace itk
29{
30class GiplImageIOInternals;
31
41class ITKIOGIPL_EXPORT GiplImageIO : public ImageIOBase
42{
43public:
44 ITK_DISALLOW_COPY_AND_MOVE(GiplImageIO);
45
50
52 itkNewMacro(Self);
53
55 itkOverrideGetNameOfClassMacro(GiplImageIO);
56
57 /*-------- This part of the interfaces deals with reading data. ----- */
58
61 bool
62 CanReadFile(const char *) override;
63
65 void
67
69 void
70 Read(void * buffer) override;
71
72 /*-------- This part of the interfaces deals with writing data. ----- */
73
76 bool
77 CanWriteFile(const char *) override;
78
80 void
82
85 void
86 Write(const void * buffer) override;
87
89 ~GiplImageIO() override;
90 void
91 PrintSelf(std::ostream & os, Indent indent) const override;
92
93private:
94 void
95 SwapBytesIfNecessary(void * buffer, SizeValueType numberOfPixels);
96
97 bool
98 CheckExtension(const char *);
99
100 std::ifstream m_Ifstream{};
101 std::ofstream m_Ofstream{};
102 bool m_IsCompressed{};
103
104 const std::unique_ptr<GiplImageIOInternals> m_Internal;
105};
106} // end namespace itk
107
108#endif // itkGiplImageIO_h
Read GIPL (Guy's Image Processing Lab) file format.
bool CheckExtension(const char *)
void PrintSelf(std::ostream &os, Indent indent) const override
void Write(const void *buffer) override
bool CanWriteFile(const char *) override
bool CanReadFile(const char *) override
void SwapBytesIfNecessary(void *buffer, SizeValueType numberOfPixels)
void WriteImageInformation() override
void Read(void *buffer) override
const std::unique_ptr< GiplImageIOInternals > m_Internal
~GiplImageIO() override
void ReadImageInformation() override
Abstract superclass defines image IO interface.
itk::SizeValueType SizeValueType
Control indentation during Print() invocation.
Definition: itkIndent.h:50
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....