File indexing completed on 2024-05-12 15:59:33
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_COLOR_CONVERSION_TRANSFORMATION_FACTORY_H_ 0008 #define _KO_COLOR_CONVERSION_TRANSFORMATION_FACTORY_H_ 0009 0010 class KoColorSpace; 0011 class KoColorConversionTransformation; 0012 0013 #include <QString> 0014 #include <KoColorConversionTransformationAbstractFactory.h> 0015 0016 /** 0017 * Factory to create a color transformation between two colorsapces. 0018 */ 0019 class KRITAPIGMENT_EXPORT KoColorConversionTransformationFactory : public KoColorConversionTransformationAbstractFactory 0020 { 0021 public: 0022 /** 0023 * Create a color conversion transformation factory, that can create 0024 * KoColorConversionTransformation object between a source colorspace 0025 * and a destination colorspace. 0026 * 0027 * @param _srcModelId id for the source color model 0028 * @param _srcDepthId id for the source depth 0029 * @param _dstModelId id for the destination color model 0030 * @param _dstDepthId id for the destination depth 0031 * @param _srcProfile name of the source profile, or empty if any profile 0032 * @param _dstProfile name of the destination profile, or empty if any profile 0033 */ 0034 KoColorConversionTransformationFactory(const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile); 0035 ~KoColorConversionTransformationFactory() override; 0036 0037 public: 0038 /** 0039 * @return the id of the source color model 0040 */ 0041 QString srcColorModelId() const; 0042 /** 0043 * @return the id of the source color depth 0044 */ 0045 QString srcColorDepthId() const; 0046 /** 0047 * @return the name of the source profile (note that an empty name 0048 * means all profiles can be used) 0049 */ 0050 QString srcProfile() const; 0051 /** 0052 * @return the id of the destination color model 0053 */ 0054 QString dstColorModelId() const; 0055 /** 0056 * @return the id of the destination color depth 0057 */ 0058 QString dstColorDepthId() const; 0059 /** 0060 * @return the name of the destination profile (note that an empty name 0061 * means all profiles can be used) 0062 */ 0063 QString dstProfile() const; 0064 protected: 0065 /** 0066 * @param srcCS source color space 0067 * @return true if the color space given as argument can be used as a source colorspace 0068 */ 0069 bool canBeSource(const KoColorSpace* srcCS) const; 0070 /** 0071 * @param dstCS destination color space 0072 * @return true if the color space given as argument can be used as a destination colorspace 0073 */ 0074 bool canBeDestination(const KoColorSpace* dstCS) const; 0075 private: 0076 struct Private; 0077 Private* const d; 0078 }; 0079 0080 #endif