validating parameters for GPU code path
This commit is contained in:
Родитель
4f177e7a5b
Коммит
d0a4f9df03
|
@ -85,6 +85,14 @@ k4a_transformation_t transformation_create(const k4a_calibration_t *calibration,
|
|||
|
||||
void transformation_destroy(k4a_transformation_t transformation_handle);
|
||||
|
||||
k4a_buffer_result_t transformation_depth_image_to_color_camera_validate_parameters(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
const k4a_transformation_image_descriptor_t *depth_image_descriptor,
|
||||
uint8_t *transformed_depth_image_data,
|
||||
k4a_transformation_image_descriptor_t *transformed_depth_image_descriptor);
|
||||
|
||||
k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
|
@ -100,6 +108,16 @@ transformation_depth_image_to_color_camera(k4a_transformation_t transformation_h
|
|||
uint8_t *transformed_depth_image_data,
|
||||
k4a_transformation_image_descriptor_t *transformed_depth_image_descriptor);
|
||||
|
||||
k4a_buffer_result_t transformation_color_image_to_depth_camera_validate_parameters(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
const k4a_transformation_image_descriptor_t *depth_image_descriptor,
|
||||
const uint8_t *color_image_data,
|
||||
const k4a_transformation_image_descriptor_t *color_image_descriptor,
|
||||
uint8_t *transformed_color_image_data,
|
||||
k4a_transformation_image_descriptor_t *transformed_color_image_descriptor);
|
||||
|
||||
k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
|
|
|
@ -66,7 +66,7 @@ static bool transformation_compare_image_descriptors(const k4a_transformation_im
|
|||
descriptor1->height_pixels != descriptor2->height_pixels ||
|
||||
descriptor1->stride_bytes != descriptor2->stride_bytes)
|
||||
{
|
||||
LOG_ERROR("Unexpected image descriptor. Expect width_pixels: %d, height_pixels: %d, stride_bytes: %d. "
|
||||
LOG_ERROR("Unexpected image descriptor. Expected width_pixels: %d, height_pixels: %d, stride_bytes: %d. "
|
||||
"Actual width_pixels: %d, height_pixels: %d, stride_bytes: %d.",
|
||||
descriptor1->width_pixels,
|
||||
descriptor1->height_pixels,
|
||||
|
@ -459,7 +459,7 @@ static k4a_result_t transformation_depth_to_color(k4a_transformation_rgbz_contex
|
|||
return K4A_RESULT_SUCCEEDED;
|
||||
}
|
||||
|
||||
k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
|
||||
k4a_buffer_result_t transformation_depth_image_to_color_camera_validate_parameters(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
|
@ -531,6 +531,28 @@ k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
|
|||
return K4A_BUFFER_RESULT_FAILED;
|
||||
}
|
||||
|
||||
return K4A_BUFFER_RESULT_SUCCEEDED;
|
||||
}
|
||||
|
||||
k4a_buffer_result_t transformation_depth_image_to_color_camera_internal(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
const k4a_transformation_image_descriptor_t *depth_image_descriptor,
|
||||
uint8_t *transformed_depth_image_data,
|
||||
k4a_transformation_image_descriptor_t *transformed_depth_image_descriptor)
|
||||
{
|
||||
if (K4A_FAILED(TRACE_CALL(
|
||||
transformation_depth_image_to_color_camera_validate_parameters(calibration,
|
||||
xy_tables_depth_camera,
|
||||
depth_image_data,
|
||||
depth_image_descriptor,
|
||||
transformed_depth_image_data,
|
||||
transformed_depth_image_descriptor))))
|
||||
{
|
||||
return K4A_BUFFER_RESULT_FAILED;
|
||||
}
|
||||
|
||||
k4a_transformation_rgbz_context_t context;
|
||||
memset(&context, 0, sizeof(k4a_transformation_rgbz_context_t));
|
||||
|
||||
|
@ -641,7 +663,7 @@ static k4a_result_t transformation_color_to_depth(k4a_transformation_rgbz_contex
|
|||
return K4A_RESULT_SUCCEEDED;
|
||||
}
|
||||
|
||||
k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
|
||||
k4a_buffer_result_t transformation_color_image_to_depth_camera_validate_parameters(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
|
@ -731,6 +753,32 @@ k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
|
|||
return K4A_BUFFER_RESULT_FAILED;
|
||||
}
|
||||
|
||||
return K4A_BUFFER_RESULT_SUCCEEDED;
|
||||
}
|
||||
|
||||
k4a_buffer_result_t transformation_color_image_to_depth_camera_internal(
|
||||
const k4a_calibration_t *calibration,
|
||||
const k4a_transformation_xy_tables_t *xy_tables_depth_camera,
|
||||
const uint8_t *depth_image_data,
|
||||
const k4a_transformation_image_descriptor_t *depth_image_descriptor,
|
||||
const uint8_t *color_image_data,
|
||||
const k4a_transformation_image_descriptor_t *color_image_descriptor,
|
||||
uint8_t *transformed_color_image_data,
|
||||
k4a_transformation_image_descriptor_t *transformed_color_image_descriptor)
|
||||
{
|
||||
if (K4A_FAILED(TRACE_CALL(
|
||||
transformation_color_image_to_depth_camera_validate_parameters(calibration,
|
||||
xy_tables_depth_camera,
|
||||
depth_image_data,
|
||||
depth_image_descriptor,
|
||||
color_image_data,
|
||||
color_image_descriptor,
|
||||
transformed_color_image_data,
|
||||
transformed_color_image_descriptor))))
|
||||
{
|
||||
return K4A_BUFFER_RESULT_FAILED;
|
||||
}
|
||||
|
||||
k4a_transformation_rgbz_context_t context;
|
||||
memset(&context, 0, sizeof(k4a_transformation_rgbz_context_t));
|
||||
|
||||
|
|
|
@ -467,6 +467,17 @@ transformation_depth_image_to_color_camera(k4a_transformation_t transformation_h
|
|||
|
||||
if (transformation_context->enable_gpu_optimization)
|
||||
{
|
||||
if (K4A_FAILED(TRACE_CALL(transformation_depth_image_to_color_camera_validate_parameters(
|
||||
&transformation_context->calibration,
|
||||
&transformation_context->depth_camera_xy_tables,
|
||||
depth_image_data,
|
||||
depth_image_descriptor,
|
||||
transformed_depth_image_data,
|
||||
transformed_depth_image_descriptor))))
|
||||
{
|
||||
return K4A_RESULT_FAILED;
|
||||
}
|
||||
|
||||
size_t depth_image_size = (size_t)(depth_image_descriptor->stride_bytes *
|
||||
depth_image_descriptor->height_pixels);
|
||||
size_t transformed_depth_image_size = (size_t)(transformed_depth_image_descriptor->stride_bytes *
|
||||
|
@ -522,6 +533,19 @@ transformation_color_image_to_depth_camera(k4a_transformation_t transformation_h
|
|||
|
||||
if (transformation_context->enable_gpu_optimization)
|
||||
{
|
||||
if (K4A_FAILED(TRACE_CALL(transformation_color_image_to_depth_camera_validate_parameters(
|
||||
&transformation_context->calibration,
|
||||
&transformation_context->depth_camera_xy_tables,
|
||||
depth_image_data,
|
||||
depth_image_descriptor,
|
||||
color_image_data,
|
||||
color_image_descriptor,
|
||||
transformed_color_image_data,
|
||||
transformed_color_image_descriptor))))
|
||||
{
|
||||
return K4A_RESULT_FAILED;
|
||||
}
|
||||
|
||||
size_t depth_image_size = (size_t)(depth_image_descriptor->stride_bytes *
|
||||
depth_image_descriptor->height_pixels);
|
||||
size_t color_image_size = (size_t)(color_image_descriptor->stride_bytes *
|
||||
|
|
Загрузка…
Ссылка в новой задаче