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

◆ calculate_output_region() [1/2]

Region MayaFlux::Kakshya::calculate_output_region ( const std::vector< uint64_t > &  current_pos,
const std::vector< uint64_t > &  output_shape 
)

Calculate output region bounds from current position and shape.

Parameters
current_posCurrent position coordinates.
output_shapeDesired output shape.
Returns
Region representing the output bounds.

Definition at line 183 of file RegionUtils.cpp.

185{
186 if (current_pos.size() != output_shape.size()) {
187 throw std::invalid_argument("Position and shape vectors must have same size");
188 }
189
190 std::vector<uint64_t> end_pos;
191 end_pos.reserve(current_pos.size());
192
193 for (size_t i = 0; i < current_pos.size(); ++i) {
194 if (output_shape[i] == 0) {
195 throw std::invalid_argument("Output shape cannot have zero dimensions");
196 }
197 end_pos.push_back(current_pos[i] + output_shape[i] - 1);
198 }
199
200 return { current_pos, end_pos };
201}

References calculate_output_region().

Referenced by calculate_output_region(), calculate_output_region(), and MayaFlux::Kakshya::ContiguousAccessProcessor::process().

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