From ab29b1a6994bac8ebfa46c220cd1dc7e3761786d Mon Sep 17 00:00:00 2001 From: Sandro Giessl Date: Sat, 19 Mar 2005 16:17:56 +0000 Subject: [PATCH] forgot to remove shadow.h/.cpp svn path=/trunk/kdebase/kwin/; revision=399002 --- clients/plastik/shadow.cpp | 109 ------------------------------------- clients/plastik/shadow.h | 37 ------------- 2 files changed, 146 deletions(-) delete mode 100644 clients/plastik/shadow.cpp delete mode 100644 clients/plastik/shadow.h diff --git a/clients/plastik/shadow.cpp b/clients/plastik/shadow.cpp deleted file mode 100644 index 2ce32a5a0c..0000000000 --- a/clients/plastik/shadow.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* Copyright (C) 2003-2005 by Sandro Giessl - * - * based on the text shadow code from KHTML. Original copyright notes: - * - * This file is part of the DOM implementation for KDE. - * - * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2000-2003 Dirk Mueller (mueller@kde.org) - * (C) 2003 Apple Computer, Inc. - * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "shadow.h" -#include -#include -#include -#include - -#ifdef HAVE_ALLOCA_H -// explicitly included for systems that don't provide it in stdlib.h -#include -#else -#include -#endif - -void paintShadow(QPainter *pt, const QPixmap& textPixmap, int x, int y, int thickness, const QColor &c) -{ - const QRgb color = c.rgb(); - const int fgGray = qGray(qRgb(255,255,255) ); - const QRgb bgColor = qRgb(0,0,0); - - const int w = textPixmap.width(); - const int h = textPixmap.height(); - - QImage img = textPixmap.convertToImage().convertDepth(32); - - int md = thickness*thickness; // max-distē - - // blur map (division cache) - float *bmap = (float*)alloca(sizeof(float)*(md+1)); - for(int n=0; n<=md; n++) { - float f; - f = n/(float)(md+1); - f = 1.0 - f*f; - bmap[n] = f; - } - - float factor = 0.0; // maximal opacity-sum - for(int n=-thickness; n<=thickness; n++) { - for(int m=-thickness; m<=thickness; m++) { - int d = n*n+m*m; - if (d<=md) { - factor += bmap[d]; - } - } - } - - factor = 1.0/factor; - - // alpha map - float* amap = (float*)alloca(sizeof(float)*(h*w)); - memset(amap, 0, h*w*(sizeof(float))); - for(int j=thickness; jmd) continue; - float f = bmap[d]; - amap[(i+m)+(j+n)*w] += (g*f); - } - } - } - } - - QImage res(w,h,32); - res.setAlphaBuffer(true); - int r = qRed(color); - int g = qGreen(color); - int b = qBlue(color); - - for(int j=0; jdrawImage(x,y, res); -} - diff --git a/clients/plastik/shadow.h b/clients/plastik/shadow.h deleted file mode 100644 index dd30fc2eaa..0000000000 --- a/clients/plastik/shadow.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright (C) 2003-2005 by Sandro Giessl - * - * based on the text shadow code from KHTML. Original copyright notes: - * - * This file is part of the DOM implementation for KDE. - * - * Copyright (C) 1999-2003 Lars Knoll (knoll@kde.org) - * (C) 2000-2003 Dirk Mueller (mueller@kde.org) - * (C) 2003 Apple Computer, Inc. - * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#ifndef __FX_SHADOW -#define __FX_SHADOW - -class QColor; -class QPainter; -class QPixmap; - -void paintShadow(QPainter *pt, const QPixmap& textPixmap, int x, int y, int thickness, const QColor &color); - -#endif