summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/bar-chart.svg
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-09-11 14:27:12 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-09-12 21:02:16 +0100
commit79aace58d3fc7232003174019777ab449ca11107 (patch)
tree5f12753fb2b4ee4b60a2d3b44a85d403b790a649 /src/qcam/assets/feathericons/bar-chart.svg
parent6f09a619cca412f029c124cff8bbf1647d3d68cf (diff)
qcam: format_converter: Support R8 Greyscale
Support Greyscale images in the format converter by expanding the R8 component to each of the output RGB components. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/qcam/assets/feathericons/bar-chart.svg')
0 files changed, 0 insertions, 0 deletions
hl slc"># # gen-formats.py - Generate formats definitions from YAML import argparse import re import string import sys import yaml class DRMFourCC(object): format_regex = re.compile(r"#define (DRM_FORMAT_[A-Z0-9_]+)[ \t]+fourcc_code\(('.', '.', '.', '.')\)") mod_vendor_regex = re.compile(r"#define DRM_FORMAT_MOD_VENDOR_([A-Z0-9_]+)[ \t]+([0-9a-fA-Fx]+)") mod_regex = re.compile(r"#define ([A-Za-z0-9_]+)[ \t]+fourcc_mod_code\(([A-Z0-9_]+), ([0-9a-fA-Fx]+)\)") def __init__(self, filename): self.formats = {} self.vendors = {} self.mods = {} for line in open(filename, 'rb').readlines(): line = line.decode('utf-8') match = DRMFourCC.format_regex.match(line) if match: format, fourcc = match.groups() self.formats[format] = fourcc continue match = DRMFourCC.mod_vendor_regex.match(line) if match: vendor, value = match.groups() self.vendors[vendor] = int(value, 0) continue match = DRMFourCC.mod_regex.match(line) if match: mod, vendor, value = match.groups() self.mods[mod] = (vendor, int(value, 0)) continue def fourcc(self, name): return self.formats[name] def mod(self, name): vendor, value = self.mods[name] return self.vendors[vendor], value def generate_h(formats, drm_fourcc): template = string.Template('constexpr PixelFormat ${name}{ __fourcc(${fourcc}), __mod(${mod}) };') fmts = [] for format in formats: name, format = format.popitem() fourcc = drm_fourcc.fourcc(format['fourcc']) if format.get('big-endian'): fourcc += '| DRM_FORMAT_BIG_ENDIAN' data = { 'name': name, 'fourcc': fourcc, 'mod': '0, 0', } mod = format.get('mod') if mod: data['mod'] = '%u, %u' % drm_fourcc.mod(mod) fmts.append(template.substitute(data)) return {'formats': '\n'.join(fmts)} def fill_template(template, data): template = open(template, 'rb').read() template = template.decode('utf-8') template = string.Template(template) return template.substitute(data) def main(argv): # Parse command line arguments parser = argparse.ArgumentParser() parser.add_argument('-o', dest='output', metavar='file', type=str, help='Output file name. Defaults to standard output if not specified.') parser.add_argument('input', type=str,