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 "FilledShapeAttributeComputer.hpp"
10#include "GrayLevelStatsComputer.hpp"
11#include "MaxDistComputer.hpp"
12#include "MaxDistExactComputer.hpp"
13#include "MomentBasedAttributeComputer.hpp"
14#include "TreeTopologyComputer.hpp"
15#include "VolumeComputer.hpp"
27namespace mmcfilters::attributes::computers {
39template <
class T>
struct IsAttributeArray : std::false_type {};
44template <std::
size_t N>
struct IsAttributeArray<std::array<Attribute, N>> : std::true_type {};
49template <
class T>
inline constexpr bool IsAttributeArrayV = IsAttributeArray<std::remove_cvref_t<T>>::value;
56template <
class Computer>
62template <
class Computer>
64 { Computer::familyName } -> std::convertible_to<std::string_view>;
65 { Computer::family } -> std::convertible_to<AttributeComputerFamily>;
66 { Computer::domain } -> std::convertible_to<AttributeComputerDomain>;
72template <
class Computer,
class Real =
float>
74 requires(
const AttributeComputeContext<Real>& context,
const UnitAttributeComputeContext<Real>& unitContext) {
75 { Computer::compute(context) } -> std::same_as<void>;
76 { Computer::computeUnitRows(unitContext) } -> std::same_as<void>;
82template <
class Computer,
class Real =
float,
class T = std::u
int8_t>
85 requires(
const AltitudeAttributeComputeContext<Real, T>& context,
const AltitudeUnitAttributeComputeContext<Real, T>& unitContext) {
86 { Computer::compute(context) } -> std::same_as<void>;
87 { Computer::computeUnitRows(unitContext) } -> std::same_as<void>;
96template <AttributeComputer Computer> [[nodiscard]]
constexpr bool producesAttribute(Attribute attribute)
noexcept {
97 const auto& attributes = Computer::producedAttributes;
98 return std::find(attributes.begin(), attributes.end(), attribute) != attributes.end();
106template <AttributeComputer Computer> [[nodiscard]]
constexpr std::size_t
numProducedAttributes() noexcept {
return Computer::producedAttributes.size(); }
114 const auto& attributes = Computer::producedAttributes;
115 return {attributes.begin(), attributes.end()};
std::tuple< AreaComputer, BoundingBoxComputer, TreeTopologyComputer, CentralMomentsComputer, HuMomentsComputer, MomentBasedAttributeComputer, BitquadAttributeComputer, ContourSideAttributeComputer, MaxDistComputer, MaxDistExactComputer, FilledShapeAttributeComputer > 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 > AltitudeAttributeComputers
Canonical list of altitude-aware families known to the pipeline.
constexpr bool producesAttribute(Attribute attribute) noexcept
Tests whether Computer is the declared producer of attribute.
std::tuple< AreaComputer, BoundingBoxComputer, TreeTopologyComputer, CentralMomentsComputer, HuMomentsComputer, MomentBasedAttributeComputer, BitquadAttributeComputer, ContourSideAttributeComputer, VolumeComputer, GrayLevelStatsComputer, MaxDistComputer, MaxDistExactComputer, FilledShapeAttributeComputer > RegisteredAttributeComputers
Canonical list used by contract tests to cover every public family.
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 finite-window computation.
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.
Shape descriptors of the region enclosed by the external boundary.
Computes grey-level statistics derived from subtree aggregation.
Computes the seven Hu invariant moments.
Topology-only approximate distance-transform attribute computer.
Topology-only scalar computer for attributes derived from the node EDT.
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.