Commit ba3f96f3 authored by Boudewijn Rempt's avatar Boudewijn Rempt

use DebugPigment.h

svn path=/trunk/koffice/; revision=894716
parent 4f83a5ef
......@@ -24,9 +24,11 @@
#define DBG_PIGMENT 30008
#define dbgPigment kDebug(DBG_PIGMENT)
#define dbgPigment kDebug( 30008 )
#define dbgPigmentCCS dbgPigment
#define dbgPigmentCSRegistry dbgPigment
#define dbgPigmentCS dbgPigment
#define warnPigment kWarning( 30008 )
#define errorPigment kError( 30008 )
#endif
......@@ -22,7 +22,7 @@
#include <QDomDocument>
#include "kdebug.h"
#include "DebugPigment.h"
#include "KoColor.h"
#include "KoColorModelStandardIds.h"
#include "KoColorProfile.h"
......@@ -133,7 +133,7 @@ bool KoColor::operator==(const KoColor &other) const
void KoColor::convertTo(const KoColorSpace * cs)
{
//kDebug(DBG_PIGMENT) <<"Our colormodel:" << d->colorSpace->id().name()
//dbgPigment <<"Our colormodel:" << d->colorSpace->id().name()
// << ", new colormodel: " << cs->id().name() << "\n";
if (*d->colorSpace == *cs)
......@@ -183,7 +183,7 @@ void KoColor::fromQColor(const QColor& c) const
#ifndef NDEBUG
void KoColor::dump() const
{
//kDebug(DBG_PIGMENT) <<"KoColor (" << this <<")," << d->colorSpace->id().name() <<"";
//dbgPigment <<"KoColor (" << this <<")," << d->colorSpace->id().name() <<"";
QList<KoChannelInfo *> channels = d->colorSpace->channels();
QList<KoChannelInfo *>::const_iterator begin = channels.begin();
......@@ -195,15 +195,15 @@ void KoColor::dump() const
// XXX: setNum always takes a byte.
if (ch->size() == sizeof(quint8)) {
// Byte
//kDebug(DBG_PIGMENT) <<"Channel (byte):" << ch->name() <<":" << QString().setNum(d->data[ch->pos()]) <<"";
//dbgPigment <<"Channel (byte):" << ch->name() <<":" << QString().setNum(d->data[ch->pos()]) <<"";
}
else if (ch->size() == sizeof(quint16)) {
// Short (may also by an nvidia half)
//kDebug(DBG_PIGMENT) <<"Channel (short):" << ch->name() <<":" << QString().setNum(*((const quint16 *)(d->data+ch->pos()))) <<"";
//dbgPigment <<"Channel (short):" << ch->name() <<":" << QString().setNum(*((const quint16 *)(d->data+ch->pos()))) <<"";
}
else if (ch->size() == sizeof(quint32)) {
// Integer (may also be float... Find out how to distinguish these!)
//kDebug(DBG_PIGMENT) <<"Channel (int):" << ch->name() <<":" << QString().setNum(*((const quint32 *)(d->data+ch->pos()))) <<"";
//dbgPigment <<"Channel (int):" << ch->name() <<":" << QString().setNum(*((const quint32 *)(d->data+ch->pos()))) <<"";
}
}
}
......
......@@ -21,7 +21,7 @@ struct KoColorConversionSystem::Node {
Node() : isIcc(false), isHdr(false), isInitialized(false), referenceDepth(0), isGray(false), crossingCost(1), colorSpaceFactory(0), isEngine(false),engine(0) {}
void init( const KoColorSpaceFactory* _colorSpaceFactory)
{
kDebug(DBG_PIGMENT) << "Initialise " << modelId << " " << depthId << " " << profileName;
dbgPigment << "Initialise " << modelId << " " << depthId << " " << profileName;
Q_ASSERT(not isInitialized);
isInitialized = true;
......
......@@ -18,9 +18,7 @@
*/
#include "KoColorProfile.h"
#include <kdebug.h>
#include "DebugPigment.h"
struct KoColorProfile::Private
{
QString name;
......@@ -30,7 +28,7 @@ struct KoColorProfile::Private
KoColorProfile::KoColorProfile(const QString &fileName) : d(new Private)
{
// kDebug(DBG_PIGMENT) <<" Profile filename =" << fileName;
// dbgPigment <<" Profile filename =" << fileName;
d->fileName = fileName;
}
......
......@@ -20,11 +20,10 @@
#include <QByteArray>
#include <QBitArray>
#include <kdebug.h>
#include "KoColorSpace.h"
#include "KoChannelInfo.h"
#include "DebugPigment.h"
#include "KoCompositeOp.h"
#include "KoColorTransformation.h"
#include "KoColorTransformationFactory.h"
......@@ -174,7 +173,7 @@ const KoCompositeOp * KoColorSpace::compositeOp(const QString & id) const
if ( d->compositeOps.contains( id ) )
return d->compositeOps.value( id );
else {
kWarning() << "Asking for non-existent composite operation " << id << ", returning " << COMPOSITE_OVER;
warnPigment << "Asking for non-existent composite operation " << id << ", returning " << COMPOSITE_OVER;
return d->compositeOps.value( COMPOSITE_OVER );
}
}
......
......@@ -304,7 +304,6 @@ inline half KoColorSpaceMaths<quint8,half>::scaleToA(quint8 a)
{
return a * ( 1.0 / 255.0 );
}
#include <kdebug.h>
template<>
inline quint16 KoColorSpaceMaths<half,quint16>::scaleToA(half a)
{
......
......@@ -27,10 +27,10 @@ struct KoColorTransformationFactoryRegistry::Private
};
KoColorTransformationFactoryRegistry* KoColorTransformationFactoryRegistry::Private::s_registry = 0;
KoColorTransformationFactoryRegistry::KoColorTransformationFactoryRegistry() : d(new Private)
{
}
KoColorTransformationFactoryRegistry::~KoColorTransformationFactoryRegistry()
......@@ -39,7 +39,6 @@ KoColorTransformationFactoryRegistry::~KoColorTransformationFactoryRegistry()
}
#include <kdebug.h>
void KoColorTransformationFactoryRegistry::addColorTransformationFactory(KoColorTransformationFactory* factory)
{
instance()->add(factory);
......
......@@ -19,8 +19,6 @@
#include "KoCopyColorConversionTransformation.h"
#include <kdebug.h>
#include <KoColorSpace.h>
// --- KoCopyColorConversionTransformation ---
......
......@@ -88,7 +88,7 @@ KoColorProfile* KoCtlColorProfile::clone() const
bool KoCtlColorProfile::valid() const
{
kDebug(DBG_PIGMENT) << d->colorModelID.isNull() << " " << d->colorDepthID.isNull();
dbgPigment << d->colorModelID.isNull() << " " << d->colorDepthID.isNull();
return ( d->module and d->module->isCompiled()
and not d->colorModelID.isNull() and not d->colorDepthID.isNull());
}
......@@ -209,7 +209,7 @@ void KoCtlColorProfile::decodeTransformations(QDomElement& elt)
QDomElement et = nt.toElement();
if(not et.isNull())
{
kDebug(DBG_PIGMENT) << et.tagName();
dbgPigment << et.tagName();
if(et.tagName() == "conversions")
{
decodeConversions(et);
......@@ -223,7 +223,7 @@ QString generateDepthID(QString depth, QString type)
QString prefix;
if(type == "integer") prefix = "U";
else if(type == "float") prefix = "F";
else kDebug(DBG_PIGMENT) << "Invalid type";
else dbgPigment << "Invalid type";
return prefix + depth;
}
......@@ -234,7 +234,7 @@ void KoCtlColorProfile::decodeConversions(QDomElement& elt)
QDomElement e = n.toElement();
if(not e.isNull())
{
kDebug(DBG_PIGMENT) << e.tagName();
dbgPigment << e.tagName();
if(e.tagName() == "conversion")
{
QDomElement eIn = e.firstChildElement("input");
......@@ -262,12 +262,12 @@ void KoCtlColorProfile::decodeConversions(QDomElement& elt)
d->conversionInfos.push_back( ci );
}
} else {
kDebug(DBG_PIGMENT) << "Invalid conversion, missing <input> or <output> or both";
dbgPigment << "Invalid conversion, missing <input> or <output> or both";
}
}
}
}
kDebug(DBG_PIGMENT) << d->conversionInfos.size() << " convertions were found";
dbgPigment << d->conversionInfos.size() << " convertions were found";
}
bool KoCtlColorProfile::load()
......@@ -276,13 +276,13 @@ bool KoCtlColorProfile::load()
QFile file(fileName());
if (not file.open(QIODevice::ReadOnly))
{
kDebug(DBG_PIGMENT) << "Can't open file : " << fileName();
dbgPigment << "Can't open file : " << fileName();
return false;
}
QString errorMsg;
int errorLine;
if (not doc.setContent(&file, &errorMsg, &errorLine)) {
kDebug(DBG_PIGMENT) << "Can't parse file : " << fileName() << " Error at line " << errorLine << " " << errorMsg;
dbgPigment << "Can't parse file : " << fileName() << " Error at line " << errorLine << " " << errorMsg;
file.close();
return false;
}
......@@ -290,14 +290,14 @@ bool KoCtlColorProfile::load()
QDomElement docElem = doc.documentElement();
if(docElem.tagName() != "ctlprofile")
{
kDebug(DBG_PIGMENT) << "Not a ctlprofile, root tag was : " << docElem.tagName();
dbgPigment << "Not a ctlprofile, root tag was : " << docElem.tagName();
return false;
}
QDomNode n = docElem.firstChild();
while(not n.isNull()) {
QDomElement e = n.toElement();
if(not e.isNull()) {
kDebug(DBG_PIGMENT) << e.tagName();
dbgPigment << e.tagName();
if( e.tagName() == "info")
{
setName(e.attribute("name"));
......@@ -305,14 +305,14 @@ bool KoCtlColorProfile::load()
d->colorDepthIDNumber = KoUniqueNumberForIdServer::instance()->numberForId( d->colorDepthID );
d->colorModelID = e.attribute("colorModel");
d->colorModelIDNumber = KoUniqueNumberForIdServer::instance()->numberForId( d->colorModelID );
kDebug(DBG_PIGMENT) << "colorModel = " << e.attribute("colorModel");;
dbgPigment << "colorModel = " << e.attribute("colorModel");;
} else if(e.tagName() == "program")
{
QDomNode nCDATA = e.firstChild();
if( not nCDATA.isNull())
{
QDomCDATASection CDATA = nCDATA.toCDATASection();
kDebug(DBG_PIGMENT) << CDATA.data();
dbgPigment << CDATA.data();
d->module = new OpenCTL::Module(name().toAscii().data());
d->module->setSource( CDATA.data().toAscii().data());
d->module->compile();
......
......@@ -29,10 +29,8 @@
#endif
#include <QFile>
#include <kdebug.h>
#include <KoChromaticities.h>
#include "DebugPigment.h"
#include "KoChromaticities.h"
#include "KoLcmsColorProfileContainer.h"
......@@ -227,7 +225,7 @@ bool KoIccColorProfile::load()
if (init())
return true;
kWarning() << "Failed to load profile from " << fileName();
warnPigment << "Failed to load profile from " << fileName();
return false;
}
......
......@@ -28,8 +28,8 @@
#include <cmath>
#include <lcms.h>
#include <kdebug.h>
#include <KoChromaticities.h>
#include "DebugPigment.h"
#include "KoChromaticities.h"
class KoLcmsColorProfileContainer::Private {
public:
......@@ -75,7 +75,7 @@ QByteArray KoLcmsColorProfileContainer::lcmsProfileToByteArray(const cmsHPROFILE
}
else
{
kError() << "Couldn't resize the profile buffer, system is probably running out of memory.";
errorPigment << "Couldn't resize the profile buffer, system is probably running out of memory.";
rawData.resize(0);
}
return rawData;
......@@ -111,7 +111,7 @@ QByteArray KoLcmsColorProfileContainer::createFromChromacities(const KoRGBChroma
transferFunctions[i] = gammaTable;
}
cmsHPROFILE profile = cmsCreateRGBProfile(&whitePoint, &primaries,
cmsHPROFILE profile = cmsCreateRGBProfile(&whitePoint, &primaries,
transferFunctions);
QString name = _profileName;
......@@ -134,7 +134,7 @@ QByteArray KoLcmsColorProfileContainer::createFromChromacities(const KoRGBChroma
cmsAddTag(profile, icSigDeviceModelDescTag, name.toLatin1().data());
// Clear the default manufacturer's tag that is set to "(lcms internal)"
// Clear the default manufacturer's tag that is set to "(lcms internal)"
QByteArray ba("");
cmsAddTag(profile, icSigDeviceMfgDescTag, ba.data());
......@@ -259,7 +259,7 @@ static KoCIExyY RGB2xyY(cmsHPROFILE RGBProfile, qreal red, qreal green, qreal bl
const DWORD outputFormat = TYPE_XYZ_DBL;
const DWORD transformFlags = cmsFLAGS_NOTPRECALC;
cmsHTRANSFORM transform = cmsCreateTransform(RGBProfile, inputFormat, XYZProfile, outputFormat,
cmsHTRANSFORM transform = cmsCreateTransform(RGBProfile, inputFormat, XYZProfile, outputFormat,
INTENT_ABSOLUTE_COLORIMETRIC, transformFlags);
struct XYZPixel {
......
......@@ -23,7 +23,6 @@
#include <QImage>
#include <QBitArray>
#include <kdebug.h>
#include <klocale.h>
#include <lcms.h>
......@@ -48,7 +47,7 @@ namespace {
public:
using KoCompositeOp::composite;
void composite(quint8 *dst,
qint32 dststride,
const quint8 *src,
......
......@@ -22,6 +22,7 @@
#include <QColor>
#include <QBitArray>
#include "DebugPigment.h"
#include "pigment_export.h"
#include "KoLcmsColorSpace.h"
......@@ -122,35 +123,35 @@ public:
virtual KoColorTransformation* createBrightnessContrastAdjustment(const quint16* transferValues) const
{
Q_UNUSED(transferValues);
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
return 0;
}
virtual KoColorTransformation* createDesaturateAdjustment() const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
return 0;
}
virtual KoColorTransformation* createPerChannelAdjustment(const quint16* const*) const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
return 0;
}
virtual KoColorTransformation *createDarkenAdjustment(qint32 , bool , qreal ) const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
return 0;
}
virtual void invertColor(quint8*, qint32) const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
}
virtual void colorToXML( const quint8* , QDomDocument& , QDomElement& ) const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
}
virtual void colorFromXML( quint8* , const QDomElement& ) const
{
kWarning() << i18n("Undefined operation in the alpha colorspace");
warnPigment << i18n("Undefined operation in the alpha colorspace");
}
public:
......
......@@ -21,7 +21,6 @@
#include <QDomElement>
#include <kdebug.h>
#include <klocale.h>
#include "../compositeops/KoCompositeOpOver.h"
......@@ -47,7 +46,7 @@ KoLabColorSpace::KoLabColorSpace( KoColorProfile *p) :
bool KoLabColorSpace::willDegrade(ColorSpaceIndependence independence) const
{
if (independence == TO_RGBA8)
if (independence == TO_RGBA8)
return true;
else
return false;
......
......@@ -21,7 +21,6 @@
#include <QDomElement>
#include <kdebug.h>
#include <klocale.h>
#include "compositeops/KoCompositeOps.h"
......
......@@ -21,7 +21,6 @@
#include <QDomElement>
#include <QImage>
#include <kdebug.h>
#include <klocale.h>
#include <KoIntegerMaths.h>
......
......@@ -24,7 +24,7 @@
#include <KAboutData>
#include <KCmdLineArgs>
#include <KApplication>
#include <kdebug.h>
#include "KoColorSpaceRegistry.h"
#include "KoColorConversionSystem.h"
......@@ -91,7 +91,7 @@ int main(int argc, char** argv)
kError() << "Unknow graph type : " << graphType.toLatin1();
exit(EXIT_FAILURE);
}
if (outputType == "dot") {
QFile file(outputFileName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
......
......@@ -21,8 +21,6 @@
#include <qtest_kde.h>
#include <kdebug.h>
#include <DebugPigment.h>
#include <KoColorProfile.h>
#include <KoColorSpaceRegistry.h>
......
#include "TestKoColorSpaceMaths.h"
#include <kdebug.h>
#include "KoColorSpaceMaths.h"
void TestKoColorSpaceMaths::testColorSpaceMathsTraits()
......
......@@ -2,7 +2,6 @@
#include "TestKoColorSpaceRegistry.h"
#include <qtest_kde.h>
#include <kdebug.h>
#include "KoColorSpaceRegistry.h"
#include "KoColorSpace.h"
......@@ -12,7 +11,7 @@
void TestKoColorSpaceRegistry::testRgbU8()
{
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID,
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID,
Integer8BitsColorDepthID);
KoColorSpaceFactory *colorSpaceFactory = KoColorSpaceRegistry::instance()->value(colorSpaceId);
QVERIFY(colorSpaceFactory != 0);
......@@ -55,7 +54,7 @@ void TestKoColorSpaceRegistry::testRgbU8()
void TestKoColorSpaceRegistry::testRgbU16()
{
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID,
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(RGBAColorModelID,
Integer16BitsColorDepthID);
KoColorSpaceFactory *colorSpaceFactory = KoColorSpaceRegistry::instance()->value(colorSpaceId);
QVERIFY(colorSpaceFactory != 0);
......@@ -98,7 +97,7 @@ void TestKoColorSpaceRegistry::testRgbU16()
void TestKoColorSpaceRegistry::testLab()
{
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(LABAColorModelID,
QString colorSpaceId = KoColorSpaceRegistry::instance()->colorSpaceId(LABAColorModelID,
Integer16BitsColorDepthID);
KoColorSpaceFactory *colorSpaceFactory = KoColorSpaceRegistry::instance()->value(colorSpaceId);
QVERIFY(colorSpaceFactory != 0);
......
......@@ -3,8 +3,6 @@
#include <cmath>
#include <kdebug.h>
qreal testRounding(qreal value)
{
qreal factor;
......@@ -23,7 +21,7 @@ void TestKoLcmsColorProfile::testChromaticitiesFromProfile()
KoLcmsRGBColorProfile::Chromaticities chromaticities = KoLcmsRGBColorProfile::chromaticitiesFromProfile(profile);
const cmsCIExyY profileRed = {0.6400f, 0.3300f, 0.212656f};
const cmsCIExyY profileRed = {0.6400f, 0.3300f, 0.212656f};
const cmsCIExyY profileGreen = {0.3000f, 0.6000f, 0.715158f};
const cmsCIExyY profileBlue = {0.1500f, 0.0600f, 0.072186f};
const cmsCIExyY profileWhite = {0.3127f, 0.3290f, 1.000000f};
......@@ -71,7 +69,7 @@ void TestKoLcmsColorProfile::testProfileCreationFromChromaticities()
cmsHPROFILE lcmsProfile = profile->lcmsProfile();
KoLcmsRGBColorProfile::Chromaticities profileChromaticities =
KoLcmsRGBColorProfile::Chromaticities profileChromaticities =
KoLcmsRGBColorProfile::chromaticitiesFromProfile(lcmsProfile);
QCOMPARE(testRounding(profileChromaticities.primaries.Red.x), testRounding(chromaticities.primaries.Red.x));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment