Warning, file /office/calligra/libs/pigment/KoColorConversionTransformationFactory.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) 2007 Cyrille Berger <cberger@cberger.net>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018 */
0019 
0020 #ifndef _KO_COLOR_CONVERSION_TRANSFORMATION_FACTORY_H_
0021 #define _KO_COLOR_CONVERSION_TRANSFORMATION_FACTORY_H_
0022 
0023 class KoColorSpace;
0024 class KoColorConversionTransformation;
0025 
0026 #include <QString>
0027 #include <KoColorConversionTransformationAbstractFactory.h>
0028 
0029 /**
0030  * Factory to create a color transformation between two colorsapces.
0031  */
0032 class PIGMENTCMS_EXPORT KoColorConversionTransformationFactory : public KoColorConversionTransformationAbstractFactory
0033 {
0034 public:
0035     /**
0036      * Create a color conversion transformation factory, that can create
0037      * KoColorConversionTrasnformation object between a source colorspace
0038      * and a destination colorspace.
0039      *
0040      * @param _srcModelId id for the source color model
0041      * @param _srcDepthId id for the source depth
0042      * @param _dstModelId id for the destination color model
0043      * @param _dstDepthId id for the destination depth
0044      * @param _srcProfile name of the source profile, or empty if any profile
0045      * @param _dstProfile name of the destination profile, or empty if any profile
0046      */
0047     KoColorConversionTransformationFactory(const QString &_srcModelId, const QString &_srcDepthId, const QString &_srcProfile, const QString &_dstModelId, const QString &_dstDepthId, const QString &_dstProfile);
0048     ~KoColorConversionTransformationFactory() override;
0049     /**
0050      * @return true if this factory creates a color conversion transformation which
0051      * conserve color information (typical color transformation that lose that information
0052      * is anything to grayscale).
0053      */
0054     virtual bool conserveColorInformation() const = 0;
0055     /**
0056      * @return true if this factory creates a color conversion transformation which
0057      * conserve the dynamic range of the color.
0058      */
0059     virtual bool conserveDynamicRange() const = 0;
0060 public:
0061     /**
0062      * @return the id of the source color model
0063      */
0064     QString srcColorModelId() const;
0065     /**
0066      * @return the id of the source color depth
0067      */
0068     QString srcColorDepthId() const;
0069     /**
0070      * @return the name of the source profile (note that an empty name
0071      *         means all profiles can be used)
0072      */
0073     QString srcProfile() const;
0074     /**
0075      * @return the id of the destination color model
0076      */
0077     QString dstColorModelId() const;
0078     /**
0079      * @return the id of the destination color depth
0080      */
0081     QString dstColorDepthId() const;
0082     /**
0083      * @return the name of the destination profile (note that an empty name
0084      *         means all profiles can be used)
0085      */
0086     QString dstProfile() const;
0087 protected:
0088     /**
0089      * @param srcCS source color space
0090      * @return true if the color space given as argument can be used as a source colorspace
0091      */
0092     bool canBeSource(const KoColorSpace* srcCS) const;
0093     /**
0094      * @param dstCS destination color space
0095      * @return true if the color space given as argument can be used as a destination colorspace
0096      */
0097     bool canBeDestination(const KoColorSpace* dstCS) const;
0098 private:
0099     struct Private;
0100     Private* const d;
0101 };
0102 
0103 #endif