00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KOCOLORPROFILE_H
00024 #define KOCOLORPROFILE_H
00025
00026 #include <config.h>
00027
00028 #include <lcms.h>
00029
00030 #include <q3valuevector.h>
00031
00032 #include <kio/job.h>
00033
00034 #include <koffice_export.h>
00035
00039 class PIGMENT_EXPORT KoColorProfile {
00040
00041 public:
00047 KoColorProfile(QByteArray rawData);
00053 KoColorProfile(const QString& file);
00057 KoColorProfile(const cmsHPROFILE profile);
00058
00059 virtual ~KoColorProfile();
00060
00065 virtual bool load();
00070 virtual bool save();
00071
00075 inline icColorSpaceSignature colorSpaceSignature() const { return m_colorSpaceSignature; }
00079 inline icProfileClassSignature deviceClass() const { return m_deviceClass; }
00083 inline QString productName() const { return m_productName; }
00087 inline QString productDescription() const { return m_productDescription; }
00091 inline QString productInfo() const { return m_productInfo; }
00095 inline QString manufacturer() const { return m_manufacturer; }
00096
00100 cmsHPROFILE profile();
00101
00102 friend inline bool operator==( const KoColorProfile &, const KoColorProfile & );
00103
00108 inline bool valid() const { return m_valid; };
00109
00114 inline bool isSuitableForOutput() { return m_suitableForOutput; };
00115
00120 inline QString filename() const { return m_filename; }
00121
00125 inline QByteArray rawData() const { return m_rawData; }
00126
00127 public:
00131 static KoColorProfile * getScreenProfile(int screen = -1);
00132
00133 private:
00134 bool init();
00135
00136 cmsHPROFILE m_profile;
00137 icColorSpaceSignature m_colorSpaceSignature;
00138 icProfileClassSignature m_deviceClass;
00139 QString m_productName;
00140 QString m_productDescription;
00141 QString m_productInfo;
00142 QString m_manufacturer;
00143
00144 QByteArray m_rawData;
00145
00146 QString m_filename;
00147 bool m_valid;
00148 bool m_suitableForOutput;
00149
00150 };
00151
00152 inline bool operator==( const KoColorProfile & p1, const KoColorProfile & p2 )
00153 {
00154 return p1.m_profile == p2.m_profile;
00155 }
00156
00157 #endif // KOCOLORPROFILE_H
00158