|
Krita Source Code Documentation
|
#include <Channel.h>
Inheritance diagram for Channel:Classes | |
| struct | Private |
Public Member Functions | |
| QRect | bounds () const |
| Channel (KisNodeSP node, KoChannelInfo *channel, QObject *parent=0) | |
| int | channelSize () const |
| QString | name () const |
| bool | operator!= (const Channel &other) const |
| bool | operator== (const Channel &other) const |
| QByteArray | pixelData (const QRect &rect) const |
| int | position () const |
| void | setPixelData (QByteArray value, const QRect &rect) |
| setPixelData writes the given data to the relevant channel in the Node. This is only possible for Nodes that have a paintDevice, so nothing will happen when trying to write to e.g. a group layer. | |
| void | setVisible (bool value) |
| setvisible set the visibility of the channel to the given value. | |
| bool | visible () const |
| visible checks whether this channel is visible in the node | |
| ~Channel () override | |
Private Attributes | |
| Private *const | d |
A Channel represents a single channel in a Node. Krita does not use channels to store local selections: these are strictly the color and alpha channels.
|
explicit |
Definition at line 33 of file Channel.cpp.
References Channel::Private::channel, d, and Channel::Private::node.
|
override |
| QRect Channel::bounds | ( | ) | const |
Definition at line 115 of file Channel.cpp.
References Channel::Private::channel, KoColorSpace::colorDepthId(), KisBaseNode::colorSpace(), d, KisBaseNode::exactBounds(), KisPaintDevice::exactBounds(), Float16BitsColorDepthID, Float32BitsColorDepthID, KoColorSpaceRegistry::instance(), Integer16BitsColorDepthID, Integer8BitsColorDepthID, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), Channel::Private::node, KoChannelInfo::pos(), KisBaseNode::projection(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst(), and KoChannelInfo::size().
| int Channel::channelSize | ( | ) | const |
Definition at line 110 of file Channel.cpp.
References Channel::Private::channel, d, and KoChannelInfo::size().
| QString Channel::name | ( | ) | const |
Definition at line 100 of file Channel.cpp.
References Channel::Private::channel, d, and KoChannelInfo::name().
| bool Channel::operator!= | ( | const Channel & | other | ) | const |
| bool Channel::operator== | ( | const Channel & | other | ) | const |
Definition at line 47 of file Channel.cpp.
References Channel::Private::channel, d, and Channel::Private::node.
| QByteArray Channel::pixelData | ( | const QRect & | rect | ) | const |
Read the values of the channel into the a byte array for each pixel in the rect from the Node this channel is part of, and returns it.
Note that if Krita is built with OpenEXR and the Node has the 16 bits floating point channel depth type, Krita returns 32 bits float for every channel; the libkis scripting API does not support half.
Definition at line 153 of file Channel.cpp.
References Channel::Private::channel, KoColorSpace::colorDepthId(), KisBaseNode::colorSpace(), d, Float16BitsColorDepthID, Float32BitsColorDepthID, Integer16BitsColorDepthID, Integer8BitsColorDepthID, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), Channel::Private::node, KoChannelInfo::pos(), KisBaseNode::projection(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawDataConst(), and v.
| int Channel::position | ( | ) | const |
Definition at line 105 of file Channel.cpp.
References Channel::Private::channel, d, and KoChannelInfo::pos().
| void Channel::setPixelData | ( | QByteArray | value, |
| const QRect & | rect ) |
setPixelData writes the given data to the relevant channel in the Node. This is only possible for Nodes that have a paintDevice, so nothing will happen when trying to write to e.g. a group layer.
Note that if Krita is built with OpenEXR and the Node has the 16 bits floating point channel depth type, Krita expects to be given a 4 byte, 32 bits float for every channel; the libkis scripting API does not support half.
| value | a byte array with exactly enough bytes. |
| rect | the rectangle to write the bytes into |
Definition at line 197 of file Channel.cpp.
References Channel::Private::channel, KoColorSpace::colorDepthId(), KisBaseNode::colorSpace(), d, Float16BitsColorDepthID, Float32BitsColorDepthID, Integer16BitsColorDepthID, Integer8BitsColorDepthID, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), Channel::Private::node, KisBaseNode::paintDevice(), KoChannelInfo::pos(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), v, and value().
| void Channel::setVisible | ( | bool | value | ) |
setvisible set the visibility of the channel to the given value.
Definition at line 77 of file Channel.cpp.
References Channel::Private::channel, KisLayer::channelFlags, KoColorSpace::channels, KisBaseNode::colorSpace(), d, KisSharedPtr< T >::data(), Channel::Private::node, KisLayer::setChannelFlags(), and value().
| bool Channel::visible | ( | ) | const |
visible checks whether this channel is visible in the node
Definition at line 59 of file Channel.cpp.
References Channel::Private::channel, KisLayer::channelFlags, KoColorSpace::channels, KisBaseNode::colorSpace(), d, KisSharedPtr< T >::data(), and Channel::Private::node.