Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion openvx-core/src/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1334,11 +1334,15 @@ pub extern "C" fn vxGetKernelByEnum(context: vx_context, kernel_e: vx_enum) -> v
// Determine num_params based on kernel enum
let num_params = match kernel_e {
// 2-parameter kernels
0x0E | 0x11 | 0x13 | 0x15 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x24 | 0x25 | 0x26 | 0x27 | 0x28 | 0x2A => 2,
0x0E | 0x11 | 0x12 | 0x13 | 0x15 | 0x18 | 0x19 | 0x1A | 0x1B | 0x1C | 0x1D | 0x1E | 0x24 | 0x25 | 0x26 | 0x27 | 0x28 | 0x2A => 2,
// 3-parameter kernels
0x00 | 0x03 | 0x04 | 0x05 | 0x06 | 0x10 | 0x16 | 0x17 | 0x20 | 0x21 | 0x22 | 0x23 | 0x29 => 3,
// 4-parameter kernels
0x07 | 0x08 | 0x09 | 0x0A | 0x0B | 0x0C | 0x0D | 0x14 | 0x1F | 0x2B | 0x2D => 4,
// 5-parameter kernels (fast_corners, canny_edge)
0x1B => 5,
// 7-parameter kernels (optical_flow_pyr_lk, harris_corners)
0x27 | 0x25 => 7,
// Default
_ => 4,
};
Expand Down
12 changes: 9 additions & 3 deletions openvx-image/src/c_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ pub extern "C" fn vxCreateVirtualPyramid(
if graph.is_null() {
return std::ptr::null_mut();
}
if num_levels == 0 || width == 0 || height == 0 {
if num_levels == 0 {
return std::ptr::null_mut();
}

Expand All @@ -1888,6 +1888,12 @@ pub extern "C" fn vxCreateVirtualPyramid(
return std::ptr::null_mut();
}

// Virtual pyramids are created like regular ones
vxCreatePyramid(context, num_levels, scale, width, height, format)
// Virtual pyramids can have 0 width/height/format - they're resolved during graph verification
// when connected to output-producing nodes
let actual_width = if width == 0 { 1 } else { width };
let actual_height = if height == 0 { 1 } else { height };
let actual_format = if format == VX_DF_IMAGE_VIRT { VX_DF_IMAGE_U8 } else { format };

// Virtual pyramids are created like regular ones with placeholder dimensions
vxCreatePyramid(context, num_levels, scale, actual_width, actual_height, actual_format)
}
Loading