From 4046e75cca5435d443af5e34974e32349a65c7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 12 Apr 2022 22:35:14 +0200 Subject: [PATCH] [wip] Trade: un-combinatorially-explode ImageConverterFeatures. Unlike most other options, where a plugin can support 3D but not 2D or compressed but not uncompressed data, the "levels" option is orthogonal to the rest -- if a format supports multi-level data, it obviously also supports a case where there is just a single level, and if it supports multi-level images, then it likely supports them for 1D, 2D and 3D, not just some. The bit pattern actually followed this reasoning already, but for some reason I still went ahead and stamped out all possible combinations. TODO: finish TODO: OTOH, the ToData is probably better to not have a single bit common for all, as it makes it impossible to say that e.g. 3D is just ToFile and 2D and 1D is ToData as well (e.g. when the 3D slices would need multiple files). So change that to different bits instead. --- src/Magnum/Trade/AbstractImageConverter.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Magnum/Trade/AbstractImageConverter.h b/src/Magnum/Trade/AbstractImageConverter.h index cc7205d3f..0882a58bf 100644 --- a/src/Magnum/Trade/AbstractImageConverter.h +++ b/src/Magnum/Trade/AbstractImageConverter.h @@ -241,6 +241,9 @@ enum class ImageConverterFeature: UnsignedInt { */ ConvertCompressed3DToData = ConvertCompressed3DToFile|(1 << 13), +// Levels = 1 << 14, + + #ifdef MAGNUM_BUILD_DEPRECATED /** * Convert a set of 1D image levels to a file with * @ref AbstractImageConverter::convertToFile(Containers::ArrayView, Containers::StringView). @@ -348,6 +351,7 @@ enum class ImageConverterFeature: UnsignedInt { * @m_since_latest */ ConvertCompressedLevels3DToData = ConvertCompressedLevels3DToFile|ConvertCompressed3DToData|(1 << 14) + #endif }; /**