blob: 10cf303f7498c36844381cf03956fccdb5c5703f [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
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 **/
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
42int 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.
53 * @return 0 if successful, non-zero otherwise.
54 **/
55int log_display_text(const char* str, const size_t str_sz,
56 const uint32_t pos_x, const uint32_t pos_y,
57 const bool allow_multiple_lines);
58
59/**
60 * @brief Log parameters for the box to be displayed.
61 * @param[in] pos_x Screen position x co-ordinate.
62 * @param[in] pos_y Screen position y co-ordinate.
63 * @param[in] width Width.
64 * @param[in] height Height.
65 * @param[in] color Fill color.
66 * @return 0 if successful, non-zero otherwise.
67 **/
68int log_display_box_icon(const uint32_t pos_x, const uint32_t pos_y,
69 const uint32_t width, const uint32_t height, const uint16_t color);
70
71/**
72 * @brief Logs the colour with which the display
73 * needs to be cleared with.
74 * @param[in] color Fill color.
75 * @return 0 if successful, non-zero otherwise.
76 **/
77int log_clear(const uint16_t color);
78
79/**
80 * @brief Logs the text color to be set.
81 * @param[in] color Fill color.
82 * @return 0 if successful, non-zero otherwise.
83 **/
84int log_set_text_color (const uint16_t color);
85
86#endif /* NATIVE_LOG_H */