//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. //============================================================================ #ifndef vtk_m_filter_ZFPCompressor2D_h #define vtk_m_filter_ZFPCompressor2D_h #include #include namespace vtkm { namespace filter { /// \brief Compress a scalar field using ZFP /// Takes as input a 1D array and generates on /// output of compressed data. /// @warning /// This filter is currently only supports 1D volumes. class ZFPCompressor2D : public vtkm::filter::FilterField { public: using SupportedTypes = vtkm::List; VTKM_CONT ZFPCompressor2D(); void SetRate(vtkm::Float64 _rate) { rate = _rate; } vtkm::Float64 GetRate() { return rate; } template VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input, const vtkm::cont::ArrayHandle& field, const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase& policy); //Map a new field onto the resulting dataset after running the filter //this call is only valid template VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result, const vtkm::cont::ArrayHandle& input, const vtkm::filter::FieldMetadata& fieldMeta, const vtkm::filter::PolicyBase& policy); private: vtkm::Float64 rate; vtkm::worklet::ZFP2DCompressor compressor; }; } } // namespace vtkm::filter #include #endif // vtk_m_filter_ZFPCompressor2D_h