krita

kis_iterators_pixel.cc

00001 /*
00002  * This file is part of the Krita project
00003  *
00004  *  Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 
00021 #include "kis_iterators_pixel.h"
00022 #include "kis_global.h"
00023 #include "kis_paint_device.h"
00024 
00025 KisHLineIteratorPixel::KisHLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 offsetx, Q_INT32 offsety, bool writable) :
00026     KisHLineIterator(dm, x - offsetx, y - offsety, w, writable),
00027     KisIteratorPixelTrait <KisHLineIterator> ( ndevice, this ),
00028     m_offsetx(offsetx), m_offsety(offsety)
00029 {
00030     if(sel_dm) {
00031         KisHLineIterator * i = new KisHLineIterator(sel_dm, x - offsetx, y - offsety, w, false);
00032         Q_CHECK_PTR(i);
00033         KisIteratorPixelTrait <KisHLineIterator>::setSelectionIterator(i);
00034     }
00035 }
00036 
00037 KisVLineIteratorPixel::KisVLineIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 h, Q_INT32 offsetx, Q_INT32 offsety, bool writable) :
00038     KisVLineIterator(dm, x - offsetx, y - offsety, h, writable),
00039     KisIteratorPixelTrait <KisVLineIterator> ( ndevice, this ),
00040     m_offsetx(offsetx), m_offsety(offsety)
00041 {
00042     if(sel_dm) {
00043         KisVLineIterator * i = new KisVLineIterator(sel_dm, x - offsetx, y - offsety, h, false);
00044         Q_CHECK_PTR(i);
00045         KisIteratorPixelTrait <KisVLineIterator>::setSelectionIterator(i);
00046     }
00047 }
00048 
00049 KisRectIteratorPixel::KisRectIteratorPixel( KisPaintDevice *ndevice, KisDataManager *dm, KisDataManager *sel_dm, Q_INT32 x, Q_INT32 y, Q_INT32 w, Q_INT32 h, Q_INT32 offsetx, Q_INT32 offsety, bool writable) :
00050     KisRectIterator(dm, x - offsetx, y - offsety, w, h, writable),
00051     KisIteratorPixelTrait <KisRectIterator> ( ndevice, this ),
00052     m_offsetx(offsetx), m_offsety(offsety)
00053 {
00054     if(sel_dm) {
00055         KisRectIterator * i = new KisRectIterator(sel_dm, x - offsetx, y - offsety, w, h, false);
00056         Q_CHECK_PTR(i);
00057         KisIteratorPixelTrait <KisRectIterator>::setSelectionIterator(i);
00058     }
00059 }
KDE Home | KDE Accessibility Home | Description of Access Keys