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

◆ calculate_output_region() [2/2]

Region MayaFlux::Kakshya::calculate_output_region ( uint64_t  current_frame,
uint64_t  frames_to_process,
const std::shared_ptr< SignalSourceContainer > &  container 
)

Calculate output region for frame-based processing.

Parameters
current_frameCurrent frame index.
frames_to_processNumber of frames to process.
containerContainer providing layout information.
Returns
Region representing the output bounds for the specified frames.

Definition at line 211 of file RegionUtils.cpp.

214{
215 const auto& structure = container->get_structure();
216 uint64_t total_frames = structure.get_samples_count_per_channel();
217 uint64_t num_channels = structure.get_channel_count();
218
219 if (current_frame >= total_frames) {
220 error<std::out_of_range>(
221 Journal::Component::Kakshya, Journal::Context::Runtime,
222 std::source_location::current(),
223 "Current frame exceeds container bounds: current_frame = "
224 + std::to_string(current_frame) + ", total_frames = "
225 + std::to_string(total_frames));
226 }
227
228 uint64_t available_frames = total_frames - current_frame;
229 uint64_t actual_frames = std::min(frames_to_process, available_frames);
230
231 Region output_shape;
232 output_shape.start_coordinates = { current_frame, 0 };
233 output_shape.end_coordinates = { current_frame + actual_frames - 1, num_channels - 1 };
234
235 return output_shape;
236}

References calculate_output_region(), MayaFlux::Kakshya::Region::end_coordinates, and MayaFlux::Kakshya::Region::start_coordinates.

+ Here is the call graph for this function: