11constexpr std::array<uint32_t, 3>
k_wg2d { 8, 8, 1 };
90 const std::optional<Kinesis::Vision::BoundingBox>& region, uint32_t w, uint32_t
h)
93 return { .
x0 = 0U, .y0 = 0U, .x1 = w, .y1 =
h };
95 const auto fw =
static_cast<float>(w);
96 const auto fh =
static_cast<float>(
h);
97 const auto clamp_to = [](
float v, uint32_t hi) {
98 return static_cast<uint32_t
>(std::clamp(v, 0.0F,
static_cast<float>(hi)));
101 .x0 = clamp_to(std::floor(region->x * fw), w),
102 .y0 = clamp_to(std::floor(region->y * fh),
h),
103 .x1 = clamp_to(std::ceil((region->x + region->w) * fw), w),
104 .y1 = clamp_to(std::ceil((region->y + region->h) * fh),
h),
133 std::shared_ptr<Core::VKImage>
input;
339 const std::shared_ptr<Portal::Graphics::GpuBufferHandle>& handle,
342 if (!handle || !handle->mapped_ptr || handle->size_bytes <
sizeof(glm::vec4))
345 const auto* header =
static_cast<const glm::vec4*
>(handle->mapped_ptr);
346 const size_t capacity = (handle->size_bytes /
sizeof(glm::vec4) - 1U) / stride_vec4;
347 return static_cast<uint32_t
>(std::min<size_t>(std::bit_cast<uint32_t>(header[0].x), capacity));
GPU execution layer for Kinesis::Vision::VisionSequence.
constexpr size_t k_flow_export_vec4
Export buffer size in vec4: one header plus two per track.
constexpr uint32_t k_max_holes_per_label
Maximum number of contours that can be stored in a single pass.
constexpr uint32_t k_flow_min_level_extent
Smallest pyramid level edge worth building.
constexpr uint32_t k_flow_duplicate_energy
Frame change, in 1/1024 intensity summed over pixels, at or below which a frame counts as a repeat.
constexpr uint32_t k_flow_max_radius
Largest window radius the tracker's shared template cache holds.
constexpr uint32_t k_flow_select_local
constexpr uint32_t CC_UNCLAIMED_HOST
constexpr uint64_t k_flow_args_stride
std::optional< uint32_t > exported_record_count(const std::shared_ptr< Portal::Graphics::GpuBufferHandle > &handle, size_t stride_vec4)
Clamped record count from an exported buffer's vec4 header, or nullopt when the buffer isn't readable...
constexpr size_t k_flow_args_count
constexpr uint32_t CC_BACKGROUND_HOST
constexpr uint32_t k_max_components
Maximum number of connected components that can be labeled in a single pass.
constexpr uint32_t k_flow_grid_capacity
Occupancy grid capacity in cells; the cell size grows to fit large frames.
constexpr uint32_t k_max_points_per_contour
Maximum number of points that can be stored in a single contour.
PixelRect region_rect(const std::optional< Kinesis::Vision::BoundingBox > ®ion, uint32_t w, uint32_t h)
Pixel rectangle of a normalised region over a w x h image, clamped to the image.
constexpr uint32_t k_flow_max_points
Upper bound on tracked keypoints, matching extract_peaks' buffer capacity.
constexpr std::array< uint32_t, 3 > k_wg2d
Standard 2D workgroup used by all pixel-to-pixel vision shaders.
constexpr uint32_t k_max_trace_slots
Maximum number of trace slots that can be stored in a single pass (for contour tracing)
constexpr uint32_t k_flow_dense_max_radius
Largest summation window radius of the dense solver.
ElementType
Element type the shader expects in this binding.
std::shared_ptr< Core::VKImage > input
std::shared_ptr< Core::VKImage > output
uint32_t max_holes_per_label
uint32_t max_points_per_contour
uint32_t max_holes_per_label
uint32_t max_points_per_contour
GpuBufferBinding::ElementType type
float forward_backward_threshold
uint32_t duplicate_cutoff
Half-open pixel rectangle [x0, x1) x [y0, y1)