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

◆ capture_camera()

BufferOperation MayaFlux::Kriya::BufferOperation::capture_camera ( const std::shared_ptr< IO::IOManager > &  io_manager,
const IO::CameraConfig &  config,
BufferCapture::CaptureMode  mode = BufferCapture::CaptureMode::TRANSIENT,
uint32_t  cycle_count = 1,
std::optional< Portal::Graphics::RenderConfig >  render = std::nullopt 
)
static

Open and capture a camera through IOManager.

Parameters
renderDraws the live camera when given; a camera buffer that already renders is left as it is. Without it the capture only routes the frames.

Definition at line 75 of file BufferOperation.cpp.

81{
82 auto camera = io_manager->open_camera(config);
83 if (!camera) {
85 std::source_location::current(), "Failed to open camera");
86 }
87
88 auto buffer = io_manager->hook_camera_to_buffer(camera);
89 if (!buffer) {
91 std::source_location::current(), "Failed to hook camera to graphics buffer");
92 }
93
94 if (render) {
96 }
97
98 return { OpType::CAPTURE, BufferCapture(buffer, mode, cycle_count) };
99}
std::shared_ptr< NetworkGeometryBuffer > buffer
uint32_t mode
@ CAPTURE
Capture data from source buffer using BufferCapture strategy.
@ AsyncIO
Async I/O operations ( network, streaming)
@ Kriya
Automatable tasks and fluent scheduling api for Nodes and Buffers.
bool ensure_rendering(const std::shared_ptr< Buffers::VKBuffer > &buffer, const Portal::Graphics::RenderConfig &config)
Make a buffer draw to the window in a render config, unless it already does.

References MayaFlux::Journal::AsyncIO, buffer, CAPTURE, MayaFlux::Kriya::detail::ensure_rendering(), MayaFlux::Journal::Kriya, and mode.

+ Here is the call graph for this function: