summaryrefslogtreecommitdiff
path: root/scripts/py/templates/Images.cc.template
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/py/templates/Images.cc.template')
-rw-r--r--scripts/py/templates/Images.cc.template20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/py/templates/Images.cc.template b/scripts/py/templates/Images.cc.template
index 2620ab4..c5b051a 100644
--- a/scripts/py/templates/Images.cc.template
+++ b/scripts/py/templates/Images.cc.template
@@ -1,5 +1,5 @@
{#
- SPDX-FileCopyrightText: Copyright 2021 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ SPDX-FileCopyrightText: Copyright 2021, 2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
SPDX-License-Identifier: Apache-2.0
Licensed under the Apache License, Version 2.0 (the "License");
@@ -24,6 +24,14 @@ static const char* imgFilenames[] = {
{% endfor %}
};
+{% if source_directory %}
+static const char* imgFilePaths[] = {
+{% for name in img_names %}
+ "{{source_directory}}/{{name}}",
+{% endfor %}
+};
+{% endif %}
+
static const uint8_t* imgArrays[] = {
{{ var_names|join(',\n ') }}
};
@@ -36,6 +44,16 @@ const char* GetFilename(const uint32_t idx)
return nullptr;
}
+{% if source_directory %}
+const char* GetFilePath(const uint32_t idx)
+{
+ if (idx < NUMBER_OF_FILES) {
+ return imgFilePaths[idx];
+ }
+ return nullptr;
+}
+{% endif %}
+
const uint8_t* GetImgArray(const uint32_t idx)
{
if (idx < NUMBER_OF_FILES) {