| 130 | } |
| 131 | |
| 132 | FilterFactory::FilterFactory(const NL::json& userProvidedFilters, |
| 133 | const std::string& filterProfile, |
| 134 | const std::array<double, 3>& scaleFactor, |
| 135 | const std::array<double, 3>& addOffset, |
| 136 | const std::string& defaultCompressor, |
| 137 | int32_t defaultCompressionLevel) |
| 138 | : m_scale_factor{scaleFactor}, m_add_offset{addOffset} |
| 139 | { |
| 140 | m_user_filters.update(userProvidedFilters); |
| 141 | if (filterProfile == "balanced") |
| 142 | m_filter_profile = FilterFactory::Profile::balanced; |
| 143 | else if (filterProfile == "aggressive") |
| 144 | m_filter_profile = FilterFactory::Profile::aggressive; |
| 145 | else if (filterProfile == "none") |
| 146 | m_filter_profile = FilterFactory::Profile::none; |
| 147 | else |
| 148 | throw tiledb::TileDBError("Filter profile '" + filterProfile + |
| 149 | "' is not a valid filter profile"); |
| 150 | |
| 151 | if (!defaultCompressor.empty()) |
| 152 | { |
| 153 | m_default_filter_type = |
| 154 | FilterFactory::filterTypeFromString(defaultCompressor); |
| 155 | m_default_compression_level = defaultCompressionLevel; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | tiledb::Filter FilterFactory::filter(const tiledb::Context& ctx, |
| 160 | const NL::json& options) |