1 /* This file is part of the KDE project
2  *  Copyright (c) 2010 Cyrille Berger <cberger@cberger.net>
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2 of the License, or
7  *  (at your option) any later version.
8  *
9  *  This program is distributed in the hope that it will be useful,
10  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  */
18 
19 #ifndef _KISBASEACCESSOR_H_
20 #define _KISBASEACCESSOR_H_
21 
22 #include <kritaimage_export.h>
23 #include <kis_shared.h>
24 
25 class KRITAIMAGE_EXPORT KisBaseConstAccessor : public KisShared
26 {
Q_DISABLE_COPY(KisBaseConstAccessor)27     Q_DISABLE_COPY(KisBaseConstAccessor)
28 public:
29     KisBaseConstAccessor() {}
30     virtual ~KisBaseConstAccessor();
31     /**
32      * @return a pointer to the pixel data as it was at the moment of the last memento creation.
33      */
34     virtual const quint8 * oldRawData() const = 0;
35 
36     /**
37      * @return a pointer to the most actual pixel data,
38      * this points to te same data as rawData() method of
39      * a writable accessor
40      */
41     virtual const quint8 * rawDataConst() const = 0;
42 
43     virtual qint32 x() const = 0;
44     virtual qint32 y() const = 0;
45 };
46 
47 class KRITAIMAGE_EXPORT KisBaseAccessor
48 {
Q_DISABLE_COPY(KisBaseAccessor)49     Q_DISABLE_COPY(KisBaseAccessor)
50 public:
51     KisBaseAccessor() {}
52     virtual ~KisBaseAccessor();
53     /**
54      * @return a pointer to the pixel data. Do NOT interpret the data - leave that to a colorspace
55      */
56     virtual quint8 * rawData() = 0;
57 };
58 
59 #endif
60