Krita Source Code Documentation
Loading...
Searching...
No Matches
virtual_channel_info.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8#include <klocalizedstring.h>
9
10#include <KoColorSpace.h>
11
12
14 : m_type(LIGHTNESS),
15 m_pixelIndex(-1),
16 m_realChannelInfo(0)
17{
18}
19
21 int pixelIndex,
22 KoChannelInfo *realChannelInfo,
23 const KoColorSpace *cs)
24 : m_type(type),
25 m_pixelIndex(pixelIndex),
26 m_realChannelInfo(realChannelInfo)
27{
28 if (m_type == HUE) {
29 m_nameOverride = i18n("Hue");
32 } else if (m_type == SATURATION) {
33 m_nameOverride = i18n("Saturation");
36 } else if (m_type == LIGHTNESS) {
37 m_nameOverride = i18nc("Lightness HSI", "Lightness");
40 } else if (m_type == ALL_COLORS) {
41 const QList<KoChannelInfo*> channels = cs->channels();
42
44 m_valueTypeOverride = channels.first()->channelValueType();
45 m_channelSizeOverride = channels.first()->size();
46 }
47}
48
52
56
57QString VirtualChannelInfo::name() const {
59}
60
62 return m_pixelIndex;
63}
64
68
72
@ ALPHA
The channel represents the opacity of a pixel.
qint32 size() const
enumChannelValueType
enum to define the value of the channel
@ FLOAT32
use this for a float 32bits channel
enumChannelType channelType() const
enumChannelValueType channelValueType() const
QString name() const
QList< KoChannelInfo * > channels
virtual KoID colorModelId() const =0
QString id() const
Definition KoID.cpp:63
KoChannelInfo * channelInfo() const
KoChannelInfo * m_realChannelInfo
KoChannelInfo::enumChannelValueType m_valueTypeOverride
KoChannelInfo::enumChannelValueType valueType() const