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

◆ op_snapshot()

void MayaFlux::Yantra::VisionGpuExecutor::op_snapshot ( VisionGpuContexts &  contexts)
staticprivate

Copy the working image into this snapshot's own image and append it to VisionResult::snapshots.

The working image is unchanged.

Definition at line 411 of file VisionGpuDispatch.cpp.

412{
413 const auto& current = contexts.pass.current;
414 if (!current)
415 return;
416
417 const size_t ordinal = contexts.pass.result.snapshots.size();
418 while (contexts.snapshot_images.size() <= ordinal)
419 contexts.snapshot_images.emplace_back(k_snapshot_cache_budget_bytes);
420
421 const uint32_t w = current->get_width();
422 const uint32_t h = current->get_height();
424 auto image = contexts.snapshot_images[ordinal].acquire(loom, {
425 .width = w,
426 .height = h,
427 .format = Portal::Graphics::ImageFormat::RGBA32F,
429 });
430
431 constexpr auto filter = Portal::Graphics::FilterMode::NEAREST;
432 if (!image || !loom.can_blit(current, image, filter) || !loom.blit_layer(current, image, { .filter = filter })) {
434 "run_gpu: Snapshot {} could not copy the working image", ordinal);
435 return;
436 }
437
438 contexts.pass.result.snapshots.push_back({
439 .image = std::move(image),
440 .w = w,
441 .h = h,
442 .channels = contexts.pass.channels,
443 });
444}
#define MF_ERROR(comp, ctx,...)
IO::ImageData image
Definition Decoder.cpp:47
glm::vec2 current
uint32_t h
Definition InkPress.cpp:29
@ ComputeMatrix
Compute operations (Yantra - algorithms, matrices, DSP)
@ Yantra
DSP algorithms, computational units, matrix operations, Grammar.
@ NEAREST
Nearest neighbor (pixelated)

References MayaFlux::Kinesis::Vision::VisionPass< Handle >::channels, MayaFlux::Journal::ComputeMatrix, MayaFlux::Kinesis::Vision::VisionPass< Handle >::current, current, h, image, MayaFlux::Portal::Graphics::TextureLoom::instance(), MF_ERROR, MayaFlux::Portal::Graphics::NEAREST, MayaFlux::Yantra::VisionGpuContexts::pass, MayaFlux::Kinesis::Vision::VisionPass< Handle >::result, MayaFlux::Yantra::VisionGpuContexts::snapshot_images, MayaFlux::Kinesis::Vision::VisionResult::snapshots, MayaFlux::Portal::Graphics::ImageKey::STORAGE_2D, and MayaFlux::Journal::Yantra.

+ Here is the call graph for this function: