diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-07-10 07:13:05 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-07-10 07:13:05 +0000 |
| commit | df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2 (patch) | |
| tree | 7e530343b12dd9ec752c6171c82f6108714c9acf /src/color-profile.cpp | |
| parent | Merge upstream GDL: GNOME_2_30_0 (diff) | |
| download | inkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.tar.gz inkscape-df7bda1a8b9d4a1c6f0fd4b82cdeb614eb1ea8d2.zip | |
Refactored to abstract lcms usage more. Added CMSSystem class.
(bzr r10437)
Diffstat (limited to 'src/color-profile.cpp')
| -rw-r--r-- | src/color-profile.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/color-profile.cpp b/src/color-profile.cpp index 4bc37fdf8..f858f7f70 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -31,7 +31,7 @@ #include "xml/repr.h" #include "color.h" #include "color-profile.h" -#include "color-profile-fns.h" +#include "cms-system.h" #include "color-profile-cms-fns.h" #include "attributes.h" #include "inkscape.h" @@ -552,7 +552,7 @@ static SPObject* bruteFind( SPDocument* document, gchar const* name ) return result; } -cmsHPROFILE Inkscape::colorprofile_get_handle( SPDocument* document, guint* intent, gchar const* name ) +cmsHPROFILE Inkscape::CMSSystem::getHandle( SPDocument* document, guint* intent, gchar const* name ) { cmsHPROFILE prof = 0; @@ -652,7 +652,7 @@ ProfileInfo::ProfileInfo( cmsHPROFILE prof, Glib::ustring const & path ) static std::vector<ProfileInfo> knownProfiles; -std::vector<Glib::ustring> Inkscape::colorprofile_get_display_names() +std::vector<Glib::ustring> Inkscape::CMSSystem::getDisplayNames() { loadProfiles(); std::vector<Glib::ustring> result; @@ -666,7 +666,7 @@ std::vector<Glib::ustring> Inkscape::colorprofile_get_display_names() return result; } -std::vector<Glib::ustring> Inkscape::colorprofile_get_softproof_names() +std::vector<Glib::ustring> Inkscape::CMSSystem::getSoftproofNames() { loadProfiles(); std::vector<Glib::ustring> result; @@ -680,7 +680,7 @@ std::vector<Glib::ustring> Inkscape::colorprofile_get_softproof_names() return result; } -Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name) +Glib::ustring Inkscape::CMSSystem::getPathForProfile(Glib::ustring const& name) { loadProfiles(); Glib::ustring result; @@ -695,12 +695,12 @@ Glib::ustring Inkscape::get_path_for_profile(Glib::ustring const& name) return result; } -void Inkscape::colorprofile_cmsDoTransform(cmsHTRANSFORM transform, void *inBuf, void *outBuf, unsigned int size) +void Inkscape::CMSSystem::doTransform(cmsHTRANSFORM transform, void *inBuf, void *outBuf, unsigned int size) { cmsDoTransform(transform, inBuf, outBuf, size); } -bool Inkscape::colorprofile_isPrintColorSpace(ColorProfile const *profile) +bool Inkscape::CMSSystem::isPrintColorSpace(ColorProfile const *profile) { bool isPrint = false; if ( profile ) { @@ -710,6 +710,15 @@ bool Inkscape::colorprofile_isPrintColorSpace(ColorProfile const *profile) return isPrint; } +gint Inkscape::CMSSystem::getChannelCount(ColorProfile const *profile) +{ + gint count = 0; + if ( profile ) { + count = _cmsChannelsOf( asICColorSpaceSig(profile->getColorSpace()) ); + } + return count; +} + #endif // ENABLE_LCMS std::vector<Glib::ustring> ColorProfile::getBaseProfileDirs() { @@ -1077,7 +1086,7 @@ cmsHPROFILE getProofProfileHandle() static void free_transforms(); -cmsHTRANSFORM Inkscape::colorprofile_get_display_transform() +cmsHTRANSFORM Inkscape::CMSSystem::getDisplayTransform() { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); bool fromDisplay = prefs->getBool( "/options/displayprofile/from_display"); @@ -1188,7 +1197,7 @@ void free_transforms() } } -Glib::ustring Inkscape::colorprofile_get_display_id( int screen, int monitor ) +Glib::ustring Inkscape::CMSSystem::getDisplayId( int screen, int monitor ) { Glib::ustring id; @@ -1203,7 +1212,7 @@ Glib::ustring Inkscape::colorprofile_get_display_id( int screen, int monitor ) return id; } -Glib::ustring Inkscape::colorprofile_set_display_per( gpointer buf, guint bufLen, int screen, int monitor ) +Glib::ustring Inkscape::CMSSystem::setDisplayPer( gpointer buf, guint bufLen, int screen, int monitor ) { Glib::ustring id; @@ -1236,7 +1245,7 @@ Glib::ustring Inkscape::colorprofile_set_display_per( gpointer buf, guint bufLen return id; } -cmsHTRANSFORM Inkscape::colorprofile_get_display_per( Glib::ustring const& id ) +cmsHTRANSFORM Inkscape::CMSSystem::getDisplayPer( Glib::ustring const& id ) { cmsHTRANSFORM result = 0; if ( id.empty() ) { |
