VTK-m  2.0
ImageWriterHDF5.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_io_ImageWriterHDF5_H
11 #define vtk_m_io_ImageWriterHDF5_H
12 
14 
15 namespace vtkm
16 {
17 namespace io
18 {
19 
25 class VTKM_IO_EXPORT ImageWriterHDF5 : public vtkm::io::ImageWriterBase
26 {
28 
29 public:
30  using Superclass::Superclass;
31  VTKM_CONT ~ImageWriterHDF5() noexcept override;
32  ImageWriterHDF5(const ImageWriterHDF5&) = delete;
33  ImageWriterHDF5& operator=(const ImageWriterHDF5&) = delete;
34 
35  VTKM_CONT void WriteDataSet(const vtkm::cont::DataSet& dataSet,
36  const std::string& colorField = {});
37 
38 protected:
39  VTKM_CONT void Write(vtkm::Id width, vtkm::Id height, const ColorArrayType& pixels) override;
40 
41 private:
42  template <typename PixelType>
43  VTKM_CONT int WriteToFile(vtkm::Id width, vtkm::Id height, const ColorArrayType& pixels);
44 
45  std::int64_t fileid = 0;
46  // FIXME: a hack for the moment, design a better API.
47  std::string fieldName;
48 
49  static constexpr auto IMAGE_CLASS = "IMAGE";
50  static constexpr auto IMAGE_VERSION = "1.2";
51 };
52 }
53 }
54 #endif //vtk_m_io_ImageWriterHDF5_H
vtkm::io::ImageWriterBase
Manages writing, and loading data from images.
Definition: ImageWriterBase.h:35
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
ImageWriterBase.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::io::ImageWriterHDF5::fieldName
std::string fieldName
Definition: ImageWriterHDF5.h:47
vtkm::io::ImageWriterHDF5
Writing images using HDF5 Image format.
Definition: ImageWriterHDF5.h:25