3#include "AttributeComputerDomain.hpp"
4#include "AttributeComputerFamily.hpp"
5#include "AreaComputer.hpp"
6#include "BitquadAttributeComputer.hpp"
7#include "BoundingBoxComputer.hpp"
8#include "ContourSideAttributeComputer.hpp"
9#include "GrayLevelStatsComputer.hpp"
10#include "MaxDistComputer.hpp"
11#include "MomentBasedAttributeComputer.hpp"
12#include "TreeTopologyComputer.hpp"
13#include "VolumeComputer.hpp"
25namespace mmcfilters::attributes::computers {
38struct IsAttributeArray : std::false_type {};
43template <std::
size_t N>
44struct IsAttributeArray<std::array<Attribute, N>> : std::true_type {};
57template <
class Computer>
60 Computer::producedAttributes;
62 detail::IsAttributeArrayV<
decltype(Computer::producedAttributes)>;
67template <
class Computer>
71 { Computer::familyName } -> std::convertible_to<std::string_view>;
72 { Computer::family } -> std::convertible_to<AttributeComputerFamily>;
73 { Computer::domain } -> std::convertible_to<AttributeComputerDomain>;
79template <
class Computer,
class Real =
float>
81 std::floating_point<Real> &&
83 Computer::domain == AttributeComputerDomain::Topology &&
85 const AttributeComputeContext<Real>& context,
86 const UnitAttributeComputeContext<Real>& unitContext) {
87 { Computer::compute(context) } -> std::same_as<void>;
88 { Computer::computeUnitRows(unitContext) } -> std::same_as<void>;
94template <
class Computer,
class Real =
float,
class T = std::u
int8_t>
96 std::floating_point<Real> &&
99 Computer::domain == AttributeComputerDomain::Altitude &&
101 const AltitudeAttributeComputeContext<Real, T>& context,
102 const AltitudeUnitAttributeComputeContext<Real, T>& unitContext) {
103 { Computer::compute(context) } -> std::same_as<void>;
104 { Computer::computeUnitRows(unitContext) } -> std::same_as<void>;
110template <AttributeComputer Computer>
113 const auto& attributes = Computer::producedAttributes;
114 return std::find(attributes.begin(), attributes.end(), attribute) != attributes.end();
120template <AttributeComputer Computer>
123 return Computer::producedAttributes.size();
129template <AttributeComputer Computer>
132 const auto& attributes = Computer::producedAttributes;
133 return {attributes.begin(), attributes.end()};
std::tuple< AreaComputer, BoundingBoxComputer, TreeTopologyComputer, CentralMomentsComputer, HuMomentsComputer, MomentBasedAttributeComputer, BitquadAttributeComputer, ContourSideAttributeComputer > TopologyAttributeComputers
Canonical list of topology/support families known to the backend.
std::vector< Attribute > runtimeProducedAttributes()
Materializes a computer's canonical output list as a runtime vector.
std::tuple< VolumeComputer, GrayLevelStatsComputer, MaxDistComputer > AltitudeAttributeComputers
Canonical list of altitude-aware families known to the pipeline.
std::tuple< AreaComputer, BoundingBoxComputer, TreeTopologyComputer, CentralMomentsComputer, HuMomentsComputer, MomentBasedAttributeComputer, BitquadAttributeComputer, ContourSideAttributeComputer, VolumeComputer, GrayLevelStatsComputer, MaxDistComputer > RegisteredAttributeComputers
Canonical list used by contract tests to cover every public family.
constexpr bool producesAttribute(Attribute attribute) noexcept
Tests whether Computer is the declared producer of attribute.
constexpr bool IsAttributeArrayV
Convenience value for checking whether a type is a canonical attribute array.
constexpr std::size_t numProducedAttributes() noexcept
Number of scalar descriptors declared by the family.
Computes the canonical subtree area attribute.
Bitquad scalar computer backed by local events.
Computes descriptors derived from the axis-aligned bounding box of the node support.
Computes geometric central moments up to third order.
Scalar computer backed by local contour-side counts.
Computes grey-level statistics derived from subtree aggregation.
Computes the seven Hu invariant moments.
Computes higher-level shape descriptors derived from second-order central moments.
Computes structural descriptors that depend only on the tree topology.
Computes cumulative grey-level volume descriptors on the hierarchy.
Value types accepted by generic altitude helpers.
Computer concept for families that require a typed altitude span.
Verifies that a computer declares its canonical output list.
Verifies the complete static protocol of one attribute computer.
Computer concept for families that do not read node altitudes.
Owning result for one computed scalar attribute layout and buffer.