diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:24:48 +0000 |
commit | cca66b9ec4e494c1d919bff0f71a820d8afab1fa (patch) | |
tree | 146f39ded1c938019e1ed42d30923c2ac9e86789 /src/object/color-profile.h | |
parent | Initial commit. (diff) | |
download | inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.tar.xz inkscape-cca66b9ec4e494c1d919bff0f71a820d8afab1fa.zip |
Adding upstream version 1.2.2.upstream/1.2.2upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/object/color-profile.h | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/src/object/color-profile.h b/src/object/color-profile.h new file mode 100644 index 0000000..8372fb0 --- /dev/null +++ b/src/object/color-profile.h @@ -0,0 +1,113 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/** @file + * TODO: insert short description here + *//* + * Authors: see git history + * + * Copyright (C) 2018 Authors + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ +#ifndef SEEN_COLOR_PROFILE_H +#define SEEN_COLOR_PROFILE_H + +#ifdef HAVE_CONFIG_H +# include "config.h" // only include where actually required! +#endif + +#include <set> +#include <vector> + +#include <glibmm/ustring.h> +#include "cms-color-types.h" + +#include "sp-object.h" + +struct SPColor; + +namespace Inkscape { + +enum { + RENDERING_INTENT_UNKNOWN = 0, + RENDERING_INTENT_AUTO = 1, + RENDERING_INTENT_PERCEPTUAL = 2, + RENDERING_INTENT_RELATIVE_COLORIMETRIC = 3, + RENDERING_INTENT_SATURATION = 4, + RENDERING_INTENT_ABSOLUTE_COLORIMETRIC = 5 +}; + +class ColorProfileImpl; + + +/** + * Color Profile. + */ +class ColorProfile : public SPObject { +public: + ColorProfile(); + ~ColorProfile() override; + + bool operator<(ColorProfile const &other) const; + + friend cmsHPROFILE colorprofile_get_handle( SPDocument*, unsigned int*, char const* ); + friend class CMSSystem; + + class FilePlusHome { + public: + FilePlusHome(Glib::ustring filename, bool isInHome); + FilePlusHome(const FilePlusHome &filePlusHome); + bool operator<(FilePlusHome const &other) const; + Glib::ustring filename; + bool isInHome; + }; + class FilePlusHomeAndName: public FilePlusHome { + public: + FilePlusHomeAndName(FilePlusHome filePlusHome, Glib::ustring name); + bool operator<(FilePlusHomeAndName const &other) const; + Glib::ustring name; + }; + + static std::set<FilePlusHome> getBaseProfileDirs(); + static std::set<FilePlusHome> getProfileFiles(); + static std::set<FilePlusHomeAndName> getProfileFilesWithNames(); + //icColorSpaceSignature getColorSpace() const; + ColorSpaceSig getColorSpace() const; + //icProfileClassSignature getProfileClass() const; + ColorProfileClassSig getProfileClass() const; + cmsHTRANSFORM getTransfToSRGB8(); + cmsHTRANSFORM getTransfFromSRGB8(); + cmsHTRANSFORM getTransfGamutCheck(); + bool GamutCheck(SPColor color); + + char* href; + char* local; + char* name; + char* intentStr; + unsigned int rendering_intent; // FIXME: type the enum and hold that instead + +protected: + ColorProfileImpl *impl; + + void build(SPDocument* doc, Inkscape::XML::Node* repr) override; + void release() override; + + void set(SPAttr key, char const* value) override; + + Inkscape::XML::Node* write(Inkscape::XML::Document* doc, Inkscape::XML::Node* repr, unsigned int flags) override; +}; + +} // namespace Inkscape + +MAKE_SP_OBJECT_TYPECHECK_FUNCTIONS(IS_COLORPROFILE, Inkscape::ColorProfile) + +#endif // !SEEN_COLOR_PROFILE_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : |