diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2007-10-04 05:58:08 +0000 |
|---|---|---|
| committer | joncruz <joncruz@users.sourceforge.net> | 2007-10-04 05:58:08 +0000 |
| commit | a76db97eb2bb60b129f8687cb999be24a10677bc (patch) | |
| tree | 126e0c26106e4cd5c6421451dc72918c1a0434d9 /src/color-profile.cpp | |
| parent | Variable rename (diff) | |
| download | inkscape-a76db97eb2bb60b129f8687cb999be24a10677bc.tar.gz inkscape-a76db97eb2bb60b129f8687cb999be24a10677bc.zip | |
few more CMS options
(bzr r3833)
Diffstat (limited to 'src/color-profile.cpp')
| -rw-r--r-- | src/color-profile.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 75757068f..609c14cc1 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -548,6 +548,8 @@ int errorHandlerCB(int ErrorCode, const char *ErrorText) } static bool gamutWarn = false; +static bool lastBPC = false; +static bool lastPreserveBlack = false; static int lastIntent = INTENT_PERCEPTUAL; static int lastProofIntent = INTENT_PERCEPTUAL; static cmsHTRANSFORM transf = 0; @@ -679,8 +681,15 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform() bool warn = prefs_get_int_attribute_limited( "options.softproof", "gamutwarn", 0, 0, 1 ); int intent = prefs_get_int_attribute_limited( "options.displayprofile", "intent", 0, 0, 3 ); int proofIntent = prefs_get_int_attribute_limited( "options.softproof", "intent", 0, 0, 3 ); - - if ( (warn != gamutWarn) || (lastIntent != intent) || (lastProofIntent != proofIntent)) { + bool bpc = prefs_get_int_attribute_limited( "options.softproof", "bpc", 0, 0, 1 ); + bool preserveBlack = prefs_get_int_attribute_limited( "options.softproof", "preserveblack", 0, 0, 1 ); + + if ( (warn != gamutWarn) + || (lastIntent != intent) + || (lastProofIntent != proofIntent) + || (bpc != lastBPC) + || (preserveBlack != lastPreserveBlack) + ) { gamutWarn = warn; if ( transf ) { cmsDeleteTransform(transf); @@ -688,6 +697,8 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform() } lastIntent = intent; lastProofIntent = proofIntent; + lastBPC = bpc; + lastPreserveBlack = preserveBlack; } // Fecth these now, as they might clear the transform as a side effect. @@ -702,8 +713,14 @@ cmsHTRANSFORM Inkscape::colorprofile_get_display_transform() DWORD dwFlags = cmsFLAGS_SOFTPROOFING; if ( gamutWarn ) { dwFlags |= cmsFLAGS_GAMUTCHECK; + cmsSetAlarmCodes(0, 255, 0); + } + if ( bpc ) { + dwFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION; + } + if ( preserveBlack ) { + dwFlags |= cmsFLAGS_PRESERVEBLACK; } - cmsSetAlarmCodes(0, 255, 0); transf = cmsCreateProofingTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, proofProf, intent, proofIntent, dwFlags ); } else if ( hprof ) { transf = cmsCreateTransform( srcprof, TYPE_RGB_8, hprof, TYPE_RGB_8, intent, 0 ); |
