Krita Source Code Documentation
Loading...
Searching...
No Matches
KoCompositeOpDestinationIn.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com>
3 * SPDX-FileCopyrightText: 2012 José Luis Vergara <pentalis@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6*/
7
8#ifndef _KOCOMPOSITEOPDESTINATIONIN_H_
9#define _KOCOMPOSITEOPDESTINATIONIN_H_
10
11#include "KoCompositeOpBase.h"
12
18template<class CS_Traits>
19class KoCompositeOpDestinationIn : public KoCompositeOpBase<CS_Traits, KoCompositeOpDestinationIn<CS_Traits> >
20{
22 typedef typename CS_Traits::channels_type channels_type;
23
24 static const qint8 channels_nb = CS_Traits::channels_nb;
25 static const qint8 alpha_pos = CS_Traits::alpha_pos;
26
27public:
30
31public:
32 template<bool alphaLocked, bool allChannelFlags>
34 channels_type* dst, channels_type dstAlpha,
35 channels_type maskAlpha, channels_type opacity,
36 const QBitArray& channelFlags ) {
37 using namespace Arithmetic;
38 Q_UNUSED(src);
39 Q_UNUSED(dst);
40 Q_UNUSED(channelFlags);
41
42 channels_type appliedAlpha = mul(maskAlpha, srcAlpha, opacity);
43
44 channels_type newDstAlpha = mul(dstAlpha, appliedAlpha);
45
46 return newDstAlpha;
47 }
48};
49
50#endif // _KOCOMPOSITEOPDESTINATIONIN_H_
const QString COMPOSITE_DESTINATION_IN
KoCompositeOpDestinationIn(const KoColorSpace *cs)
KoCompositeOpBase< CS_Traits, KoCompositeOpDestinationIn< CS_Traits > > base_class
static channels_type composeColorChannels(const channels_type *src, channels_type srcAlpha, channels_type *dst, channels_type dstAlpha, channels_type maskAlpha, channels_type opacity, const QBitArray &channelFlags)
CS_Traits::channels_type channels_type
static QString categoryMix()