summaryrefslogtreecommitdiff
path: root/Documentation
AgeCommit message (Expand)Author
2021-05-30libcamera is moving its IRC channel to OFTC (irc.oftc.net)Laurent Pinchart
2021-05-27ipa: core: Move documentation from cpp file back into the mojom filePaul Elder
2021-05-24ipa: ipc: Rename CameraSensorInfo to IPACameraSensorInfoUmang Jain
2021-05-24ipa: Move core IPA interface documentation to a .cpp fileUmang Jain
2021-05-13Documentation: Fix too short title underline in ipa.rstHirokazu Honda
2021-05-13Documentation: Add IPA writers guidePaul Elder
2021-05-11meson: Replace obselete join_paths() with '/' operatorUmang Jain
2021-04-03Documentation: Add getting started sectionLaurent Pinchart
2021-03-25Documentation: contributing: Add link to bugs.libcamera.orgLaurent Pinchart
2021-03-20Documentation: guides: pipeline-handler: Fix capture flag usageNícolas F. R. A. Prado
2021-03-19Documentation: guides: pipeline-handler: Update code, commands and logsNícolas F. R. A. Prado
2021-03-19Documentation: sensor-driver: Fix links to V4L2 documentationNícolas F. R. A. Prado
2021-03-19Documentation: environment-variables: Use standard rST link syntaxNícolas F. R. A. Prado
2021-03-19Documentation: Fix typos and wrong rST syntax for literalsNícolas F. R. A. Prado
2021-02-16libcamera: IPAInterface: Replace C API with the new C++-only APIPaul Elder
2021-02-16libcamera: Add IPCPipe implementation based on unix socketPaul Elder
2021-02-16Documentation: skip generating documentation for generated codePaul Elder
2021-02-05libcamera: camera_sensor: Restrict sensor info to raw sensorsLaurent Pinchart
2021-02-05libcamera: camera_sensor: Make VBLANK mandatoryJacopo Mondi
2021-01-25libcamera: camera_sensor: Make V4L2_CID_EXPOSURE mandatoryJacopo Mondi
2021-01-20Documentation: sensor-driver: Correct camera rotationJacopo Mondi
2021-01-20Documentation: sensor-drivers: Reorder introductionJacopo Mondi
2021-01-18libcamera: Document sensor driver requirementsJacopo Mondi
2020-12-29utils: checkstyle.py: Drop astyle supportLaurent Pinchart
2020-12-28libcamera: pipeline_handler: Remove Camera argument from request handlingNiklas Söderlund
2020-12-27Documentation: Fix Doxygen exclusion of details namespacesLaurent Pinchart
2020-12-27Documentation: Restore alphabetical order of sources in meson.buildLaurent Pinchart
2020-12-27Documentation: Add descriptions for environment variablesSebastian Fricke
2020-12-27Documentation: Drop deprecated Doxygen COLS_IN_ALPHA_INDEX optionLaurent Pinchart
2020-12-08libcamera: pipeline: Pass libcamera controls into pipeline_handler::start()Naushir Patuck
2020-12-01Documentation: Fix doxygen warningLaurent Pinchart
2020-11-03Documentation: tracing: Add tracing guidePaul Elder
2020-11-03libcamera: tracing: Implement tracing infrastructurePaul Elder
2020-10-26Documentation: Fix typo in pipeline handler guideSebastian Fricke
2020-10-20libcamera: Omit extra semicolonsHirokazu Honda
2020-10-07Documentation: coding-style: Document global variable guidelinesPaul Elder
2020-09-30Documentation: guides: pipeline-handler: Update clamp() namespaceUmang Jain
2020-09-24Documentation: Move all dependencies into featuresRicardo Ribalda
2020-09-24Documentation: Search for dot binaryRicardo Ribalda
2020-09-21Documentation: Adjust guidelines regarding math.h headerLaurent Pinchart
2020-08-25meson: Switch to C++17Laurent Pinchart
2020-08-20Documentation: Guides: Pipeline Handler Writer's GuideChris Chinchilla
2020-08-20Documentation: Guides: Application Writer's GuideChris Chinchilla
2020-08-20Documentation: Guides: Developer's Guide to libcameraChris Chinchilla
2020-06-16Documentation: Drop TCL_SUBST tag from Doxyfile.inLaurent Pinchart
2020-06-09licenses: Add SPDX headers to the website builder and themeLaurent Pinchart
2020-06-05docs: Markup LD_PRELOAD as codeMarvin Schmidt
2020-06-05docs: coding-style: Change full stop to colonMarvin Schmidt
2020-06-05docs: Remove trailing whitespaceMarvin Schmidt
2020-06-05docs: Remove stray HTML tagsMarvin Schmidt
"hl opt">, ctrl = ctrl.popitem() id_name = snake_case(name).upper() ctrl_type = ctrl['type'] if ctrl_type == 'string': ctrl_type = 'std::string' elif ctrl.get('size'): ctrl_type = 'Span<const %s>' % ctrl_type info = { 'name': name, 'type': ctrl_type, 'description': format_description(ctrl['description']), 'id_name': id_name, } target_doc = ctrls_doc target_def = ctrls_def if ctrl.get('draft'): target_doc = draft_ctrls_doc target_def = draft_ctrls_def enum = ctrl.get('enum') if enum: enum_doc = [] enum_doc.append(enum_doc_start_template.substitute(info)) num_entries = 0 for entry in enum: value_info = { 'name': name, 'value': entry['name'], 'description': format_description(entry['description']), } enum_doc.append(enum_doc_value_template.substitute(value_info)) num_entries += 1 enum_doc = '\n *\n'.join(enum_doc) enum_doc += '\n */' target_doc.append(enum_doc) values_info = { 'name': info['name'], 'size': num_entries, } target_doc.append(enum_values_doc.substitute(values_info)) target_def.append(enum_values_start.substitute(values_info)) for entry in enum: value_info = { 'name': entry['name'] } target_def.append(enum_values_values.substitute(value_info)) target_def.append("};") target_doc.append(doc_template.substitute(info)) target_def.append(def_template.substitute(info)) if ctrl.get('draft'): name = 'draft::' + name ctrls_map.append('\t{ ' + id_name + ', &' + name + ' },') return { 'controls_doc': '\n\n'.join(ctrls_doc), 'controls_def': '\n'.join(ctrls_def), 'draft_controls_doc': '\n\n'.join(draft_ctrls_doc), 'draft_controls_def': '\n\n'.join(draft_ctrls_def), 'controls_map': '\n'.join(ctrls_map), } def generate_h(controls): enum_template_start = string.Template('''enum ${name}Enum {''') enum_value_template = string.Template('''\t${name} = ${value},''') enum_values_template = string.Template('''extern const std::array<const ControlValue, ${size}> ${name}Values;''') template = string.Template('''extern const Control<${type}> ${name};''') ctrls = [] draft_ctrls = [] ids = [] id_value = 1 for ctrl in controls: name, ctrl = ctrl.popitem() id_name = snake_case(name).upper() ids.append('\t' + id_name + ' = ' + str(id_value) + ',') ctrl_type = ctrl['type'] if ctrl_type == 'string': ctrl_type = 'std::string' elif ctrl.get('size'): ctrl_type = 'Span<const %s>' % ctrl_type info = { 'name': name, 'type': ctrl_type, } target_ctrls = ctrls if ctrl.get('draft'): target_ctrls = draft_ctrls enum = ctrl.get('enum') if enum: target_ctrls.append(enum_template_start.substitute(info)) num_entries = 0 for entry in enum: value_info = { 'name': entry['name'], 'value': entry['value'], } target_ctrls.append(enum_value_template.substitute(value_info)) num_entries += 1 target_ctrls.append("};") values_info = { 'name': info['name'], 'size': num_entries, } target_ctrls.append(enum_values_template.substitute(values_info)) target_ctrls.append(template.substitute(info)) id_value += 1 return { 'ids': '\n'.join(ids), 'controls': '\n'.join(ctrls), 'draft_controls': '\n'.join(draft_ctrls) } 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, help='Input file name.') parser.add_argument('template', type=str, help='Template file name.') args = parser.parse_args(argv[1:]) data = open(args.input, 'rb').read() controls = yaml.safe_load(data)['controls'] if args.template.endswith('.cpp.in'): data = generate_cpp(controls) elif args.template.endswith('.h.in'): data = generate_h(controls) else: raise RuntimeError('Unknown template type') data = fill_template(args.template, data) if args.output: output = open(args.output, 'wb') output.write(data.encode('utf-8')) output.close() else: sys.stdout.write(data) return 0 if __name__ == '__main__': sys.exit(main(sys.argv))