Viskores  1.0
ImageWriterHDF5.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_io_ImageWriterHDF5_H
19 #define viskores_io_ImageWriterHDF5_H
20 
22 
23 namespace viskores
24 {
25 namespace io
26 {
27 
33 class VISKORES_IO_EXPORT ImageWriterHDF5 : public viskores::io::ImageWriterBase
34 {
36 
37 public:
38  using Superclass::Superclass;
39  VISKORES_CONT ~ImageWriterHDF5() noexcept override;
40  ImageWriterHDF5(const ImageWriterHDF5&) = delete;
41  ImageWriterHDF5& operator=(const ImageWriterHDF5&) = delete;
42 
43  VISKORES_CONT void WriteDataSet(const viskores::cont::DataSet& dataSet,
44  const std::string& colorField = {});
45 
46 protected:
47  VISKORES_CONT void Write(viskores::Id width,
48  viskores::Id height,
49  const ColorArrayType& pixels) override;
50 
51 private:
52  template <typename PixelType>
53  VISKORES_CONT int WriteToFile(viskores::Id width,
54  viskores::Id height,
55  const ColorArrayType& pixels);
56 
57  std::int64_t fileid = 0;
58  // FIXME: a hack for the moment, design a better API.
59  std::string fieldName;
60 
61  static constexpr auto IMAGE_CLASS = "IMAGE";
62  static constexpr auto IMAGE_VERSION = "1.2";
63 };
64 }
65 }
66 #endif //viskores_io_ImageWriterHDF5_H
viskores::io::ImageWriterHDF5
Writing images using HDF5 Image format.
Definition: ImageWriterHDF5.h:33
viskores::io::ImageWriterBase
Manages writing, and loading data from images.
Definition: ImageWriterBase.h:43
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
ImageWriterBase.h
viskores::io::ImageWriterHDF5::fieldName
std::string fieldName
Definition: ImageWriterHDF5.h:59