| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-FileCopyrightText: 2024 - 2025 Arm Limited and/or its affiliates <open-source-office@arm.com> | ||
| 2 | // | ||
| 3 | // SPDX-License-Identifier: Apache-2.0 | ||
| 4 | |||
| 5 | #ifndef KLEIDICV_ARITHMETICS_ROTATE_H | ||
| 6 | #define KLEIDICV_ARITHMETICS_ROTATE_H | ||
| 7 | |||
| 8 | #include <cstddef> | ||
| 9 | #include <cstdint> | ||
| 10 | |||
| 11 | #include "kleidicv/ctypes.h" | ||
| 12 | |||
| 13 | namespace kleidicv { | ||
| 14 | |||
| 15 | 928 | inline bool rotate_is_implemented(const void *src, void *dst, int angle, | |
| 16 | size_t element_size) { | ||
| 17 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 920 times.
|
928 | if (angle != 90) { |
| 18 | 8 | return false; | |
| 19 | } | ||
| 20 |
2/2✓ Branch 0 taken 912 times.
✓ Branch 1 taken 8 times.
|
920 | if (src == dst) { |
| 21 | // Do not support inplace rotate at the moment | ||
| 22 | 8 | return false; | |
| 23 | } | ||
| 24 |
2/2✓ Branch 0 taken 904 times.
✓ Branch 1 taken 8 times.
|
912 | switch (element_size) { |
| 25 | case sizeof(uint8_t): | ||
| 26 | case sizeof(uint16_t): | ||
| 27 | case sizeof(uint32_t): | ||
| 28 | case sizeof(uint64_t): | ||
| 29 | 904 | return true; | |
| 30 | default: | ||
| 31 | 8 | return false; | |
| 32 | } | ||
| 33 | 928 | } | |
| 34 | |||
| 35 | namespace neon { | ||
| 36 | |||
| 37 | kleidicv_error_t rotate(const void *src, size_t src_stride, size_t width, | ||
| 38 | size_t height, void *dst, size_t dst_stride, int angle, | ||
| 39 | size_t element_size); | ||
| 40 | } // namespace neon | ||
| 41 | |||
| 42 | } // namespace kleidicv | ||
| 43 | |||
| 44 | #endif // KLEIDICV_ARITHMETICS_ROTATE_H | ||
| 45 |