krita

kis_gradient_painter.h

00001 /*
00002  *  Copyright (c) 2004 Adrian Page <adrian@pagenet.plus.com>
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 #ifndef KIS_GRADIENT_PAINTER_H_
00019 #define KIS_GRADIENT_PAINTER_H_
00020 
00021 #include <kcommand.h>
00022 
00023 #include "kis_global.h"
00024 #include "kis_types.h"
00025 #include "kis_point.h"
00026 #include "kis_painter.h"
00027 #include <koffice_export.h>
00028 
00029 class KisGradient;
00030 
00031 
00032 // XXX: Need to set dirtyRect in KisPainter
00033 class KRITACORE_EXPORT KisGradientPainter : public KisPainter
00034 {
00035 
00036     typedef KisPainter super;
00037 
00038 public:
00039 
00040         KisGradientPainter();
00041         KisGradientPainter(KisPaintDeviceSP device);
00042 
00043 
00044     enum enumGradientShape {
00045         GradientShapeLinear,
00046         GradientShapeBiLinear,
00047         GradientShapeRadial,
00048         GradientShapeSquare,
00049         GradientShapeConical,
00050         GradientShapeConicalSymetric
00051     };
00052 
00053     enum enumGradientRepeat {
00054         GradientRepeatNone,
00055         GradientRepeatForwards,
00056         GradientRepeatAlternate
00057     };
00058 
00059     void setGradient(KisGradient& gradient) { m_gradient = &gradient; }
00060     void setGradient(KisGradient* gradient) { m_gradient = gradient; }
00061 
00067     bool paintGradient(const KisPoint& gradientVectorStart,
00068                const KisPoint& gradientVectorEnd,
00069                enumGradientShape shape,
00070                enumGradientRepeat repeat,
00071                double antiAliasThreshold,
00072                bool reverseGradient,
00073                Q_INT32 startx,
00074                Q_INT32 starty,
00075                Q_INT32 width,
00076                Q_INT32 height);
00077 
00078 
00079 private:
00080     KisGradient *m_gradient;
00081 
00082 
00083 };
00084 #endif //KIS_GRADIENT_PAINTER_H_
KDE Home | KDE Accessibility Home | Description of Access Keys