Start work on OutputIntent and better color support in PDFio:

- Add CGATS001-compatible "micro" ICC profile as a standard CMYK color space
  (this is the default used by several Adobe applications)
- Add `PDFIO_CS_CGATS001` color space enum.
- Extend `pdfioArrayCreateColorFromStandard` to support CMYK.
- Extend `pdfioFileCreateImageObjFromFile` to support CMYK JPEG files.
- Update `pdfioFileCreatePage` to add default grayscale, RGB, and CMYK color
  space resources as needed.
This commit is contained in:
Michael R Sweet
2025-04-13 13:31:19 -04:00
parent 3d9c22aa49
commit acd68df592
9 changed files with 577 additions and 13 deletions

View File

@@ -8,6 +8,7 @@
//
#include "pdfio-private.h"
#include "pdfio-content.h"
#ifndef O_BINARY
# define O_BINARY 0
#endif // !O_BINARY
@@ -474,8 +475,9 @@ pdfioFileCreatePage(pdfio_file_t *pdf, // I - PDF file
pdfioDictSetObj(dict, "Parent", pdf->pages_obj);
if (!_pdfioDictGetValue(dict, "Resources"))
pdfioDictSetDict(dict, "Resources", pdfioDictCreate(pdf));
pdfioPageDictAddColorSpace(dict, "DefaultGray", pdfioArrayCreateColorFromStandard(pdf, 1, PDFIO_CS_SRGB));
pdfioPageDictAddColorSpace(dict, "DefaultRGB", pdfioArrayCreateColorFromStandard(pdf, 3, PDFIO_CS_SRGB));
pdfioPageDictAddColorSpace(dict, "DefaultCMYK", pdfioArrayCreateColorFromStandard(pdf, 4, PDFIO_CS_CGATS001));
if (!_pdfioDictGetValue(dict, "Type"))
pdfioDictSetName(dict, "Type", "Page");