alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2021 Arm Limited. All rights reserved. |
| 3 | * SPDX-License-Identifier: Apache-2.0 |
| 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | #ifndef NATIVE_LOG_H |
| 18 | #define NATIVE_LOG_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <stddef.h> |
| 22 | #include <stdbool.h> |
| 23 | |
| 24 | /** |
| 25 | * @brief Data presentation initialiser |
| 26 | **/ |
| 27 | int log_psn_init(void); |
| 28 | |
| 29 | /** |
| 30 | * @brief Log parameters for the image to be displayed. |
| 31 | * @param[in] data Image pointer. |
| 32 | * @param[in] width Image width. |
| 33 | * @param[in] height Image height. |
| 34 | * @param[in] channels Number of channels. |
| 35 | * @param[in] pos_x Screen position x co-ordinate. |
| 36 | * @param[in] pos_y Screen position y co-ordinate. |
| 37 | * @param[in] downsample_factor Factor by which the image needs to be |
| 38 | * down-sampled. |
| 39 | * @return 0 if successful, non-zero otherwise. |
| 40 | **/ |
| 41 | |
| 42 | int log_display_image(uint8_t* data, const uint32_t width, |
| 43 | const uint32_t height, const uint32_t channels, |
| 44 | const uint32_t pos_x, const uint32_t pos_y, |
| 45 | const uint32_t downsample_factor); |
| 46 | |
| 47 | /** |
| 48 | * @brief Log the parameters for text to be displayed. |
| 49 | * @param[in] str Pointer to a null terminated string. |
| 50 | * @param[in] str_sz Length of the string. |
| 51 | * @param[in] pos_x Screen position x co-ordinate. |
| 52 | * @param[in] pos_y Screen position y co-ordinate. |
Isabella Gottardi | 56ee620 | 2021-05-12 08:27:15 +0100 | [diff] [blame] | 53 | * @param[in] allow_multiple_lines Specifies if multiple lines are allowed. |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 54 | * @return 0 if successful, non-zero otherwise. |
| 55 | **/ |
| 56 | int log_display_text(const char* str, const size_t str_sz, |
| 57 | const uint32_t pos_x, const uint32_t pos_y, |
| 58 | const bool allow_multiple_lines); |
| 59 | |
| 60 | /** |
| 61 | * @brief Log parameters for the box to be displayed. |
| 62 | * @param[in] pos_x Screen position x co-ordinate. |
| 63 | * @param[in] pos_y Screen position y co-ordinate. |
| 64 | * @param[in] width Width. |
| 65 | * @param[in] height Height. |
| 66 | * @param[in] color Fill color. |
| 67 | * @return 0 if successful, non-zero otherwise. |
| 68 | **/ |
| 69 | int log_display_box_icon(const uint32_t pos_x, const uint32_t pos_y, |
| 70 | const uint32_t width, const uint32_t height, const uint16_t color); |
| 71 | |
| 72 | /** |
| 73 | * @brief Logs the colour with which the display |
| 74 | * needs to be cleared with. |
| 75 | * @param[in] color Fill color. |
| 76 | * @return 0 if successful, non-zero otherwise. |
| 77 | **/ |
| 78 | int log_clear(const uint16_t color); |
| 79 | |
| 80 | /** |
| 81 | * @brief Logs the text color to be set. |
| 82 | * @param[in] color Fill color. |
| 83 | * @return 0 if successful, non-zero otherwise. |
| 84 | **/ |
| 85 | int log_set_text_color (const uint16_t color); |
| 86 | |
| 87 | #endif /* NATIVE_LOG_H */ |