diff options
author | Mavridis Philippe <[email protected]> | 2021-06-25 18:57:35 +0300 |
---|---|---|
committer | Mavridis Philippe <[email protected]> | 2021-06-25 18:57:35 +0300 |
commit | b3fe3eb6c8fa5162f94ef57c260e109089efac10 (patch) | |
tree | 55373edf138a39d1822165b8925962c67587fc3e /src/shadow.h | |
download | twin-style-suse2-b3fe3eb6c8fa5162f94ef57c260e109089efac10.tar.gz twin-style-suse2-b3fe3eb6c8fa5162f94ef57c260e109089efac10.zip |
Initial commit: imported from https://store.kde.org/p/1100399
Signed-off-by: Mavridis Philippe <[email protected]>
Diffstat (limited to 'src/shadow.h')
-rw-r--r-- | src/shadow.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/shadow.h b/src/shadow.h new file mode 100644 index 0000000..04facb0 --- /dev/null +++ b/src/shadow.h @@ -0,0 +1,52 @@ +/* Copyright (C) 2005 Gerd Fleischer <[email protected]> + * Copyright (C) 2003 by Sandro Giessl + * based on the nice CVS KDesktop KShadowEngine class. thanks! + * looking forward to see KShadowEngine in kdefx somewhen btw.. :) + * ------------------------------------------------------------------------ + * these are the original copyright notes: + * This file is proposed to be part of the KDE libraries. + * Copyright (C) 2003 Laur Ivan <[email protected]> + * + * Many thanks to: + * - Bernardo Hung <[email protected]> for the enhanced shadow + * algorithm (currently used) + * - Tim Jansen <[email protected]> for the API updates and fixes. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, + * Boston, MA 02110-1301 USA. + */ + +#ifndef __FX_SHADOW +#define __FX_SHADOW + +#include <qpixmap.h> +#include <qimage.h> +#include <qcolor.h> + +class ShadowEngine +{ + public: + ShadowEngine(); + ~ShadowEngine(); + void setThickness(int thickness) { thickness_ = thickness; } + void setMultiplicationFactor(float factor) { multiplicationFactor_ = factor; } + QImage makeShadow(const QPixmap& textPixmap, const QColor &bgColor); + private: + float decay(QImage& source, int x, int y); + + int thickness_; + float multiplicationFactor_; +}; + +#endif |