]> git.karo-electronics.de Git - linux-beck.git/commitdiff
docs-rst: auto-generate PDF image files
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 14 Nov 2016 16:32:32 +0000 (14:32 -0200)
committerJonathan Corbet <corbet@lwn.net>
Wed, 16 Nov 2016 22:20:59 +0000 (15:20 -0700)
The PDF files that contain media images were actually generated
offline from their SVG or PNG source files.

Sphinx can handle PNG sources automatially. So, let's just
drop their PDF counterparts.

For SVG, however, Sphinx doesn't produce the right tags to
use the TexLive SVG support. Also, the SVG support is done via
shell execution, with is not nice.

So, while we don't have any support for SVG inside Sphinx
core or as an extension, move the logic to build them to Makefile,
producing the PDF images on runtime.

NOTE: due to the way Sphinx works, the PDF images should be
generated inside the Kernel source tree, as otherwise Sphinx
won't find it, not obeying what's specified by "O=" makefile
parameter.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
42 files changed:
Documentation/Makefile.sphinx
Documentation/media/.gitignore [new file with mode: 0644]
Documentation/media/Makefile
Documentation/media/intro.rst
Documentation/media/media_api_files/typical_media_device.pdf [deleted file]
Documentation/media/typical_media_device.svg [moved from Documentation/media/media_api_files/typical_media_device.svg with 100% similarity]
Documentation/media/uapi/dvb/dvbstb.svg [moved from Documentation/media/uapi/dvb/intro_files/dvbstb.svg with 100% similarity]
Documentation/media/uapi/dvb/intro.rst
Documentation/media/uapi/dvb/intro_files/dvbstb.pdf [deleted file]
Documentation/media/uapi/v4l/bayer.png [moved from Documentation/media/uapi/v4l/subdev-formats_files/bayer.png with 100% similarity]
Documentation/media/uapi/v4l/constraints.svg [moved from Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.svg with 100% similarity]
Documentation/media/uapi/v4l/crop.png [moved from Documentation/media/uapi/v4l/crop_files/crop.png with 100% similarity]
Documentation/media/uapi/v4l/crop.rst
Documentation/media/uapi/v4l/crop_files/crop.pdf [deleted file]
Documentation/media/uapi/v4l/dev-raw-vbi.rst
Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf [deleted file]
Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf [deleted file]
Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf [deleted file]
Documentation/media/uapi/v4l/dev-subdev.rst
Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf [deleted file]
Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf [deleted file]
Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf [deleted file]
Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf [deleted file]
Documentation/media/uapi/v4l/field-order.rst
Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf [deleted file]
Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf [deleted file]
Documentation/media/uapi/v4l/fieldseq_bt.png [moved from Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.png with 100% similarity]
Documentation/media/uapi/v4l/fieldseq_tb.png [moved from Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.png with 100% similarity]
Documentation/media/uapi/v4l/nv12mt.png [moved from Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png with 100% similarity]
Documentation/media/uapi/v4l/nv12mt_example.png [moved from Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png with 100% similarity]
Documentation/media/uapi/v4l/pipeline.png [moved from Documentation/media/uapi/v4l/dev-subdev_files/pipeline.png with 100% similarity]
Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
Documentation/media/uapi/v4l/selection-api-003.rst
Documentation/media/uapi/v4l/selection.png [moved from Documentation/media/uapi/v4l/selection-api-003_files/selection.png with 100% similarity]
Documentation/media/uapi/v4l/subdev-formats.rst
Documentation/media/uapi/v4l/subdev-image-processing-crop.svg [moved from Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg with 100% similarity]
Documentation/media/uapi/v4l/subdev-image-processing-full.svg [moved from Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg with 100% similarity]
Documentation/media/uapi/v4l/subdev-image-processing-scaling-multi-source.svg [moved from Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg with 100% similarity]
Documentation/media/uapi/v4l/vbi_525.png [moved from Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.png with 100% similarity]
Documentation/media/uapi/v4l/vbi_625.png [moved from Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.png with 100% similarity]
Documentation/media/uapi/v4l/vbi_hsync.png [moved from Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.png with 100% similarity]
Documentation/media/uapi/v4l/vidioc-g-selection.rst

index ec0c77d028dbf851a6141bb86d339a805b56a049..a23d3c8b4848adeda85aaec4a0bd2e41ad373245 100644 (file)
@@ -54,7 +54,7 @@ loop_cmd = $(echo-cmd) $(cmd_$(1))
 #    e.g. "media" for the linux-tv book-set at ./Documentation/media
 
 quiet_cmd_sphinx = SPHINX  $@ --> file://$(abspath $(BUILDDIR)/$3/$4)
-      cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\
+      cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\
        BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \
        $(SPHINXBUILD) \
        -b $2 \
@@ -98,6 +98,7 @@ installmandocs:
 
 cleandocs:
        $(Q)rm -rf $(BUILDDIR)
+       $(Q)$(MAKE) -C Documentation/media clean
 
 endif # HAVE_SPHINX
 
diff --git a/Documentation/media/.gitignore b/Documentation/media/.gitignore
new file mode 100644 (file)
index 0000000..a136337
--- /dev/null
@@ -0,0 +1 @@
+*.pdf
index a7fb35291f6c6148de9f051e49c8f7818f307fb8..297b85c37ab92eaf9b54b63fc7126975483898c5 100644 (file)
@@ -10,8 +10,35 @@ FILES = audio.h.rst ca.h.rst dmx.h.rst frontend.h.rst net.h.rst video.h.rst \
 
 TARGETS := $(addprefix $(BUILDDIR)/, $(FILES))
 
-.PHONY: all
+IMAGES = \
+       typical_media_device.svg \
+       uapi/dvb/dvbstb.svg \
+       uapi/v4l/constraints.svg \
+       uapi/v4l/subdev-image-processing-full.svg \
+       uapi/v4l/subdev-image-processing-scaling-multi-source.svg \
+       uapi/v4l/subdev-image-processing-crop.svg \
+
+IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES)))
+IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT))
+
+cmd = $(echo-cmd) $(cmd_$(1))
+
+quiet_cmd_genpdf = GENPDF  $2
+      cmd_genpdf = convert $2 $3
+
+%.pdf: %.svg
+       @$(call cmd,genpdf,$<,$@)
+
+.PHONY: all html epub xml latex
+
 all: $(BUILDDIR) ${TARGETS}
+html: all
+epub: all
+xml: all
+latex: $(IMGPDF) all
+
+clean:
+       -rm $(IMGTGT) 2>/dev/null
 
 $(BUILDDIR):
        $(Q)mkdir -p $@
index f6086c159772eeaa9f2dad78aa9e1631adab6faa..8f7490c9a8efcda19316968085fce830feeba624 100644 (file)
@@ -13,8 +13,8 @@ A typical media device hardware is shown at :ref:`typical_media_device`.
 
 .. _typical_media_device:
 
-.. figure::  media_api_files/typical_media_device.*
-    :alt:    typical_media_device.svg
+.. figure::  typical_media_device.*
+    :alt:    typical_media_device.pdf / typical_media_device.svg
     :align:  center
 
     Typical Media Device
diff --git a/Documentation/media/media_api_files/typical_media_device.pdf b/Documentation/media/media_api_files/typical_media_device.pdf
deleted file mode 100644 (file)
index d000d80..0000000
Binary files a/Documentation/media/media_api_files/typical_media_device.pdf and /dev/null differ
index 11b96a19a9abd4e2ce08bae49c8e6284b5c77851..2ed5c23102b492dc5cb134ac2b63c24a63dd466a 100644 (file)
@@ -55,7 +55,7 @@ Overview
 
 .. _stb_components:
 
-.. figure::  intro_files/dvbstb.*
+.. figure::  dvbstb.*
     :alt:    dvbstb.pdf / dvbstb.svg
     :align:  center
 
diff --git a/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf b/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf
deleted file mode 100644 (file)
index 0fa75d9..0000000
Binary files a/Documentation/media/uapi/dvb/intro_files/dvbstb.pdf and /dev/null differ
index 3ea733a8eef89c568624bde70fbc65d559a8d5cf..578c6f3d20f3c30c43bf8eebcc3d9f39fa50be81 100644 (file)
@@ -53,8 +53,8 @@ Cropping Structures
 
 .. _crop-scale:
 
-.. figure::  crop_files/crop.*
-    :alt:    crop.pdf / crop.gif
+.. figure::  crop.png
+    :alt:    crop.png
     :align:  center
 
     Image Cropping, Insertion and Scaling
diff --git a/Documentation/media/uapi/v4l/crop_files/crop.pdf b/Documentation/media/uapi/v4l/crop_files/crop.pdf
deleted file mode 100644 (file)
index c9fb81c..0000000
Binary files a/Documentation/media/uapi/v4l/crop_files/crop.pdf and /dev/null differ
index b82d837e4ff113b5fccbaebf8633dffeaadf3336..f81d906137eeb02429f4ed92862c2235ede05b13 100644 (file)
@@ -221,8 +221,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
 
 .. _vbi-hsync:
 
-.. figure::  dev-raw-vbi_files/vbi_hsync.*
-    :alt:    vbi_hsync.pdf / vbi_hsync.gif
+.. figure::  vbi_hsync.png
+    :alt:    vbi_hsync.png
     :align:  center
 
     **Figure 4.1. Line synchronization**
@@ -230,8 +230,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
 
 .. _vbi-525:
 
-.. figure::  dev-raw-vbi_files/vbi_525.*
-    :alt:    vbi_525.pdf / vbi_525.gif
+.. figure::  vbi_525.png
+    :alt:    vbi_525.png
     :align:  center
 
     **Figure 4.2. ITU-R 525 line numbering (M/NTSC and M/PAL)**
@@ -240,8 +240,8 @@ and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does
 
 .. _vbi-625:
 
-.. figure::  dev-raw-vbi_files/vbi_625.*
-    :alt:    vbi_625.pdf / vbi_625.gif
+.. figure::  vbi_625.png
+    :alt:    vbi_625.png
     :align:  center
 
     **Figure 4.3. ITU-R 625 line numbering**
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf
deleted file mode 100644 (file)
index 0bae283..0000000
Binary files a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf
deleted file mode 100644 (file)
index bf29b95..0000000
Binary files a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf b/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf
deleted file mode 100644 (file)
index 200b668..0000000
Binary files a/Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf and /dev/null differ
index fb4d0d45b2165a6d72b3dcce66665273daf27bec..c18e9c5427ee8eb18aff43493d937a2f920983a0 100644 (file)
@@ -99,8 +99,8 @@ the video sensor and the host image processing hardware.
 
 .. _pipeline-scaling:
 
-.. figure::  dev-subdev_files/pipeline.*
-    :alt:    pipeline.pdf / pipeline.png
+.. figure::  pipeline.png
+    :alt:    pipeline.png
     :align:  center
 
     Image Format Negotiation on Pipelines
@@ -404,8 +404,8 @@ selection will refer to the sink pad format dimensions instead.
 
 .. _subdev-image-processing-crop:
 
-.. figure::  dev-subdev_files/subdev-image-processing-crop.*
-    :alt:    subdev-image-processing-crop.svg
+.. figure::  subdev-image-processing-crop.*
+    :alt:    subdev-image-processing-crop.pdf / subdev-image-processing-crop.svg
     :align:  center
 
     **Figure 4.5. Image processing in subdevs: simple crop example**
@@ -421,8 +421,8 @@ pad.
 
 .. _subdev-image-processing-scaling-multi-source:
 
-.. figure::  dev-subdev_files/subdev-image-processing-scaling-multi-source.*
-    :alt:    subdev-image-processing-scaling-multi-source.svg
+.. figure::  subdev-image-processing-scaling-multi-source.*
+    :alt:    subdev-image-processing-scaling-multi-source.pdf / subdev-image-processing-scaling-multi-source.svg
     :align:  center
 
     **Figure 4.6. Image processing in subdevs: scaling with multiple sources**
@@ -437,8 +437,8 @@ an area at location specified by the source crop rectangle from it.
 
 .. _subdev-image-processing-full:
 
-.. figure::  dev-subdev_files/subdev-image-processing-full.*
-    :alt:    subdev-image-processing-full.svg
+.. figure::  subdev-image-processing-full.*
+    :alt:    subdev-image-processing-full.pdf / subdev-image-processing-full.svg
     :align:  center
 
     **Figure 4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources**
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf
deleted file mode 100644 (file)
index ee3e37f..0000000
Binary files a/Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf
deleted file mode 100644 (file)
index 29a806f..0000000
Binary files a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf
deleted file mode 100644 (file)
index b78a8e8..0000000
Binary files a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf b/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf
deleted file mode 100644 (file)
index 8f7a95b..0000000
Binary files a/Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf and /dev/null differ
index 50779a67c3fd627d236cc53cf9beae8531ce9bbe..a7e1b4dae34390a1ae603f00800dde4548828950 100644 (file)
@@ -141,8 +141,8 @@ enum v4l2_field
 Field Order, Top Field First Transmitted
 ========================================
 
-.. figure::  field-order_files/fieldseq_tb.*
-    :alt:    fieldseq_tb.pdf / fieldseq_tb.gif
+.. figure::  fieldseq_tb.png
+    :alt:    fieldseq_tb.png
     :align:  center
 
 
@@ -151,7 +151,7 @@ Field Order, Top Field First Transmitted
 Field Order, Bottom Field First Transmitted
 ===========================================
 
-.. figure::  field-order_files/fieldseq_bt.*
-    :alt:    fieldseq_bt.pdf / fieldseq_bt.gif
+.. figure::  fieldseq_bt.png
+    :alt:    fieldseq_bt.png
     :align:  center
 
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf b/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf
deleted file mode 100644 (file)
index 26598b2..0000000
Binary files a/Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf and /dev/null differ
diff --git a/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf b/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf
deleted file mode 100644 (file)
index 4965b22..0000000
Binary files a/Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf and /dev/null differ
index 9f250a1df2f68e1f3d2e6d38376942c45362aa91..c8a77bc79f2f1c353dc6c7b14ceee307e2dfa393 100644 (file)
@@ -33,7 +33,7 @@ Layout of macroblocks in memory is presented in the following figure.
 
 .. _nv12mt:
 
-.. figure::  pixfmt-nv12mt_files/nv12mt.*
+.. figure::  nv12mt.png
     :alt:    nv12mt.png
     :align:  center
 
@@ -50,7 +50,7 @@ interleaved. Height of the buffer is aligned to 32.
 
 .. _nv12mt_ex:
 
-.. figure::  pixfmt-nv12mt_files/nv12mt_example.*
+.. figure::  nv12mt_example.png
     :alt:    nv12mt_example.png
     :align:  center
 
index 15cb3b79f12cc6b2f163a98ee7b0ef8b4cd448e8..207349c17ead389f614b5866615291140519d4b7 100644 (file)
@@ -7,7 +7,7 @@ Selection targets
 
 .. _sel-targets-capture:
 
-.. figure::  selection-api-003_files/selection.*
+.. figure::  selection.png
     :alt:    selection.png
     :align:  center
 
index 65105609374be84caf340b0e23f99792c0b0f72f..2f9c135dfadd4355725de5a2c2b66c37ac598f9b 100644 (file)
@@ -1514,14 +1514,12 @@ be named ``MEDIA_BUS_FMT_SRGGB10_2X8_PADHI_LE``.
 
 .. _bayer-patterns:
 
-.. figure::  subdev-formats_files/bayer.*
+.. figure::  bayer.png
     :alt:    bayer.png
     :align:  center
 
     **Figure 4.8 Bayer Patterns**
 
-
-
 The following table lists existing packed Bayer formats. The data
 organization is given as an example for the first pixel only.
 
index 6da359e506681bf8bda3df09f5ed65876a138076..deb1f6fb473babf6ca6324bc2f2dbb00c00c2a87 100644 (file)
@@ -129,8 +129,8 @@ Selection targets and flags are documented in
 
 .. _sel-const-adjust:
 
-.. figure::  vidioc-g-selection_files/constraints.*
-    :alt:    constraints.svg
+.. figure::  constraints.*
+    :alt:    constraints.pdf / constraints.svg
     :align:  center
 
     Size adjustments with constraint flags.