Warning, file /office/calligra/libs/pigment/KoMixColorsOp.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org> 0003 * Copyright (c) 2006-2007 Cyrille Berger <cberger@cberger.net> 0004 * 0005 * This library is free software; you can redistribute it and/or 0006 * modify it under the terms of the GNU Lesser General Public 0007 * License as published by the Free Software Foundation; either 0008 * version 2.1 of the License, or (at your option) any later version. 0009 * 0010 * This library is distributed in the hope that it will be useful, 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 0013 * Lesser General Public License for more details. 0014 * 0015 * You should have received a copy of the GNU Lesser General Public License 0016 * along with this library; see the file COPYING.LIB. If not, write to 0017 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 0018 * Boston, MA 02110-1301, USA. 0019 */ 0020 #ifndef KO_MIX_COLORS_OP_H 0021 #define KO_MIX_COLORS_OP_H 0022 0023 #include <limits.h> 0024 0025 /** 0026 * Base class of the mix color operation. It's defined by 0027 * sum(colors[i] * weights[i]) / 255. You access the KoMixColorsOp 0028 * of a colorspace by calling KoColorSpace::mixColorsOp. 0029 */ 0030 class KoMixColorsOp 0031 { 0032 public: 0033 virtual ~KoMixColorsOp() { } 0034 /** 0035 * Mix the colors. 0036 * @param colors a pointer toward the source pixels 0037 * @param weights the coeffient of the source pixels (if you want 0038 * to average the sum of weights must be equal to 255) 0039 * @param nColors the number of pixels in the colors array 0040 * @param dst the destination pixel 0041 * 0042 * @code 0043 * quint8* colors[nColors]; 0044 * colors[0] = ptrToFirstPixel; 0045 * colors[1] = ptrToSecondPixel; 0046 * ... 0047 * colors[nColors-1] = ptrToLastPixel; 0048 * qint16 weights[nColors]; 0049 * weights[0] = firstWeight; 0050 * weights[1] = secondWeight; 0051 * ... 0052 * weights[nColors-1] = lastWeight; 0053 * 0054 * mixColors(colors, weights, nColors, ptrToDestinationPixel); 0055 * @endcode 0056 */ 0057 virtual void mixColors(const quint8 * const*colors, const qint16 *weights, quint32 nColors, quint8 *dst) const = 0; 0058 virtual void mixColors(const quint8 *colors, const qint16 *weights, quint32 nColors, quint8 *dst) const = 0; 0059 }; 0060 0061 #endif