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

◆ edges()

std::shared_ptr< Core::VKImage > MayaFlux::Yantra::VisionExtractor::edges ( const std::shared_ptr< Core::VKImage > &  source,
const Kinesis::Vision::VisionAnalysis &  analysis,
uint32_t  source_w,
uint32_t  source_h 
)

source kept where analysis.detect_edges reaches the edge threshold, transparent elsewhere.

Definition at line 631 of file VisionExtractor.cpp.

635{
636 if (!analysis.detect_edges)
637 return nullptr;
638
639 auto& ctx = image_context();
640 use_shader(ctx, "edge_select.comp.spv", k_wg_image, sizeof(EdgePC));
641 ctx.stage_image(source);
642 ctx.stage_image_at(2, analysis.detect_edges, ElementType::IMAGE_SAMPLED, default_sampler());
643 ctx.set_push_constants(EdgePC { .threshold = m_edge_threshold, .out_w = source_w, .out_h = source_h });
644 return dispatch_image(ctx, source_w, source_h);
645}
TextureExecutionContext & image_context()
The two contexts every method shares, one shader swapped in per call.

References MayaFlux::Kinesis::Vision::VisionAnalysis::detect_edges, image_context(), and m_edge_threshold.

Referenced by run_operation().

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