Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

docs-rst: auto-generate PDF image files

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>

authored by

Mauro Carvalho Chehab and committed by
Jonathan Corbet
15a04d4e f3902934

+60 -33
+2 -1
Documentation/Makefile.sphinx
··· 54 54 # e.g. "media" for the linux-tv book-set at ./Documentation/media 55 55 56 56 quiet_cmd_sphinx = SPHINX $@ --> file://$(abspath $(BUILDDIR)/$3/$4) 57 - cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media all;\ 57 + cmd_sphinx = $(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/media $2;\ 58 58 BUILDDIR=$(abspath $(BUILDDIR)) SPHINX_CONF=$(abspath $(srctree)/$(src)/$5/$(SPHINX_CONF)) \ 59 59 $(SPHINXBUILD) \ 60 60 -b $2 \ ··· 98 98 99 99 cleandocs: 100 100 $(Q)rm -rf $(BUILDDIR) 101 + $(Q)$(MAKE) -C Documentation/media clean 101 102 102 103 endif # HAVE_SPHINX 103 104
+1
Documentation/media/.gitignore
··· 1 + *.pdf
+28 -1
Documentation/media/Makefile
··· 10 10 11 11 TARGETS := $(addprefix $(BUILDDIR)/, $(FILES)) 12 12 13 - .PHONY: all 13 + IMAGES = \ 14 + typical_media_device.svg \ 15 + uapi/dvb/dvbstb.svg \ 16 + uapi/v4l/constraints.svg \ 17 + uapi/v4l/subdev-image-processing-full.svg \ 18 + uapi/v4l/subdev-image-processing-scaling-multi-source.svg \ 19 + uapi/v4l/subdev-image-processing-crop.svg \ 20 + 21 + IMGTGT := $(patsubst %.png,%.pdf,$(patsubst %.svg,%.pdf,$(IMAGES))) 22 + IMGPDF := $(patsubst %,$(SRC_DIR)/%,$(IMGTGT)) 23 + 24 + cmd = $(echo-cmd) $(cmd_$(1)) 25 + 26 + quiet_cmd_genpdf = GENPDF $2 27 + cmd_genpdf = convert $2 $3 28 + 29 + %.pdf: %.svg 30 + @$(call cmd,genpdf,$<,$@) 31 + 32 + .PHONY: all html epub xml latex 33 + 14 34 all: $(BUILDDIR) ${TARGETS} 35 + html: all 36 + epub: all 37 + xml: all 38 + latex: $(IMGPDF) all 39 + 40 + clean: 41 + -rm $(IMGTGT) 2>/dev/null 15 42 16 43 $(BUILDDIR): 17 44 $(Q)mkdir -p $@
+2 -2
Documentation/media/intro.rst
··· 13 13 14 14 .. _typical_media_device: 15 15 16 - .. figure:: media_api_files/typical_media_device.* 17 - :alt: typical_media_device.svg 16 + .. figure:: typical_media_device.* 17 + :alt: typical_media_device.pdf / typical_media_device.svg 18 18 :align: center 19 19 20 20 Typical Media Device
Documentation/media/media_api_files/typical_media_device.pdf

This is a binary file and will not be displayed.

Documentation/media/media_api_files/typical_media_device.svg Documentation/media/typical_media_device.svg
+1 -1
Documentation/media/uapi/dvb/intro.rst
··· 55 55 56 56 .. _stb_components: 57 57 58 - .. figure:: intro_files/dvbstb.* 58 + .. figure:: dvbstb.* 59 59 :alt: dvbstb.pdf / dvbstb.svg 60 60 :align: center 61 61
Documentation/media/uapi/dvb/intro_files/dvbstb.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/dvb/intro_files/dvbstb.svg Documentation/media/uapi/dvb/dvbstb.svg
+2 -2
Documentation/media/uapi/v4l/crop.rst
··· 53 53 54 54 .. _crop-scale: 55 55 56 - .. figure:: crop_files/crop.* 57 - :alt: crop.pdf / crop.gif 56 + .. figure:: crop.png 57 + :alt: crop.png 58 58 :align: center 59 59 60 60 Image Cropping, Insertion and Scaling
Documentation/media/uapi/v4l/crop_files/crop.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/crop_files/crop.png Documentation/media/uapi/v4l/crop.png

This is a binary file and will not be displayed.

+6 -6
Documentation/media/uapi/v4l/dev-raw-vbi.rst
··· 221 221 222 222 .. _vbi-hsync: 223 223 224 - .. figure:: dev-raw-vbi_files/vbi_hsync.* 225 - :alt: vbi_hsync.pdf / vbi_hsync.gif 224 + .. figure:: vbi_hsync.png 225 + :alt: vbi_hsync.png 226 226 :align: center 227 227 228 228 **Figure 4.1. Line synchronization** ··· 230 230 231 231 .. _vbi-525: 232 232 233 - .. figure:: dev-raw-vbi_files/vbi_525.* 234 - :alt: vbi_525.pdf / vbi_525.gif 233 + .. figure:: vbi_525.png 234 + :alt: vbi_525.png 235 235 :align: center 236 236 237 237 **Figure 4.2. ITU-R 525 line numbering (M/NTSC and M/PAL)** ··· 240 240 241 241 .. _vbi-625: 242 242 243 - .. figure:: dev-raw-vbi_files/vbi_625.* 244 - :alt: vbi_625.pdf / vbi_625.gif 243 + .. figure:: vbi_625.png 244 + :alt: vbi_625.png 245 245 :align: center 246 246 247 247 **Figure 4.3. ITU-R 625 line numbering**
Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_525.png Documentation/media/uapi/v4l/vbi_525.png

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_625.png Documentation/media/uapi/v4l/vbi_625.png

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-raw-vbi_files/vbi_hsync.png Documentation/media/uapi/v4l/vbi_hsync.png

This is a binary file and will not be displayed.

+8 -8
Documentation/media/uapi/v4l/dev-subdev.rst
··· 99 99 100 100 .. _pipeline-scaling: 101 101 102 - .. figure:: dev-subdev_files/pipeline.* 103 - :alt: pipeline.pdf / pipeline.png 102 + .. figure:: pipeline.png 103 + :alt: pipeline.png 104 104 :align: center 105 105 106 106 Image Format Negotiation on Pipelines ··· 404 404 405 405 .. _subdev-image-processing-crop: 406 406 407 - .. figure:: dev-subdev_files/subdev-image-processing-crop.* 408 - :alt: subdev-image-processing-crop.svg 407 + .. figure:: subdev-image-processing-crop.* 408 + :alt: subdev-image-processing-crop.pdf / subdev-image-processing-crop.svg 409 409 :align: center 410 410 411 411 **Figure 4.5. Image processing in subdevs: simple crop example** ··· 421 421 422 422 .. _subdev-image-processing-scaling-multi-source: 423 423 424 - .. figure:: dev-subdev_files/subdev-image-processing-scaling-multi-source.* 425 - :alt: subdev-image-processing-scaling-multi-source.svg 424 + .. figure:: subdev-image-processing-scaling-multi-source.* 425 + :alt: subdev-image-processing-scaling-multi-source.pdf / subdev-image-processing-scaling-multi-source.svg 426 426 :align: center 427 427 428 428 **Figure 4.6. Image processing in subdevs: scaling with multiple sources** ··· 437 437 438 438 .. _subdev-image-processing-full: 439 439 440 - .. figure:: dev-subdev_files/subdev-image-processing-full.* 441 - :alt: subdev-image-processing-full.svg 440 + .. figure:: subdev-image-processing-full.* 441 + :alt: subdev-image-processing-full.pdf / subdev-image-processing-full.svg 442 442 :align: center 443 443 444 444 **Figure 4.7. Image processing in subdevs: scaling and composition with multiple sinks and sources**
Documentation/media/uapi/v4l/dev-subdev_files/pipeline.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-subdev_files/pipeline.png Documentation/media/uapi/v4l/pipeline.png

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-crop.svg Documentation/media/uapi/v4l/subdev-image-processing-crop.svg
Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-full.svg Documentation/media/uapi/v4l/subdev-image-processing-full.svg
Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/dev-subdev_files/subdev-image-processing-scaling-multi-source.svg Documentation/media/uapi/v4l/subdev-image-processing-scaling-multi-source.svg
+4 -4
Documentation/media/uapi/v4l/field-order.rst
··· 141 141 Field Order, Top Field First Transmitted 142 142 ======================================== 143 143 144 - .. figure:: field-order_files/fieldseq_tb.* 145 - :alt: fieldseq_tb.pdf / fieldseq_tb.gif 144 + .. figure:: fieldseq_tb.png 145 + :alt: fieldseq_tb.png 146 146 :align: center 147 147 148 148 ··· 151 151 Field Order, Bottom Field First Transmitted 152 152 =========================================== 153 153 154 - .. figure:: field-order_files/fieldseq_bt.* 155 - :alt: fieldseq_bt.pdf / fieldseq_bt.gif 154 + .. figure:: fieldseq_bt.png 155 + :alt: fieldseq_bt.png 156 156 :align: center 157 157
Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/field-order_files/fieldseq_bt.png Documentation/media/uapi/v4l/fieldseq_bt.png

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.pdf

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/field-order_files/fieldseq_tb.png Documentation/media/uapi/v4l/fieldseq_tb.png

This is a binary file and will not be displayed.

+2 -2
Documentation/media/uapi/v4l/pixfmt-nv12mt.rst
··· 33 33 34 34 .. _nv12mt: 35 35 36 - .. figure:: pixfmt-nv12mt_files/nv12mt.* 36 + .. figure:: nv12mt.png 37 37 :alt: nv12mt.png 38 38 :align: center 39 39 ··· 50 50 51 51 .. _nv12mt_ex: 52 52 53 - .. figure:: pixfmt-nv12mt_files/nv12mt_example.* 53 + .. figure:: nv12mt_example.png 54 54 :alt: nv12mt_example.png 55 55 :align: center 56 56
Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt.png Documentation/media/uapi/v4l/nv12mt.png

This is a binary file and will not be displayed.

Documentation/media/uapi/v4l/pixfmt-nv12mt_files/nv12mt_example.png Documentation/media/uapi/v4l/nv12mt_example.png

This is a binary file and will not be displayed.

+1 -1
Documentation/media/uapi/v4l/selection-api-003.rst
··· 7 7 8 8 .. _sel-targets-capture: 9 9 10 - .. figure:: selection-api-003_files/selection.* 10 + .. figure:: selection.png 11 11 :alt: selection.png 12 12 :align: center 13 13
Documentation/media/uapi/v4l/selection-api-003_files/selection.png Documentation/media/uapi/v4l/selection.png

This is a binary file and will not be displayed.

+1 -3
Documentation/media/uapi/v4l/subdev-formats.rst
··· 1514 1514 1515 1515 .. _bayer-patterns: 1516 1516 1517 - .. figure:: subdev-formats_files/bayer.* 1517 + .. figure:: bayer.png 1518 1518 :alt: bayer.png 1519 1519 :align: center 1520 1520 1521 1521 **Figure 4.8 Bayer Patterns** 1522 - 1523 - 1524 1522 1525 1523 The following table lists existing packed Bayer formats. The data 1526 1524 organization is given as an example for the first pixel only.
Documentation/media/uapi/v4l/subdev-formats_files/bayer.png Documentation/media/uapi/v4l/bayer.png

This is a binary file and will not be displayed.

+2 -2
Documentation/media/uapi/v4l/vidioc-g-selection.rst
··· 129 129 130 130 .. _sel-const-adjust: 131 131 132 - .. figure:: vidioc-g-selection_files/constraints.* 133 - :alt: constraints.svg 132 + .. figure:: constraints.* 133 + :alt: constraints.pdf / constraints.svg 134 134 :align: center 135 135 136 136 Size adjustments with constraint flags.
Documentation/media/uapi/v4l/vidioc-g-selection_files/constraints.svg Documentation/media/uapi/v4l/constraints.svg