fix tricky regression noticed by Vyacheslav Tokarev on Google Reader.
[kdelibs.git] / khtml / misc / imagefilter.h
blob71e5dc4758cc592c46e46979c391f34673b57d2f
1 /*
2 This file is a part of the KDE project
4 Copyright © 2006 Zack Rusin <zack@kde.org>
5 Copyright © 2006-2007, 2008 Fredrik Höglund <fredrik@kde.org>
7 The stack blur algorithm was invented by Mario Klingemann <mario@quasimondo.com>
9 This implementation is based on the version in Anti-Grain Geometry Version 2.4,
10 Copyright © 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions
14 are met:
16 1. Redistributions of source code must retain the above copyright
17 notice, this list of conditions and the following disclaimer.
18 2. Redistributions in binary form must reproduce the above copyright
19 notice, this list of conditions and the following disclaimer in the
20 documentation and/or other materials provided with the distribution.
22 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
27 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 namespace khtml {
37 class ImageFilter
39 public:
40 // Blurs the alpha channel of the image and recolors it to the specified color.
41 // The image must have transparent padding on all sides, or the shadow will be clipped.
42 static void shadowBlur(QImage &image, float radius, const QColor &color);