File indexing completed on 2025-01-26 04:10:38
0001 /* 0002 * This file is part of the KDE project 0003 * 0004 * SPDX-FileCopyrightText: 2016 Spencer Brown <sbrown655@gmail.com> 0005 * SPDX-FileCopyrightText: 2020 Deif Lou <ginoba@gmail.com> 0006 * 0007 * SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #ifndef KIS_GRADIENT_MAP_FILTER_NEAREST_CACHED_GRADIENT_H 0011 #define KIS_GRADIENT_MAP_FILTER_NEAREST_CACHED_GRADIENT_H 0012 0013 #include <QVector> 0014 0015 #include <KoColor.h> 0016 0017 class KoColorSpace; 0018 0019 class KisGradientMapFilterNearestCachedGradient 0020 { 0021 public: 0022 KisGradientMapFilterNearestCachedGradient(const KoAbstractGradientSP gradient, qint32 steps, const KoColorSpace *cs); 0023 0024 /// gets the color data at position 0 <= t <= 1 0025 const quint8* cachedAt(qreal t) const; 0026 0027 private: 0028 const qint32 m_max; 0029 QVector<KoColor> m_colors; 0030 const KoColor m_black; 0031 }; 0032 0033 0034 #endif