18#include <QStandardPaths>
20#include <klocalizedstring.h>
22#include <kpluginfactory.h>
82 quint32 numberOfChannels = src->channelCount();
94 KisImageBarrierLock lock(image);
107 qint32 channelSize = ch->
size();
108 qint32 channelPos = ch->
pos();
112 if (channelToColor) {
126 paintDevices.push_back(dev);
131 for (qint32 row = 0; row <
rect.height(); ++row) {
133 if (channelToColor) {
146 if (channelSize == 1 && destSize == 1) {
149 dstIt->rawData()[0] = srcIt->
oldRawData()[channelPos];
156 }
else if (channelSize == 2 && destSize == 2) {
159 dstIt->rawData()[0] = srcIt->
oldRawData()[channelPos];
160 dstIt->rawData()[1] = srcIt->
oldRawData()[channelPos + 1];
167 }
else if (channelSize != 1 && destSize == 1) {
172 }
else if (channelSize != 2 && destSize == 2) {
181 }
while (dstIt->nextPixel() && srcIt->
nextPixel());
187 progressUpdater->
setProgress((i * 100) / numberOfChannels);
193 vKisPaintDeviceSP::const_iterator paintDeviceIterator = paintDevices.cbegin();
210 QBitArray channelFlags(channels.count());
213 channelFlags.setBit(i, (it == it2));
220 ++paintDeviceIterator;
const KoID GrayAColorModelID("GRAYA", ki18n("Grayscale/Alpha"))
const KoID Integer8BitsColorDepthID("U8", ki18n("8-bit integer/channel"))
const KoID Integer16BitsColorDepthID("U16", ki18n("16-bit integer/channel"))
const quint8 OPACITY_OPAQUE_U8
#define downscale(quantum)
virtual const quint8 * oldRawData() const =0
virtual bool nextPixel()=0
void separate(KoUpdater *progress, enumSepAlphaOptions alphaOps, enumSepSource sourceOps, bool downscale, bool toColor, bool activateCurrentChannel)
KisChannelSeparator(KisViewManager *view)
KisViewManager * m_viewManager
KisGroupLayerSP rootLayer() const
KisPaintDeviceSP projection() const
QRect bounds() const override
void addNode(KisNodeSP node, KisNodeSP parent, KisNodeSP aboveThis, KisImageLayerAddCommand::Flags flags=KisImageLayerAddCommand::DoRedoUpdates|KisImageLayerAddCommand::DoUndoUpdates)
void beginMacro(const KUndo2MagicString ¯oName)
KisHLineIteratorSP createHLineIteratorNG(qint32 x, qint32 y, qint32 w)
const KoColorSpace * colorSpace() const
KisPaintDeviceSP activeDevice()
Convenience method to get at the active paint device.
KisImageWSP image() const
Return the image this view is displaying.
@ ALPHA
The channel represents the opacity of a pixel.
enumChannelType channelType() const
virtual void setOpacity(quint8 *pixels, quint8 alpha, qint32 nPixels) const =0
QList< KoChannelInfo * > channels
virtual quint8 scaleToU8(const quint8 *srcPixel, qint32 channelPos) const =0
virtual void singleChannelPixel(quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex) const =0
virtual quint8 opacityU8(const quint8 *pixel) const =0
void setProgress(int percent)
@ COPY_ALPHA_TO_SEPARATIONS
@ CREATE_ALPHA_SEPARATION
KUndo2MagicString kundo2_i18n(const char *text)
virtual void setChannelFlags(const QBitArray &channelFlags)
static KoColorSpaceRegistry * instance()