Commit 8eda6238 authored by Silvio Heinrich's avatar Silvio Heinrich
Browse files

Removed the Atop blending mode (KoCompositeOpAtop.h).

It was removed because the same result can be archived by disabling
the alpha channel for the specific layer.
parent 72f7c8e0
......@@ -44,7 +44,6 @@ KisCompositeOpsModel::KisCompositeOpsModel(const QList<KoCompositeOp*>& list, co
COMPOSITE_ALPHA_DARKEN <<
COMPOSITE_IN <<
COMPOSITE_OUT <<
COMPOSITE_ATOP <<
COMPOSITE_XOR <<
COMPOSITE_PLUS <<
COMPOSITE_MINUS <<
......
......@@ -30,7 +30,6 @@ const QString COMPOSITE_OVER = "normal";
const QString COMPOSITE_ERASE = "erase";
const QString COMPOSITE_IN = "in";
const QString COMPOSITE_OUT = "out";
const QString COMPOSITE_ATOP = "atop";
const QString COMPOSITE_ALPHA_DARKEN = "alphadarken";
const QString COMPOSITE_XOR = "xor";
......
/*
* Copyright (c) 2011 Silvio Heinrich <plassy@web.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef _KOCOMPOSITEO_ATOP_H_
#define _KOCOMPOSITEO_ATOP_H_
#include "KoCompositeOpFunctions.h"
#include "KoCompositeOpBase.h"
template<class Traits>
class KoCompositeOpAtop: public KoCompositeOpBase< Traits, KoCompositeOpAtop<Traits> >
{
typedef KoCompositeOpBase< Traits, KoCompositeOpAtop<Traits> > base_class;
typedef typename Traits::channels_type channels_type;
static const qint32 channels_nb = Traits::channels_nb;
static const qint32 alpha_pos = Traits::alpha_pos;
public:
KoCompositeOpAtop(const KoColorSpace* cs, const QString& category, bool userVisible=true)
: base_class(cs, COMPOSITE_ATOP, i18n("Atop"), category, userVisible) { }
public:
template<bool alphaLocked, bool allChannelFlags>
inline static channels_type composeColorChannels(const channels_type* src, channels_type srcAlpha,
channels_type* dst, channels_type dstAlpha,
channels_type opacity, const QBitArray& channelFlags) {
using namespace Arithmetic;
srcAlpha = mul(srcAlpha, opacity);
if(dstAlpha != KoColorSpaceMathsTraits<channels_type>::zeroValue) {
for(qint32 i=0; i <channels_nb; i++) {
if(i != alpha_pos && (allChannelFlags || channelFlags.testBit(i)))
dst[i] = lerp(dst[i], src[i], srcAlpha);
}
}
return dstAlpha;
}
};
#endif // _KOCOMPOSITEO_ATOP_H_
......@@ -32,7 +32,6 @@
#include "compositeops/KoCompositeOpAlphaDarken.h"
#include "compositeops/KoCompositeOpErase.h"
#include "compositeops/KoCompositeOpCopy2.h"
#include "compositeops/KoCompositeOpAtop.h"
#include "compositeops/KoCompositeOpDissolve.h"
namespace _Private {
......@@ -59,7 +58,6 @@ struct AddGeneralOps<Traits, true>
cs->addCompositeOp(new KoCompositeOpAlphaDarken<Traits>(cs));
cs->addCompositeOp(new KoCompositeOpCopy2<Traits>(cs));
cs->addCompositeOp(new KoCompositeOpErase<Traits>(cs));
cs->addCompositeOp(new KoCompositeOpAtop<Traits>(cs, KoCompositeOp::categoryMix()));
add<&cfOverlay> (cs, COMPOSITE_OVERLAY , i18n("Overlay") , KoCompositeOp::categoryMix());
add<&cfGrainMerge> (cs, COMPOSITE_GRAIN_MERGE , i18n("Grain Merge") , KoCompositeOp::categoryMix());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment