File indexing completed on 2024-05-12 15:59:29
0001 /* 0002 * This file is part of Krita 0003 * 0004 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #pragma once 0010 0011 #include "kritapigment_export.h" 0012 0013 #include <array> 0014 #include <cmath> 0015 0016 #include <QScopedPointer> 0017 #include <QtGlobal> 0018 0019 class KoColorSpace; 0020 class KoID; 0021 0022 enum DitherType { 0023 DITHER_NONE = 0, 0024 DITHER_FAST = 1, 0025 DITHER_BEST = 2, 0026 0027 DITHER_BAYER, 0028 DITHER_BLUE_NOISE, 0029 }; 0030 0031 class KRITAPIGMENT_EXPORT KisDitherOp 0032 { 0033 public: 0034 virtual ~KisDitherOp() = default; 0035 virtual void dither(const quint8 *src, quint8 *dst, int x, int y) const = 0; 0036 virtual void dither(const quint8 *srcRowStart, int srcRowStride, quint8 *dstRowStart, int dstRowStride, int x, int y, int columns, int rows) const = 0; 0037 0038 /** 0039 * @return the identifier of this op's source depth 0040 */ 0041 virtual KoID sourceDepthId() const = 0; 0042 0043 /** 0044 * @return the identifier of this op's destination depth 0045 */ 0046 virtual KoID destinationDepthId() const = 0; 0047 0048 /** 0049 * @return the identifier of this op's type 0050 */ 0051 virtual DitherType type() const = 0; 0052 };