Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_fill_interval.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_FILL_INTERVAL_H
8#define __KIS_FILL_INTERVAL_H
9
10
11#include <boost/operators.hpp>
12#include "kis_global.h"
13
14
15class KisFillInterval : private boost::equality_comparable1<KisFillInterval>
16{
17public:
19 : start(0),
20 end(-1),
21 row(-1)
22 {
23 }
24
25 KisFillInterval(int _start, int _end, int _row)
26 : start(_start),
27 end(_end),
28 row(_row)
29 {
30 }
31
32 inline void invalidate() {
33 end = start - 1;
34 }
35
36 inline bool operator==(const KisFillInterval &rhs) const {
37 return start == rhs.start && end == rhs.end && row == rhs.row;
38 }
39
40 inline int width() const {
41 return end - start + 1;
42 }
43
44 inline bool isValid() const {
45 return end >= start;
46 }
47
48 int start;
49 int end;
50 int row;
51};
52
53#include <kis_debug.h>
54inline QDebug operator<<(QDebug dbg, const KisFillInterval& i)
55{
56#ifndef NODEBUG
57 dbg.nospace() << "KisFillInterval(" << i.start << ".." << i.end << "; " << i.row << ")";
58#endif
59 return dbg;
60}
61
62#endif /* __KIS_FILL_INTERVAL_H */
bool operator==(const KisFillInterval &rhs) const
KisFillInterval(int _start, int _end, int _row)
bool isValid() const
QDebug operator<<(QDebug dbg, const KisFillInterval &i)