MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
PlacementInputs.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "BoundsText.hpp"
4
7
9
10/**
11 * @struct RectPlacementInputs
12 * @brief A placement by origin and size: x, y, width, height.
13 */
15 glm::vec4 rect {};
16};
17
18MF_DESCRIBE(RectPlacementInputs)
19
20/**
21 * @struct RadialPlacementInputs
22 * @brief A placement by center and radius.
23 */
25 glm::vec2 center {};
26 float radius {};
27};
28
29MF_DESCRIBE(RadialPlacementInputs)
30
31}
32
34
36
37/**
38 * @brief The surface region a rect placement covers.
39 * @param error Receives the reason when nullopt is returned: the width and
40 * height must be positive.
41 */
42[[nodiscard]] MAYAFLUX_API std::optional<Kinesis::AABB2D> region_of(
43 const RectPlacementInputs& placement, std::string& error);
44
45/**
46 * @brief The surface region a radial placement covers: the box around its circle.
47 * @param error Receives the reason when nullopt is returned: the radius must be positive.
48 */
49[[nodiscard]] MAYAFLUX_API std::optional<Kinesis::AABB2D> region_of(
50 const RadialPlacementInputs& placement, std::string& error);
51
52/** @brief A binding for RectPlacementInputs that requires rect. */
53template <typename Source, typename Access = Reflect::RecordAccess<Source>>
60
61/** @brief A binding for RadialPlacementInputs that requires center and radius. */
62template <typename Source, typename Access = Reflect::RecordAccess<Source>>
69
70}
#define MF_DESCRIBE(...)
Requests a generated member description for a struct at namespace scope.
Definition Describe.hpp:14
RecordBinding & required(std::string name)
Bind described attributes and configured child collections of a source element.
std::optional< Kinesis::AABB2D > region_of(const RectPlacementInputs &placement, std::string &error)
The surface region a rect placement covers.
Reflect::RecordBinding< RadialPlacementInputs, Source, Access > radial_placement_binding()
A binding for RadialPlacementInputs that requires center and radius.
Reflect::RecordBinding< RectPlacementInputs, Source, Access > rect_placement_binding()
A binding for RectPlacementInputs that requires rect.
A placement by origin and size: x, y, width, height.