chalk

kis_random_sub_accessor.h
1/*
2 * This file is part of the KDE project
3 *
4 * Copyright (c) 2006 Cyrille Berger <cberger@cberger.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KIS_CURVE_ITERATOR_H
21#define KIS_CURVE_ITERATOR_H
22
23#include "kis_point.h"
24#include "kis_random_accessor.h"
25#include "kis_types.h"
26
27class KisRandomSubAccessorPixel{
28 public:
29 KisRandomSubAccessorPixel(KisPaintDeviceSP device);
30 ~KisRandomSubAccessorPixel();
34 void sampledOldRawData(TQ_UINT8* dst);
35 void sampledRawData(TQ_UINT8* dst);
36 inline void moveTo(double x, double y) { m_currentPoint.setX(x); m_currentPoint.setY(y); }
37 inline void moveTo(const KisPoint& p ) { m_currentPoint = p; }
38 private:
39 KisPaintDeviceSP m_device;
40 int m_position, m_end;
41 KisPoint m_currentPoint;
42 KisRandomAccessorPixel m_randomAccessor;
43};
44
45#endif