Преглед на файлове

Add man page for makedng and document pixelformats

Martijn Braam преди 1 година
родител
ревизия
108d1bb141
променени са 4 файла, в които са добавени 126 реда и са изтрити 1 реда
  1. 75 0
      doc/makedng.1.scd
  2. 22 1
      meson.build
  3. 1 0
      meson_options.txt
  4. 28 0
      src/mode.c

+ 75 - 0
doc/makedng.1.scd

@@ -0,0 +1,75 @@
+makedng(1) "makedng"
+
+# NAME
+
+makedng - pack raw sensor data into a dng file with metadata
+
+# SYNOPSIS
+
+makedng [OPTIONS] input-file output-file
+
+OPTIONS := { -w width | -h height | -p pixfmt | -m make,model | -s software | -o orientation }
+
+# DESCRIPTION
+
+Read raw sensor data from a file and generate a DNG 1.4 compliant file with the
+metadata to correctly render the file.
+
+# OPTIONS
+
+*-w width*, *-h height*
+	Set the width and height of the source data. This is a required option.
+
+*-p pixelfmt*
+	Set the pixelformat for the source data. This accepts a V4L2 fourcc code or
+	the V4L constant name like "RGGB" and "SRGGB8". This is a required option.
+
+*-m make,model*
+	Set the camera Make and Model as a comma seperated string.
+
+*-s software*
+	Set the name of the camera software used to take the picture.
+
+*-o orientation*
+	Set the orientation of the image data as a number from 1-8 from the DNG
+	specification.
+
+# PIXEL FORMATS
+
+The pixel format argument accepts the following values:
+
+8-bit bayer formatted data, this matches with MIPI RAW8:
+	RGGB, SRGGB8: RG,GB bayer pixel data++
+GRBG, SGRBG8: GR,BG bayer pixel data++
+GBRG, SGBRG8: GB,RG bayer pixel data++
+BGGR, SBGGR8: BG,GR bayer pixel data
+
+10-bit bayer formatted data. transmitted as 16-bit format in 8 bytes:
+	RG10, SRGGB10: RG,GB bayer pixel data++
+BA10, SGRBG10: GR,BG bayer pixel data++
+GB10, SGBRG10: GB,RG bayer pixel data++
+BG10, SBGGR10: BG,GR bayer pixel data
+
+10-bit bayer formatted data packed into 5 bytes, this matches with MIPI RAW10:
+	pRAA, SRGGB10P: RG,GB bayer pixel data++
+pgAA, SGRBG10P: GR,BG bayer pixel data++
+pGAA, SGBRG10P: GB,RG bayer pixel data++
+pBAA, SBGGR10P: BG,GR bayer pixel data
+
+12-bit bayer formatted data, transmitted as 16-bit format in 8 bytes:
+	RG12, SRGGB12: RG,GB bayer pixel data++
+BA12, SGRBG12: GR,BG bayer pixel data++
+GB12, SGBRG12: GB,RG bayer pixel data++
+BG12, SBGGR12: BG,GR bayer pixel data
+
+12-bit bayer formatted data packed into 6 bytes, this matches with MIPI RAW12:
+	pRCC, SRGGB12P: RG,GB bayer pixel data++
+pgCC, SGRBG12P: GR,BG bayer pixel data++
+pGCC, SGBRG12P: GB,RG bayer pixel data++
+pBCC, SBGGR12P: BG,GR bayer pixel data
+
+16-bit bayer formatted data:
+	RG16, SRGGB16: RG,GB bayer pixel data++
+GR16, SGRBG16: GR,BG bayer pixel data++
+GB16, SGBRG16: GB,RG bayer pixel data++
+BYR2, SBGGR16: BG,GR bayer pixel data

+ 22 - 1
meson.build

@@ -1,6 +1,7 @@
 project('libdng', 'c',
     version: '0.1.0',
     license: 'GPL',
+    default_options: ['c_std=c11'],
 )
 
 libtiff = dependency('libtiff-4')
@@ -58,4 +59,24 @@ dng_validate = find_program('dng_validate')
 test('dng_validate', test_dng_validate,
     args: [makedng.full_path()],
     suite: 'adobe',
-)
+)
+
+scdoc = dependency('scdoc', required: get_option('man-pages'), version: '>= 1.9.7', native: true)
+if scdoc.found()
+    man_pages = ['doc/makedng.1.scd']
+    foreach src : man_pages
+		topic = src.split('/')[1].split('.')[0]
+		section = src.split('.')[1]
+		output = topic + '.' + section
+
+		custom_target(
+			output,
+			input: files(src),
+			output: output,
+			command: [
+				'sh', '-c', '@0@ < @INPUT@ > @1@'.format(scdoc.get_variable(pkgconfig: 'scdoc'), output)
+			],
+			install: true,
+			install_dir: join_paths(get_option('mandir'), 'man' + section),
+		)    endforeach
+endif

+ 1 - 0
meson_options.txt

@@ -0,0 +1 @@
+option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages')

+ 28 - 0
src/mode.c

@@ -122,6 +122,34 @@ static struct pixelformat pixelformat_lut[] = {
 		.cfa = CFA_BGGR,
 		.bits_per_sample = 12,
 	},
+	{
+		.fourcc = "pRCC",
+		.name = "SRGGB12P",
+		.pixfmt = V4L2_PIX_FMT_SRGGB12P,
+		.cfa = CFA_RGGB,
+		.bits_per_sample = 12,
+	},
+	{
+		.fourcc = "pgCC",
+		.name = "SGRBG12P",
+		.pixfmt = V4L2_PIX_FMT_SGRBG12P,
+		.cfa = CFA_GRBG,
+		.bits_per_sample = 12,
+	},
+	{
+		.fourcc = "pGCC",
+		.name = "SGBRG12P",
+		.pixfmt = V4L2_PIX_FMT_SGBRG12P,
+		.cfa = CFA_GBRG,
+		.bits_per_sample = 12,
+	},
+	{
+		.fourcc = "pBCC",
+		.name = "SBGGR12P",
+		.pixfmt = V4L2_PIX_FMT_SBGGR12P,
+		.cfa = CFA_BGGR,
+		.bits_per_sample = 12,
+	},
 	{
 		.fourcc = "RG16",
 		.name = "SRGGB16",