File indexing completed on 2024-04-28 11:38:29

0001 /*
0002     This file is a part of the KDE project
0003 
0004     Copyright © 2006 Zack Rusin <zack@kde.org>
0005     Copyright © 2006-2007, 2008 Fredrik Höglund <fredrik@kde.org>
0006 
0007     The stack blur algorithm was invented by Mario Klingemann <mario@quasimondo.com>
0008 
0009     This implementation is based on the version in Anti-Grain Geometry Version 2.4,
0010     Copyright © 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
0011 
0012     Redistribution and use in source and binary forms, with or without
0013     modification, are permitted provided that the following conditions
0014     are met:
0015 
0016     1. Redistributions of source code must retain the above copyright
0017        notice, this list of conditions and the following disclaimer.
0018     2. Redistributions in binary form must reproduce the above copyright
0019        notice, this list of conditions and the following disclaimer in the
0020        documentation and/or other materials provided with the distribution.
0021 
0022     THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
0023     IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
0024     OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
0025     IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
0026     INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
0027     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0028     DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0029     THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0030     (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
0031     THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0032 */
0033 
0034 namespace khtml
0035 {
0036 
0037 class ImageFilter
0038 {
0039 public:
0040     // Blurs the alpha channel of the image and recolors it to the specified color.
0041     // The image must have transparent padding on all sides, or the shadow will be clipped.
0042     static void shadowBlur(QImage &image, float radius, const QColor &color);
0043 };
0044 
0045 }
0046