Warning, file /office/calligra/libs/pigment/KoColorConversionTransformation.cpp 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 #include "KoColorConversionTransformation.h"
0021 
0022 #include "KoColorSpace.h"
0023 
0024 struct Q_DECL_HIDDEN KoColorConversionTransformation::Private {
0025     const KoColorSpace* srcColorSpace;
0026     const KoColorSpace* dstColorSpace;
0027     Intent renderingIntent;
0028     ConversionFlags conversionFlags;
0029 };
0030 
0031 KoColorConversionTransformation::KoColorConversionTransformation(const KoColorSpace* srcCs,
0032                                                                  const KoColorSpace* dstCs,
0033                                                                  Intent renderingIntent,
0034                                                                  ConversionFlags conversionFlags)
0035     : d(new Private)
0036 {
0037     Q_ASSERT(srcCs);
0038     Q_ASSERT(dstCs);
0039 
0040     d->srcColorSpace = srcCs;
0041     d->dstColorSpace = dstCs;
0042     d->renderingIntent = renderingIntent;
0043     d->conversionFlags = conversionFlags;
0044 }
0045 
0046 KoColorConversionTransformation::~KoColorConversionTransformation()
0047 {
0048     delete d;
0049 }
0050 
0051 const KoColorSpace* KoColorConversionTransformation::srcColorSpace() const
0052 {
0053     return d->srcColorSpace;
0054 }
0055 
0056 const KoColorSpace* KoColorConversionTransformation::dstColorSpace() const
0057 {
0058     return d->dstColorSpace;
0059 }
0060 
0061 KoColorConversionTransformation::Intent KoColorConversionTransformation::renderingIntent() const
0062 {
0063     return d->renderingIntent;
0064 }
0065 
0066 KoColorConversionTransformation::ConversionFlags KoColorConversionTransformation::conversionFlags() const
0067 {
0068     return d->conversionFlags;
0069 }
0070 
0071 void KoColorConversionTransformation::setSrcColorSpace(const KoColorSpace* cs) const
0072 {
0073     Q_ASSERT(*d->srcColorSpace == *cs);
0074     d->srcColorSpace = cs;
0075 }
0076 
0077 void KoColorConversionTransformation::setDstColorSpace(const KoColorSpace* cs) const
0078 {
0079     Q_ASSERT(*d->dstColorSpace == *cs);
0080     d->dstColorSpace = cs;
0081 }