From 2785103a6bd4de55bd26d79e34d0fdd4b329a73a Mon Sep 17 00:00:00 2001 From: tpearson Date: Sun, 26 Jun 2011 00:29:37 +0000 Subject: Remove krita* in preparation for name switch from Krita to Chalk git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238361 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- krita/core/kis_boundary.cc | 83 ---------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 krita/core/kis_boundary.cc (limited to 'krita/core/kis_boundary.cc') diff --git a/krita/core/kis_boundary.cc b/krita/core/kis_boundary.cc deleted file mode 100644 index 0c9681c2..00000000 --- a/krita/core/kis_boundary.cc +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2005 Bart Coppens - * - * 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 -#include - -#include "kis_colorspace.h" -#include "kis_iterators_pixel.h" -#include "kis_paint_device.h" -#include "kis_boundary.h" - -KisBoundary::KisBoundary(KisPaintDevice* dev) { - m_device = dev; - m_fuzzyness = 255 / 2; -} - -bool KisBoundary::isDark(TQ_UINT8 val) { - return val < m_fuzzyness; -} - -void KisBoundary::generateBoundary(int w, int h) { - if (!m_device) - return; - - KisColorSpace* cs = m_device->colorSpace(); - - //Qt::Horizontal - for (int currentY = - 1; currentY < h; currentY++) { - KisHLineIteratorPixel topIt = m_device->createHLineIterator(0, currentY, w, false); - KisHLineIteratorPixel botIt = m_device->createHLineIterator(0, currentY + 1, w, false); - bool darkTop; - bool darkBot; - - m_horSegments.append(TQValueList()); - - while (!topIt.isDone()) { - darkTop = cs->getAlpha(topIt.rawData()); - darkBot = cs->getAlpha(botIt.rawData()); - if (darkTop != darkBot) { - // detected a change - m_horSegments.back().append(tqMakePair(KisPoint(botIt.x(), botIt.y()), 1)); - } - ++topIt; - ++botIt; - } - } - - //Qt::Vertical - for (int currentX = - 1; currentX < w; currentX++) { - KisVLineIteratorPixel leftIt = m_device->createVLineIterator(currentX, 0, h, false); - KisVLineIteratorPixel rightIt = m_device->createVLineIterator(currentX + 1, 0, h, false); - bool darkLeft; - bool darkRight; - - m_vertSegments.append(TQValueList()); - - while (!leftIt.isDone()) { - darkLeft = cs->getAlpha(leftIt.rawData()); - darkRight = cs->getAlpha(rightIt.rawData()); - if (darkLeft != darkRight) { - // detected a change - m_vertSegments.back().append(tqMakePair(KisPoint(rightIt.x(), rightIt.y()), 1)); - } - ++leftIt; - ++rightIt; - } - } -} - -- cgit v1.2.1