krita
kis_autogradient_resource.h
00001 /* 00002 * Copyright (c) 2004 Cyrille Berger <cberger@cberger.net> 00003 * 2004 Sven Langkamp <longamp@reallygood.de> 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software 00017 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef _KIS_AUTOGRADIENT_RESOURCE_H_ 00021 #define _KIS_AUTOGRADIENT_RESOURCE_H_ 00022 00023 #include "kis_gradient.h" 00024 00025 class KisAutogradientResource : public KisGradient 00026 { 00027 00028 public: 00029 KisAutogradientResource() : KisGradient("") {} 00030 00031 public: 00032 00033 void createSegment( int interpolation, int colorInterpolation, double startOffset, double endOffset, double middleOffset, QColor left, QColor right ); 00034 00035 const QValueVector<double> getHandlePositions() const; 00036 const QValueVector<double> getMiddleHandlePositions() const; 00037 00045 void moveSegmentStartOffset( KisGradientSegment* segment, double t); 00046 00054 void moveSegmentEndOffset( KisGradientSegment* segment, double t); 00055 00060 void moveSegmentMiddleOffset( KisGradientSegment* segment, double t); 00061 00062 00063 void splitSegment( KisGradientSegment* segment ); 00064 void duplicateSegment( KisGradientSegment* segment ); 00065 void mirrorSegment( KisGradientSegment* segment ); 00066 00072 KisGradientSegment* removeSegment( KisGradientSegment* segment ); 00073 00078 bool removeSegmentPossible() const; 00079 00083 void updatePreview(); 00084 public: 00085 virtual bool load() { return false; }; 00086 }; 00087 00088 #endif // _KIS_AUTOGRADIENT_RESOURCE_H_