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     enum enumChannelValueType {
00039         UINT8,
00040         UINT16,
00041         FLOAT16,
00042         FLOAT32,
00043         INT8,
00044         INT16,
00045         OTHER // Use this if the channel is neither an integer or a float
00046     };
00047     enum enumChannelFlags {
00048         FLAG_COLOR = 1,
00049         FLAG_ALPHA = (1 << 1),
00050         FLAG_SUBSTANCE = (1 << 2),
00051         FLAG_SUBSTRATE = (1 << 3)
00052     };
00053 
00054 public:
00055     KisChannelInfo() { };
00056     KisChannelInfo( const QString & name, Q_INT32 npos, enumChannelType channelType, enumChannelValueType channelValueType, Q_INT32 size = 1, QColor color = QColor(0,0,0))
00057     : m_name (name), m_pos (npos), m_channelType(channelType), m_channelValueType(channelValueType), m_size(size), m_color(color) { };
00058 public:
00062     inline QString name() const { return m_name; };
00063     
00067     inline Q_INT32 pos() const { return m_pos; };
00068     
00072     inline Q_INT32 size() const { return m_size; };
00073 
00077     inline enumChannelType channelType() const { return m_channelType; };
00081     inline enumChannelValueType channelValueType() const { return m_channelValueType; };
00086     inline QColor color() const { return m_color; }
00087 
00088 private:
00089 
00090     QString m_name;
00091     Q_INT32 m_pos;
00092     enumChannelType m_channelType;
00093     enumChannelValueType m_channelValueType;
00094     Q_INT32 m_size;
00095     QColor m_color;
00096 
00097 };
00098 
00099 #endif // KIS_CHANNELINFO_H_
KDE Home | KDE Accessibility Home | Description of Access Keys