3#include "AttributeComputerDomain.hpp"
4#include "AttributeComputerFamily.hpp"
5#include "../detail/AttributeKernelSupport.hpp"
6#include "detail/ContourSideAttributeMaterialization.hpp"
7#include "detail/ContourSideFiniteWindowComputation.hpp"
8#include "../../utils/Contract.hpp"
15namespace mmcfilters::attributes::computers {
26template <std::
floating_po
int Real>
27inline void computeContourSideAttributes(
const AttributeComputeContext<Real>& context,
const ContourSideRequest& request) {
32 const std::vector<ContourSideCounts> sideCounts = computeContourSideCounts(context.tree);
33 materializeContourSideAttributes(context, request, sideCounts);
38template <std::
floating_po
int Real>
inline void validateContourSideContext(
const AttributeComputeContext<Real>& context) {
39 requireAttributeBufferShape(context.tree, context.buffer, context.attrNames);
40 requireRequestedAttributeColumns(context);
41 local_attributes::detail::validateFiniteWindowLocalAttributeInput(context.tree);
65 static constexpr std::string_view
familyName =
"contour-side";
68 static constexpr AttributeComputerFamily
family = AttributeComputerFamily::ContourSide;
71 static constexpr AttributeComputerDomain
domain = AttributeComputerDomain::Topology;
76 inline static constexpr std::array<Attribute, 6>
producedAttributes{ContourPixels, ContourPerimeter, ContourSideNorth,
77 ContourSideWest, ContourSideEast, ContourSideSouth};
92 const detail::ContourSideRequest
request = detail::ContourSideRequest::from(
context.requestedAttributes);
107 detail::ContourSideAttributeMaterialization::materializeUnitContourSideAttributes(
context.tree,
context.unitPixels,
context.buffer,
#define MMCFILTERS_CONTRACT_CHECKED_ONLY(...)
Executes validation statements only when defensive checks are enabled.
Scalar computer backed by local contour-side counts.
static constexpr std::array< Attribute, 6 > producedAttributes
Canonical list of scalar contour attributes materialized by this computer.
static constexpr AttributeComputerDomain domain
Execution domain required by the computer.
static void computeUnitRows(const UnitAttributeComputeContext< Real > &context)
Materializes contour-side attributes for one-pixel unit supports.
static void compute(const AttributeComputeContext< Real > &context)
Computes requested contour-side scalar attributes for live nodes.
static constexpr std::string_view familyName
Family name used in dependency-plan diagnostics.
static constexpr AttributeComputerFamily family
Stable family id used by the scheduler.
Owning result for one computed scalar attribute layout and buffer.