chalk

kis_profile.h
1/*
2 * kis_profile.h - part of Krayon
3 *
4 * Copyright (c) 2000 Matthias Elter <elter@kde.org>
5 * 2004 Boudewijn Rempt <boud@valdyas.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22#ifndef KIS_PROFILE_H
23#define KIS_PROFILE_H
24
25#include <config.h>
26
27#include LCMS_HEADER
28
29#include <tqvaluevector.h>
30#include <tqcstring.h>
31
32#include <tdeio/job.h>
33
34#include <kis_annotation.h>
35
36//XXX: Profiles should be loaded by the color strategies
37// and be available only through the color strategy
38// that matches the profile's color model
39class KisProfile {
40
41public:
42 KisProfile(TQByteArray rawData);
43 KisProfile(const TQString& file);
44 KisProfile(const cmsHPROFILE profile);
45
46 virtual ~KisProfile();
47
48 virtual bool load();
49 virtual bool save();
50
51 inline icColorSpaceSignature colorSpaceSignature() const { return m_colorSpaceSignature; }
52 inline icProfileClassSignature deviceClass() const { return m_deviceClass; }
53 inline TQString productName() const { return m_productName; }
54 inline TQString productDescription() const { return m_productDescription; }
55 inline TQString productInfo() const { return m_productInfo; }
56 inline TQString manufacturer() const { return m_manufacturer; }
57 cmsHPROFILE profile();
58
59 KisAnnotationSP annotation() const;
60
61 friend inline bool operator==( const KisProfile &, const KisProfile & );
62
63 inline bool valid() const { return m_valid; };
64
65 inline bool isSuitableForOutput() { return m_suitableForOutput; };
66
67 inline TQString filename() const { return m_filename; }
68
69public:
70
71 static KisProfile * getScreenProfile(int screen = -1);
72
73private:
74 bool init();
75
76 cmsHPROFILE m_profile;
77 icColorSpaceSignature m_colorSpaceSignature;
78 icProfileClassSignature m_deviceClass;
79 TQString m_productName;
80 TQString m_productDescription;
81 TQString m_productInfo;
82 TQString m_manufacturer;
83
84 TQByteArray m_rawData;
85
86 TQString m_filename;
87 bool m_valid;
88 bool m_suitableForOutput;
89
90};
91
92inline bool operator==( const KisProfile & p1, const KisProfile & p2 )
93{
94 return p1.m_profile == p2.m_profile;
95}
96
97#endif // KIS_PROFILE_H
98