apps: cam: Add support for PPM output format

When file output is requested from cam app, it simply dumps the
processed data and it must be converted to a readable image format
manually. Let's add support for PPM output file format to make files
produced by cam directly readable by image display and processing
software.

For now, only BGR888 output format, which is the simplest one to use, is
supported but nothing prevents adding support for other output formats
if needed. Nevertheless, they would typically need byte reordering or
other conversions for PPM file format. It may be better to find a way to
dump the image data in other output formats directly using some of the
already existing file formats or raw file format converters.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Milan Zamazal
2024-03-22 20:50:32 +01:00
committed by Laurent Pinchart
parent 48f3a25d7c
commit 666f17affc
5 changed files with 87 additions and 0 deletions
+2
View File
@@ -154,6 +154,8 @@ int CamApp::parseOptions(int argc, char *argv[])
"If the file name ends with '.dng', then the frame will be written to\n"
"the output file(s) in DNG format.\n"
#endif
"If the file name ends with '.ppm', then the frame will be written to\n"
"the output file(s) in PPM format.\n"
"The default file name is 'frame-#.bin'.",
"file", ArgumentOptional, "filename", false,
OptCamera);