krita

kis_channelinfo.h

00001 /*
00002  *  Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program 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
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 #ifndef KIS_CHANNELINFO_H_
00019 #define KIS_CHANNELINFO_H_
00020 
00021 #include <qcolor.h>
00022 #include "qstring.h"
00023 #include "ksharedptr.h"
00024 
00030 class KisChannelInfo : public KShared {
00031 public:
00032     enum enumChannelType {
00033         COLOR, // The channel represents a color
00034         ALPHA, // The channel represents the opacity of a pixel
00035         SUBSTANCE, // The channel represents a real-world substance like pigments or medium
00036         SUBSTRATE // The channel represents a real-world painting substrate like a canvas
00037     };
00038     
00039     enum enumChannelValueType {
00040         UINT8,
00041         UINT16,
00042         FLOAT16,
00043         FLOAT32,
00044         INT8,
00045         INT16,
00046         OTHER // Use this if the channel is neither an integer or a float
00047     };
00048     enum enumChannelFlags {
00049         FLAG_COLOR = 1,
00050         FLAG_ALPHA = (1 << 1),
00051         FLAG_SUBSTANCE = (1 << 2),
00052         FLAG_SUBSTRATE = (1 << 3),
00053         FLAG_COLOR_AND_ALPHA = FLAG_ALPHA | FLAG_COLOR // HACK to be able to use convolution of color and alpha at the same time
00054     };
00055 
00056 public:
00057     KisChannelInfo() { };
00067     KisChannelInfo( const QString & name, const QString & abbrev, Q_INT32 npos, enumChannelType channelType, enumChannelValueType channelValueType, Q_INT32 size = 1, QColor color = QColor(0,0,0))
00068         : m_name (name), m_abbrev(abbrev), m_pos (npos), m_channelType(channelType), m_channelValueType(channelValueType), m_size(size), m_color(color) { };
00069 public:
00073     inline QString name() const { return m_name; };
00074 
00078     inline QString abbrev() const { return m_abbrev; };
00082     inline Q_INT32 pos() const { return m_pos; };
00083     
00087     inline Q_INT32 size() const { return m_size; };
00088 
00092     inline enumChannelType channelType() const { return m_channelType; };
00096     inline enumChannelValueType channelValueType() const { return m_channelValueType; };
00101     inline QColor color() const { return m_color; }
00102 
00103 private:
00104 
00105     QString m_name;
00106     QString m_abbrev;
00107     Q_INT32 m_pos;
00108     enumChannelType m_channelType;
00109     enumChannelValueType m_channelValueType;
00110     Q_INT32 m_size;
00111     QColor m_color;
00112 
00113 };
00114 
00115 #endif // KIS_CHANNELINFO_H_
KDE Home | KDE Accessibility Home | Description of Access Keys