libcupsfilters: Allow mupdftoraster() be used for all raster formats
The mupdftoraster() filter function only produces PWG Raster, due to
the fact that mutool of MuPDF produces PWG Raster but not Apple
Raster, CUPS Raster, or PCLm.
To obtain the other formats one needs post-filtering with pwgtoraster
and rastertopclm. To make this working in the best possible way and to
make it working at all with any PPD file (also those which do not have
information for generating the inbetween PWG Raster format) we have
prepared mupdftoraster appropriately.
Changes done:
- Get final output format via parameters
- Call cupsRasterPrepareHeader() with PWG Raster as header format and
the final output format as final format
- If the final format is not PWG Raster we need post-filtering. In
this case let mutool only generate output with a maximum of 3 color
channels (no CMYK) as the post filters pwgtoraster and rastertopclm
only support 1- or 3-color-channel input.
- Add explicit support for the RGBW color space (#17, used by HPLIP's
hpcups driver).
- On an unknown final output color space default to color instead of
mono output. A post filter can turn color into monochrome but not
vice-versa.
- Let the CUPS filter wrapper read the final output format from the
FINAL_CONTENT_TYPE environment variable. Default to CUPS Raster on
an unknown format, as those formats typically come from CUPS Raster
("rasterto...") drivers.
- Do not pass in the full list of environment variables any more. We
do not manipulate these. Instead we call mutool with execvp() to
simply use the caller's environment instead of execvpe() with a
supplied environment.
- Update the MIME rules: Remove rule telling that mupdftoraster
outputs CUPS Raster, add rules for pwgtoraster, and also rules to
reflect that rastertopclm also accepts Apple Raster or PWG Raster as
input.