diff --git a/kleidicv/include/kleidicv/kleidicv.h b/kleidicv/include/kleidicv/kleidicv.h index e1aef97e4e6b443b54466aeca3c705114441c11f..6cdc742425f6c025e582107c1ad109455b944f1b 100644 --- a/kleidicv/include/kleidicv/kleidicv.h +++ b/kleidicv/include/kleidicv/kleidicv.h @@ -1075,16 +1075,18 @@ KLEIDICV_API_DECLARATION(kleidicv_resize_to_quarter_u8, const uint8_t *src, /// Must be inline with the choosen upsizing operation, for /// example `src_height * 2` in case of 2x2. /// -KLEIDICV_API_DECLARATION(kleidicv_resize_linear_u8, const uint8_t *src, - size_t src_stride, size_t src_width, size_t src_height, - uint8_t *dst, size_t dst_stride, size_t dst_width, - size_t dst_height); +kleidicv_error_t kleidicv_resize_linear_u8(const uint8_t *src, + size_t src_stride, size_t src_width, + size_t src_height, uint8_t *dst, + size_t dst_stride, size_t dst_width, + size_t dst_height); /// @copydoc kleidicv_resize_linear_u8 -KLEIDICV_API_DECLARATION(kleidicv_resize_linear_f32, const float *src, - size_t src_stride, size_t src_width, size_t src_height, - float *dst, size_t dst_stride, size_t dst_width, - size_t dst_height); +kleidicv_error_t kleidicv_resize_linear_f32(const float *src, size_t src_stride, + size_t src_width, size_t src_height, + float *dst, size_t dst_stride, + size_t dst_width, + size_t dst_height); /// Calculates vertical derivative approximation with Sobel filter. /// diff --git a/kleidicv/src/resize/resize_linear_api.cpp b/kleidicv/src/resize/resize_linear_api.cpp index ecf72ddf0b8ac2cd1fe5991947db19470bc4eb92..838d053aeeb43a798aea7cf044398d3801c3ba8b 100644 --- a/kleidicv/src/resize/resize_linear_api.cpp +++ b/kleidicv/src/resize/resize_linear_api.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 Arm Limited and/or its affiliates +// SPDX-FileCopyrightText: 2024 - 2025 Arm Limited and/or its affiliates // // SPDX-License-Identifier: Apache-2.0 @@ -17,14 +17,15 @@ KLEIDICV_MULTIVERSION_C_API( KLEIDICV_SVE2_IMPL_IF(&kleidicv::sve2::resize_linear_stripe_f32), &kleidicv::sme2::resize_linear_stripe_f32); -namespace kleidicv { +extern "C" { -static kleidicv_error_t resize_linear_u8(const uint8_t *src, size_t src_stride, - size_t src_width, size_t src_height, - uint8_t *dst, size_t dst_stride, - size_t dst_width, size_t dst_height) { - if (!resize_linear_u8_is_implemented(src_width, src_height, dst_width, - dst_height)) { +kleidicv_error_t kleidicv_resize_linear_u8(const uint8_t *src, + size_t src_stride, size_t src_width, + size_t src_height, uint8_t *dst, + size_t dst_stride, size_t dst_width, + size_t dst_height) { + if (!kleidicv::resize_linear_u8_is_implemented(src_width, src_height, + dst_width, dst_height)) { return KLEIDICV_ERROR_NOT_IMPLEMENTED; } return kleidicv_resize_linear_stripe_u8(src, src_stride, src_width, @@ -32,12 +33,13 @@ static kleidicv_error_t resize_linear_u8(const uint8_t *src, size_t src_stride, dst_stride, dst_width, dst_height); } -static kleidicv_error_t resize_linear_f32(const float *src, size_t src_stride, - size_t src_width, size_t src_height, - float *dst, size_t dst_stride, - size_t dst_width, size_t dst_height) { - if (!resize_linear_f32_is_implemented(src_width, src_height, dst_width, - dst_height)) { +kleidicv_error_t kleidicv_resize_linear_f32(const float *src, size_t src_stride, + size_t src_width, size_t src_height, + float *dst, size_t dst_stride, + size_t dst_width, + size_t dst_height) { + if (!kleidicv::resize_linear_f32_is_implemented(src_width, src_height, + dst_width, dst_height)) { return KLEIDICV_ERROR_NOT_IMPLEMENTED; } return kleidicv_resize_linear_stripe_f32(src, src_stride, src_width, @@ -45,10 +47,4 @@ static kleidicv_error_t resize_linear_f32(const float *src, size_t src_stride, dst_stride, dst_width, dst_height); } -} // namespace kleidicv - -KLEIDICV_MULTIVERSION_C_API(kleidicv_resize_linear_u8, - &kleidicv::resize_linear_u8, nullptr, nullptr); - -KLEIDICV_MULTIVERSION_C_API(kleidicv_resize_linear_f32, - &kleidicv::resize_linear_f32, nullptr, nullptr); +} // extern "C"