ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkWasmImageIO.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 itkWasmImageIO_h
19#define itkWasmImageIO_h
20#include "WebAssemblyInterfaceExport.h"
21
23#include <fstream>
24
25#include "itkImageJSON.h"
26
27namespace itk
28{
42class WebAssemblyInterface_EXPORT WasmImageIO : public StreamingImageIOBase
43{
44public:
49
51 itkNewMacro(Self);
52
54 itkOverrideGetNameOfClassMacro(WasmImageIO);
55
61 bool
62 SupportsDimension(unsigned long) override;
63
66 bool
67 CanReadFile(const char *) override;
68
70 void
72
74 void
75 Read(void * buffer) override;
76
77#if !defined(ITK_WRAPPING_PARSER)
79 void
80 SetJSON(const ImageJSON & json);
81#endif
82
85 bool
86 CanWriteFile(const char *) override;
87
89 void
91
92#if !defined(ITK_WRAPPING_PARSER)
94 auto
96#endif
97
100 void
101 Write(const void * buffer) override;
102
103protected:
105 ~WasmImageIO() override;
106 void
107 PrintSelf(std::ostream & os, Indent indent) const override;
108
110 GetHeaderSize() const override
111 {
112 return 0;
113 }
114
115 void
116 ReadCBOR(void * buffer = nullptr, unsigned char * cborBuffer = nullptr, size_t cborBufferLength = 0);
117 size_t
118 WriteCBOR(const void * buffer = nullptr, unsigned char ** cborBuffer = nullptr, bool allocateCBORBuffer = false);
119
120private:
121 ITK_DISALLOW_COPY_AND_MOVE(WasmImageIO);
122};
123} // end namespace itk
124
125#endif // itkWasmImageIO_h
itk::intmax_t SizeType
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
void PrintSelf(std::ostream &os, Indent indent) const override
vcl_size_t WriteCBOR(const void *buffer=nullptr, unsigned char **cborBuffer=nullptr, bool allocateCBORBuffer=false)
bool CanWriteFile(const char *) override
~WasmImageIO() override
void Write(const void *buffer) override
Superclass::SizeType GetHeaderSize() const override
Returns the size of the header in the file.
void WriteImageInformation() override
auto GetJSON() -> ImageJSON
void ReadImageInformation() override
bool CanReadFile(const char *) override
void SetJSON(const ImageJSON &json)
StreamingImageIOBase Superclass
bool SupportsDimension(unsigned long) override
void Read(void *buffer) override
void ReadCBOR(void *buffer=nullptr, unsigned char *cborBuffer=nullptr, vcl_size_t cborBufferLength=0)
SmartPointer< Self > Pointer
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
Image JSON representation data structure.