alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | {# |
Richard Burton | cefc7e1 | 2023-12-06 17:13:10 +0000 | [diff] [blame] | 2 | SPDX-FileCopyrightText: Copyright 2021, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com> |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 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 | {{common_template_header}} |
| 18 | |
| 19 | #include "InputFiles.hpp" |
| 20 | |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 21 | static const char* imgFilenames[] = { |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 22 | {% for name in img_names %} |
| 23 | "{{name}}", |
| 24 | {% endfor %} |
| 25 | }; |
| 26 | |
Richard Burton | cefc7e1 | 2023-12-06 17:13:10 +0000 | [diff] [blame] | 27 | {% if source_directory %} |
| 28 | static const char* imgFilePaths[] = { |
| 29 | {% for name in img_names %} |
| 30 | "{{source_directory}}/{{name}}", |
| 31 | {% endfor %} |
| 32 | }; |
| 33 | {% endif %} |
| 34 | |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 35 | static const uint8_t* imgArrays[] = { |
| 36 | {{ var_names|join(',\n ') }} |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 37 | }; |
| 38 | |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 39 | const char* GetFilename(const uint32_t idx) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 40 | { |
| 41 | if (idx < NUMBER_OF_FILES) { |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 42 | return imgFilenames[idx]; |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 43 | } |
| 44 | return nullptr; |
| 45 | } |
| 46 | |
Richard Burton | cefc7e1 | 2023-12-06 17:13:10 +0000 | [diff] [blame] | 47 | {% if source_directory %} |
| 48 | const char* GetFilePath(const uint32_t idx) |
| 49 | { |
| 50 | if (idx < NUMBER_OF_FILES) { |
| 51 | return imgFilePaths[idx]; |
| 52 | } |
| 53 | return nullptr; |
| 54 | } |
| 55 | {% endif %} |
| 56 | |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 57 | const uint8_t* GetImgArray(const uint32_t idx) |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 58 | { |
| 59 | if (idx < NUMBER_OF_FILES) { |
Kshitij Sisodia | 2ea4623 | 2022-12-19 16:37:33 +0000 | [diff] [blame] | 60 | return imgArrays[idx]; |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 61 | } |
| 62 | return nullptr; |
| 63 | } |