blob: 796d0ef9301dcefd667d8830fa485ebca64cc576 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Richard Burton9c549902022-02-15 16:39:18 +00002 * Copyright (c) 2021-2022 Arm Limited. All rights reserved.
alexander3c798932021-03-26 21:42:19 +00003 * 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 **/
27int 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
Richard Burton9c549902022-02-15 16:39:18 +000042int log_display_image(const uint8_t* data, const uint32_t width,
alexander3c798932021-03-26 21:42:19 +000043 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 Gottardi56ee6202021-05-12 08:27:15 +010053 * @param[in] allow_multiple_lines Specifies if multiple lines are allowed.
alexander3c798932021-03-26 21:42:19 +000054 * @return 0 if successful, non-zero otherwise.
55 **/
56int 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 **/
69int 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 **/
78int 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 **/
85int log_set_text_color (const uint16_t color);
86
87#endif /* NATIVE_LOG_H */