krita

kis_profile.h

00001 /*
00002  *  kis_profile.h - part of Krayon
00003  *
00004  *  Copyright (c) 2000 Matthias Elter  <elter@kde.org>
00005  *                2004 Boudewijn Rempt <boud@valdyas.org>
00006  *
00007  *  This program is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef KIS_PROFILE_H
00023 #define KIS_PROFILE_H
00024 
00025 #include <config.h>
00026 
00027 #include LCMS_HEADER
00028 
00029 #include <qvaluevector.h>
00030 #include <qcstring.h>
00031 
00032 #include <kio/job.h>
00033 
00034 #include <kis_annotation.h>
00035 
00036 //XXX: Profiles should be loaded by the color strategies
00037 //     and be available only through the color strategy
00038 //     that matches the profile's color model
00039 class KisProfile {
00040 
00041 public:
00042     KisProfile(QByteArray rawData);
00043     KisProfile(const QString& file);
00044     KisProfile(const cmsHPROFILE profile);
00045 
00046     virtual ~KisProfile();
00047 
00048     virtual bool load();
00049     virtual bool save();
00050 
00051     inline icColorSpaceSignature colorSpaceSignature() const { return m_colorSpaceSignature; }
00052     inline icProfileClassSignature deviceClass() const { return m_deviceClass; }
00053     inline QString productName() const { return m_productName; }
00054     inline QString productDescription() const { return m_productDescription; }
00055     inline QString productInfo() const { return m_productInfo; }
00056     inline QString manufacturer() const { return m_manufacturer; }
00057     cmsHPROFILE profile();
00058 
00059     KisAnnotationSP annotation() const;
00060 
00061     friend inline bool operator==( const KisProfile &,  const KisProfile & );
00062 
00063     inline bool valid() const { return m_valid; };
00064     
00065     inline bool isSuitableForOutput() { return m_suitableForOutput; };
00066 
00067     inline QString filename() const { return m_filename; }
00068 
00069 public:
00070 
00071     static KisProfile *  getScreenProfile(int screen = -1);
00072 
00073 private:
00074     bool init();
00075 
00076     cmsHPROFILE m_profile;
00077     icColorSpaceSignature m_colorSpaceSignature;
00078     icProfileClassSignature m_deviceClass;
00079     QString m_productName;
00080     QString m_productDescription;
00081     QString m_productInfo;
00082     QString m_manufacturer;
00083 
00084     QByteArray m_rawData;
00085 
00086     QString m_filename;
00087     bool m_valid;
00088     bool m_suitableForOutput;
00089 
00090 };
00091 
00092 inline bool operator==( const KisProfile & p1,  const KisProfile & p2 )
00093 {
00094     return p1.m_profile == p2.m_profile;
00095 }
00096 
00097 #endif // KIS_PROFILE_H
00098 
KDE Home | KDE Accessibility Home | Description of Access Keys