Skip to content

Commit 7036522

Browse files
committed
OcdFileImport/Export: Handle v8 color overprint
Although the official docs do not mention the color overprint property, the program dialog contains this setting. A quick experiment shows that the checkbox controls a reserved struct member. This patch implements color overprint import and export in OCD v8 format.
1 parent 4b2b4f4 commit 7036522

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

src/fileformats/ocd_file_export.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,7 @@ void OcdFileExport::exportSetup(OcdFile<Ocd::FormatV8>& file)
924924

925925
color_info->number = color->getId();
926926
color_info->name = toOcdString(color->getName());
927+
color_info->overprint = color->getKnockout() ? -1 : 0;
927928
color_info->cmyk = ocd_cmyk;
928929
++color_info;
929930
}

src/fileformats/ocd_file_import.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,7 @@ void OcdFileImport::importColors(const OcdFile<Ocd::FormatV8>& file)
501501
// The color's CMYK was customized.
502502
color->setCmyk(cmyk);
503503
}
504+
color->setKnockout(color_info.overprint != 0);
504505

505506
if ((i == 0 && color->isBlack() && color->getName() == QLatin1String("Registration black"))
506507
|| (!components.empty() && components.size() == num_separations

src/fileformats/ocd_types_v8.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ namespace Ocd
6464
struct ColorInfoV8
6565
{
6666
quint16 number;
67-
quint16 RESERVED_MEMBER;
67+
qint16 overprint; // undocumented member, overprint: 0 = no, -1 = yes
6868
CmykV8 cmyk;
6969
PascalString<31> name;
7070
quint8 separations[32];

test/file_format_t.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1413,8 +1413,6 @@ void FileFormatTest::colorTest()
14131413
for (auto i = 0; i < original->getNumColorPrios(); ++i)
14141414
{
14151415
// >>>>>>>>> Temporary handling of OCD defects
1416-
if (*format_id == 'O' && original->getColorByPrio(i)->getKnockout() != copy->getColorByPrio(i)->getKnockout())
1417-
QEXPECT_FAIL("", "Overprint is not yet reliably maintained in OCD format", Continue);
14181416
if (*format_id == 'O' && i == 0 && original->getColorByPrio(0)->getName() != copy->getColorByPrio(0)->getName())
14191417
QEXPECT_FAIL("", "Registration black is not properly detected in absence of spot colors", Continue);
14201418
// <<<<<<<<< Temporary handling of OCD defects

0 commit comments

Comments
 (0)