F:/KPlato/koffice/libs/pigment/KoColor.h

Aller à la documentation de ce fichier.
00001 /*
00002  *  Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Library General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Library General Public License
00015  * along with this library; see the file COPYING.LIB.  If not, write to
00016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 #ifndef KOCOLOR_H
00020 #define KOCOLOR_H
00021 
00022 #include <QColor>
00023 #include <QMetaType>
00024 
00025 #include <koffice_export.h>
00026 
00027 #include "KoColorProfile.h"
00028 #include "KoColorSpace.h"
00029 
00030 
00035 class PIGMENT_EXPORT KoColor {
00036 
00037 public:
00039     KoColor();
00040 
00041     virtual ~KoColor();
00042 
00045     KoColor(const QColor & color, KoColorSpace * colorSpace);
00046 
00049     KoColor(const QColor & color, quint8 alpha, KoColorSpace * colorSpace);
00050 
00052     KoColor(const quint8 * data, KoColorSpace * colorSpace);
00053 
00055     KoColor(const KoColor &src, KoColorSpace * colorSpace);
00056 
00058     KoColor(const KoColor & rhs);
00059 
00061     KoColor &operator=(const KoColor &);
00062 
00064     quint8 * data() const { return m_data; }
00065 
00066     KoColorSpace * colorSpace() const { return m_colorSpace; }
00067 
00068     KoColorProfile *  profile() const { return m_colorSpace->getProfile(); }
00069 
00072     void convertTo(KoColorSpace * cs);
00073 
00075     void setColor(quint8 * data, KoColorSpace * colorSpace = 0);
00076 
00078     void toQColor(QColor *c) const;
00079     void toQColor(QColor *c, quint8 *opacity) const;
00080 
00081     QColor toQColor() const;
00082 
00083     void dump() const;
00084 
00085 private:
00086 
00087     quint8 * m_data;
00088 
00089     KoColorSpace * m_colorSpace;
00090 };
00091 
00092 Q_DECLARE_METATYPE( KoColor )
00093 
00094 #endif

Généré le Wed Nov 22 23:41:13 2006 pour KPlato par  doxygen 1.5.1-p1