MayaFlux 0.1.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 203 of file RegionUtils.cpp.

206{
207 const auto& structure = container->get_structure();
208 uint64_t total_frames = structure.get_samples_count_per_channel();
209 uint64_t num_channels = structure.get_channel_count();
210
211 if (current_frame >= total_frames) {
212 throw std::out_of_range("Current frame exceeds container bounds");
213 }
214
215 uint64_t available_frames = total_frames - current_frame;
216 uint64_t actual_frames = std::min(frames_to_process, available_frames);
217
218 Region output_shape;
219 output_shape.start_coordinates = { current_frame, 0 };
220 output_shape.end_coordinates = { current_frame + actual_frames - 1, num_channels - 1 };
221
222 return output_shape;
223}

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

+ Here is the call graph for this function: