diff options
author | Michele Calgaro <[email protected]> | 2021-05-23 20:48:35 +0900 |
---|---|---|
committer | Michele Calgaro <[email protected]> | 2021-05-29 15:16:28 +0900 |
commit | 8b78a8791bc539bcffe7159f9d9714d577cb3d7d (patch) | |
tree | 1328291f966f19a22d7b13657d3f01a588eb1083 /chalk/core/kis_paintop.cc | |
parent | 95834e2bdc5e01ae1bd21ac0dfa4fa1d2417fae9 (diff) | |
download | koffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.tar.gz koffice-8b78a8791bc539bcffe7159f9d9714d577cb3d7d.zip |
Renaming of files in preparation for code style tools.
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'chalk/core/kis_paintop.cc')
-rw-r--r-- | chalk/core/kis_paintop.cc | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/chalk/core/kis_paintop.cc b/chalk/core/kis_paintop.cc deleted file mode 100644 index 59cfef6b..00000000 --- a/chalk/core/kis_paintop.cc +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2002 Patrick Julien <[email protected]> - * Copyright (c) 2004 Boudewijn Rempt <[email protected]> - * Copyright (c) 2004 Clarence Dang <[email protected]> - * Copyright (c) 2004 Adrian Page <[email protected]> - * Copyright (c) 2004 Cyrille Berger <[email protected]> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -#include "tqwidget.h" -#include "kis_painter.h" -#include "kis_layer.h" -#include "kis_types.h" -#include "kis_paintop.h" -#include "kis_alpha_mask.h" -#include "kis_point.h" -#include "kis_colorspace.h" -#include "kis_global.h" -#include "kis_iterators_pixel.h" -#include "kis_color.h" - -KisPaintOp::KisPaintOp(KisPainter * painter) - : m_dab(0) -{ - m_painter = painter; - setSource(painter->device()); -} - -KisPaintOp::~KisPaintOp() -{ -} - -KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask) { - return computeDab(mask, m_painter->device()->colorSpace()); -} - -KisPaintDeviceSP KisPaintOp::computeDab(KisAlphaMaskSP mask, KisColorSpace *cs) -{ - // XXX: According to the SeaShore source, the Gimp uses a - // temporary layer the size of the layer that is being painted - // on. This layer is cleared between painting actions. Our - // temporary layer, dab, is for every paintAt, composited with - // the target layer. We only use a real temporary layer for things - // like filter tools. - - if(!m_dab || m_dab->colorSpace() != cs) - m_dab = new KisPaintDevice(cs, "dab"); - TQ_CHECK_PTR(m_dab); - - KisColor kc = m_painter->paintColor(); - - KisColorSpace * colorSpace = m_dab->colorSpace(); - - TQ_INT32 pixelSize = colorSpace->pixelSize(); - - TQ_INT32 maskWidth = mask->width(); - TQ_INT32 maskHeight = mask->height(); - - // Convert the kiscolor to the right colorspace. - kc.convertTo(colorSpace); - - KisHLineIteratorPixel hiter = m_dab->createHLineIterator(0, 0, maskWidth, true); - for (int y = 0; y < maskHeight; y++) - { - int x=0; - while(! hiter.isDone()) - { - // XXX: Set mask - colorSpace->setAlpha(kc.data(), mask->alphaAt(x++, y), 1); - memcpy(hiter.rawData(), kc.data(), pixelSize); - ++hiter; - } - hiter.nextRow(); - } - - return m_dab; -} - -void KisPaintOp::splitCoordinate(double coordinate, TQ_INT32 *whole, double *fraction) -{ - TQ_INT32 i = static_cast<TQ_INT32>(coordinate); - - if (coordinate < 0) { - // We always want the fractional part to be positive. - // E.g. -1.25 becomes -2 and +0.75 - i--; - } - - double f = coordinate - i; - - *whole = i; - *fraction = f; -} - -void KisPaintOp::setSource(KisPaintDeviceSP p) { - Q_ASSERT(p); - m_source = p; -} - - -KisPaintOpSettings* KisPaintOpFactory::settings(TQWidget* /*parent*/, const KisInputDevice& /*inputDevice*/) { return 0; } |