22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Color <strong>and</strong> its Use 12.17<br />

"C" Example: Collapsing CMYK to Gray<br />

if (State->fillColorSpec.space) == GlobalCMYKSpace)<br />

{<br />

if ((State->fillColorSpec.value.color[1] ==<br />

State->fillColorSpec.value.color[2]) &&<br />

(State->fillColorSpec.value.color[2] ==<br />

State->fillColorSpec.value.color[3]))<br />

{<br />

State->fillColorSpec.Space = GlobalGraySpace;<br />

State->fillColorSpec.value.color[0] =<br />

(fixedOne - (State->fillColorSpec.value.color[0] +<br />

State->fillColorSpec.value.color[3]));<br />

if (State->fillColorSpec.value[0] < 0)<br />

State->fillColorSpec.Value[0] = 0;<br />

}<br />

}<br />

Converting RGB to CMYK<br />

RGB <strong>and</strong> CMY are complements, so we can turn one to the other by subtracting the<br />

value from 1. However, the “K” component of CMYK (Black) is present to enhance<br />

the distribution of ink on a printer, <strong>and</strong> should be maintained correctly across such<br />

conversions.<br />

In converting RGB to CMYK, we complement each of the channels, then identify the<br />

smallest of the three values, subtract it from each channel, <strong>and</strong> use it as the value for<br />

channel 4.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!