utils: codegen: gen-formats.py: Use jinja

Currently the gen-formats.py script can only be used to generate C++
code because it hard-codes part of the template. Use jinja to fully
remove any such dependency.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Barnabás Pőcze
2025-09-01 10:53:44 +02:00
parent baea40a8a5
commit 479a9031f5
2 changed files with 14 additions and 18 deletions

View File

@@ -35,7 +35,9 @@ constexpr uint64_t __mod(unsigned int vendor, unsigned int mod)
} /* namespace */
${formats}
{% for f in formats -%}
constexpr PixelFormat {{f.name}}(__fourcc({{f.fourcc}}), __mod({{f.mod}}));
{% endfor %}
} /* namespace formats */