chalk

kis_gradient_painter.h
1/*
2 * Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
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#ifndef KIS_GRADIENT_PAINTER_H_
19#define KIS_GRADIENT_PAINTER_H_
20
21#include <kcommand.h>
22
23#include "kis_global.h"
24#include "kis_types.h"
25#include "kis_point.h"
26#include "kis_painter.h"
27#include <koffice_export.h>
28
29class KisGradient;
30
31
32// XXX: Need to set dirtyRect in KisPainter
33class KRITACORE_EXPORT KisGradientPainter : public KisPainter
34{
35
36 typedef KisPainter super;
37
38public:
39
40 KisGradientPainter();
41 KisGradientPainter(KisPaintDeviceSP device);
42
43
44 enum enumGradientShape {
45 GradientShapeLinear,
46 GradientShapeBiLinear,
47 GradientShapeRadial,
48 GradientShapeSquare,
49 GradientShapeConical,
50 GradientShapeConicalSymetric
51 };
52
53 enum enumGradientRepeat {
54 GradientRepeatNone,
55 GradientRepeatForwards,
56 GradientRepeatAlternate
57 };
58
59 void setGradient(KisGradient& gradient) { m_gradient = &gradient; }
60 void setGradient(KisGradient* gradient) { m_gradient = gradient; }
61
67 bool paintGradient(const KisPoint& gradientVectorStart,
68 const KisPoint& gradientVectorEnd,
69 enumGradientShape shape,
70 enumGradientRepeat repeat,
71 double antiAliasThreshold,
72 bool reverseGradient,
73 TQ_INT32 startx,
74 TQ_INT32 starty,
75 TQ_INT32 width,
76 TQ_INT32 height);
77
78
79private:
80 KisGradient *m_gradient;
81
82
83};
84#endif //KIS_GRADIENT_PAINTER_H_
KisPainter contains the graphics primitives necessary to draw on a KisPaintDevice.
Definition kis_painter.h:56
A double-based point class that can return it's coordinates approximated to integers.
Definition kis_point.h:28