MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ get_region_data()

std::vector< TensorData > MayaFlux::Kakshya::TensorContainer::get_region_data ( const Region & region) const
nodiscardoverridevirtual

Copy the box a Region selects into an owning dense tensor.

Returns
One tensor, or empty when the region is invalid.

Implements MayaFlux::Kakshya::NDDataContainer< TensorData >.

Definition at line 89 of file TensorContainer.cpp.

90{
91 const auto selected = view(region);
92 if (!selected)
93 return {};
94
95 auto copy = TensorData::copy_of(*selected);
96 if (!copy)
97 return {};
98
99 std::vector<TensorData> result;
100 result.push_back(std::move(*copy));
101 return result;
102}
std::optional< TensorAccess > view() const
Borrow the whole tensor.
static std::optional< TensorData > copy_of(const TensorAccess &view)
Dense C-ordered copy of any tensor view.
Definition Tensor.cpp:126
CopiedText copy(std::string_view text, const LayoutResult &layout, size_t a, size_t b)
Copy a byte range: the text it spans, and the quads that render it.

References MayaFlux::Kakshya::TensorData::copy_of(), and view().

Referenced by get_region_group_data(), and get_segments_data().

Here is the call graph for this function:
Here is the caller graph for this function: