Skip to content

Commit 1eed479

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 3cdc1bb commit 1eed479

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
@@ -926,6 +926,7 @@ void OcdFileExport::exportSetup(OcdFile<Ocd::FormatV8>& file)
926926

927927
color_info->number = color->getId();
928928
color_info->name = toOcdString(color->getName());
929+
color_info->overprint = color->getKnockout() ? -1 : 0;
929930
color_info->cmyk = ocd_cmyk;
930931
++color_info;
931932
}

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
@@ -1274,8 +1274,6 @@ void FileFormatTest::colorTest()
12741274
for (auto i = 0; i < original->getNumColorPrios(); ++i)
12751275
{
12761276
// >>>>>>>>> Temporary handling of OCD defects
1277-
if (*format_id == 'O' && original->getColorByPrio(i)->getKnockout() != copy->getColorByPrio(i)->getKnockout())
1278-
QEXPECT_FAIL("", "Overprint is not yet reliably maintained in OCD format", Continue);
12791277
if (*format_id == 'O' && i == 0 && original->getColorByPrio(0)->getName() != copy->getColorByPrio(0)->getName())
12801278
QEXPECT_FAIL("", "Registration black is not properly detected in absence of spot colors", Continue);
12811279
// <<<<<<<<< Temporary handling of OCD defects

0 commit comments

Comments
 (0)