Changeset View
Changeset View
Standalone View
Standalone View
libs/libkis/Pattern.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2018 Wolthera van Hövell tot Westerflier <griffinvalley@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Lesser 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 Lesser 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 LIBKIS_PATTERN_H | ||||
20 | #define LIBKIS_PATTERN_H | ||||
21 | | ||||
22 | #include <QObject> | ||||
23 | #include "kritalibkis_export.h" | ||||
24 | #include "libkis.h" | ||||
25 | #include "Resource.h" | ||||
26 | #include "KoPattern.h" | ||||
27 | | ||||
28 | /** | ||||
29 | * @brief The Pattern class | ||||
30 | * wraps Krita patterns. | ||||
31 | * | ||||
32 | * @code | ||||
33 | import sys | ||||
34 | from krita import * | ||||
35 | | ||||
36 | for item in Application.allPatterns(): | ||||
37 | print (item.name()+" "+str(item.width())+"x"+str(item.height())) | ||||
38 | * @endcode | ||||
39 | */ | ||||
40 | | ||||
41 | class KRITALIBKIS_EXPORT Pattern : public Resource | ||||
42 | { | ||||
43 | public: | ||||
44 | explicit Pattern(KoResource *resource, QObject *parent = 0); | ||||
45 | ~Pattern() override; | ||||
46 | | ||||
47 | /** | ||||
48 | * @brief width | ||||
49 | * @return with of the pattern | ||||
50 | */ | ||||
51 | qint32 width() const; | ||||
52 | /** | ||||
53 | * @brief height | ||||
54 | * @return height of the pattern | ||||
55 | */ | ||||
56 | qint32 height() const; | ||||
57 | | ||||
58 | /** | ||||
59 | * @brief image | ||||
60 | * @return image that patterns. | ||||
61 | */ | ||||
62 | QImage image() const; | ||||
63 | | ||||
64 | private: | ||||
65 | struct Private; | ||||
66 | Private *const d; | ||||
67 | | ||||
68 | KoPattern *pat(); | ||||
69 | | ||||
70 | }; | ||||
71 | | ||||
72 | #endif // LIBKIS_PATTERN_H |