File indexing completed on 2024-05-12 15:59:37

0001 /*
0002  *  SPDX-FileCopyrightText: 2007 Cyrille Berger <cberger@cberger.net>
0003  *
0004  * SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #ifndef _KO_MULTIPLE_COLOR_CONVERSION_TRANSFORMATION_H_
0008 #define _KO_MULTIPLE_COLOR_CONVERSION_TRANSFORMATION_H_
0009 
0010 #include <KoColorConversionTransformation.h>
0011 
0012 #include "kritapigment_export.h"
0013 
0014 /**
0015  * This color conversion transformation allows to create a chain of color conversion between two color
0016  * spaces.
0017  * For instance, imagine we have three color spaces : CSA , CSB and CSC , we only know a transformation
0018  * from CSA to CSB and from CSB to CSC , and we want to convert from CSA to CSC. Then we can create
0019  * a KoMultipleColorConversionTransformation, and add to it with
0020  *  KoMultipleColorConversionTransformation::appendTransfo a transformation from CSA to CSB and a
0021  * transformation from CSB to CSC.
0022  */
0023 class KRITAPIGMENT_EXPORT KoMultipleColorConversionTransformation : public KoColorConversionTransformation
0024 {
0025 public:
0026     /**
0027      * Create a color transformation from srcCs to dstCs.
0028      * @param srcCs the first color space in the chain
0029      * @param dstCs the last color space in the chain
0030      */
0031     KoMultipleColorConversionTransformation(const KoColorSpace* srcCs, const KoColorSpace* dstCs, KoColorConversionTransformation::Intent, KoColorConversionTransformation::ConversionFlags conversionFlags);
0032     ~KoMultipleColorConversionTransformation() override;
0033     /**
0034      * Add a transformation to the chain.
0035      * @param transfo this transformation is then deleted when the
0036      *                KoMultipleColorConversionTransformation is deleted.
0037      */
0038     void appendTransfo(KoColorConversionTransformation* transfo);
0039     void transform(const quint8 *src, quint8 *dst, qint32 nPixels) const override;
0040 private:
0041     struct Private;
0042     Private* const d;
0043 };
0044 
0045 #endif