Warning, file /office/calligra/libs/pigment/KoCopyColorConversionTransformation.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 "KoCopyColorConversionTransformation.h" 0021 0022 #include <KoColorSpace.h> 0023 0024 // --- KoCopyColorConversionTransformation --- 0025 KoCopyColorConversionTransformation::KoCopyColorConversionTransformation(const KoColorSpace* cs) 0026 : KoColorConversionTransformation(cs, cs, KoColorConversionTransformation::internalRenderingIntent(), KoColorConversionTransformation::internalConversionFlags()) 0027 { 0028 } 0029 void KoCopyColorConversionTransformation::transform(const quint8 *srcU8, quint8 *dstU8, qint32 nPixels) const 0030 { 0031 memcpy(dstU8, srcU8, nPixels * srcColorSpace()->pixelSize()); 0032 } 0033 0034 // --- KoCopyColorConversionTransformationFactory --- 0035 KoCopyColorConversionTransformationFactory::KoCopyColorConversionTransformationFactory(const QString& _colorModelId, const QString& _depthId, const QString& _profileName) : KoColorConversionTransformationFactory(_colorModelId, _depthId, _profileName, _colorModelId, _depthId, _profileName) 0036 {} 0037 KoColorConversionTransformation* KoCopyColorConversionTransformationFactory::createColorTransformation(const KoColorSpace* srcColorSpace, const KoColorSpace* dstColorSpace, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags) const 0038 { 0039 Q_UNUSED(renderingIntent); 0040 Q_UNUSED(conversionFlags); 0041 #ifdef QT_NO_DEBUG 0042 Q_UNUSED(dstColorSpace); 0043 #endif 0044 Q_UNUSED(dstColorSpace); 0045 Q_ASSERT(canBeSource(srcColorSpace)); 0046 Q_ASSERT(canBeDestination(dstColorSpace)); 0047 Q_ASSERT(srcColorSpace->id() == dstColorSpace->id()); 0048 return new KoCopyColorConversionTransformation(srcColorSpace); 0049 } 0050 bool KoCopyColorConversionTransformationFactory::conserveColorInformation() const 0051 { 0052 return true; 0053 } 0054 bool KoCopyColorConversionTransformationFactory::conserveDynamicRange() const 0055 { 0056 return true; 0057 }