Commit caa131ff authored by Cyrille Berger's avatar Cyrille Berger

remove KoColorSpaceRegistry as a parent of KoColorSpace, we weren't using it...

remove KoColorSpaceRegistry as a parent of KoColorSpace, we weren't using it and there can only be one KoColorSpaceRegistry anyway

svn path=/trunk/koffice/; revision=741427
parent 6a881b6a
......@@ -38,7 +38,7 @@ GRAYU16Plugin::GRAYU16Plugin(QObject *parent, const QStringList &)
KoColorSpaceFactory * csf = new KisGrayU16ColorSpaceFactory();
f->add(csf);
KoColorSpace * colorSpaceGRAYU16 = new KisGrayU16ColorSpace(f, KoColorSpaceRegistry::instance()->profileByName(csf->defaultProfile()));
KoColorSpace * colorSpaceGRAYU16 = new KisGrayU16ColorSpace( KoColorSpaceRegistry::instance()->profileByName(csf->defaultProfile()));
Q_CHECK_PTR(colorSpaceGRAYU16);
KoHistogramProducerFactoryRegistry::instance()->add(
......
......@@ -28,8 +28,8 @@
#include "compositeops/KoCompositeOpErase.h"
KisGrayU16ColorSpace ::KisGrayU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) :
KoLcmsColorSpace<GrayU16Traits>("GRAYU16", i18n("Grayscale 16-bit integer/channel)"), parent, TYPE_GRAY_16, icSigGrayData, p)
KisGrayU16ColorSpace ::KisGrayU16ColorSpace(KoColorProfile *p) :
KoLcmsColorSpace<GrayU16Traits>("GRAYU16", i18n("Grayscale 16-bit integer/channel)"), TYPE_GRAY_16, icSigGrayData, p)
{
addChannel(new KoChannelInfo(i18n("Gray"), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT16));
......@@ -41,5 +41,5 @@ KisGrayU16ColorSpace ::KisGrayU16ColorSpace(KoColorSpaceRegistry * parent, KoCol
KoColorSpace* KisGrayU16ColorSpace::clone() const
{
return new KisGrayU16ColorSpace(0, profile()->clone());
return new KisGrayU16ColorSpace(profile()->clone());
}
......@@ -30,7 +30,7 @@ typedef KoColorSpaceTrait<quint16, 1, -1> GrayU16Traits;
class KRITA_GRAY_U16_EXPORT KisGrayU16ColorSpace : public KoLcmsColorSpace<GrayU16Traits>
{
public:
KisGrayU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisGrayU16ColorSpace( KoColorProfile *p);
virtual bool willDegrade(ColorSpaceIndependence ) const { return false; }
virtual KoID colorModelId() const { return GrayColorModelID; }
virtual KoID colorDepthId() const { return Integer16BitsColorDepthID; }
......@@ -49,7 +49,7 @@ public:
virtual KoID colorDepthId() const { return Integer16BitsColorDepthID; }
virtual int referenceDepth() const { return 16; }
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) const { return new KisGrayU16ColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile *p) const { return new KisGrayU16ColorSpace( p); }
virtual QString defaultProfile() const { return "gray built-in - (lcms internal)"; }
};
......
......@@ -45,7 +45,7 @@ GrayPlugin::GrayPlugin(QObject *parent, const QStringList &)
KoColorSpaceFactory * csFactory = new KisGrayColorSpaceFactory();
f->add(csFactory);
KoColorSpace * colorSpaceGrayA = new KisGrayColorSpace(f, KoColorSpaceRegistry::instance()->profileByName(csFactory->defaultProfile()));
KoColorSpace * colorSpaceGrayA = new KisGrayColorSpace( KoColorSpaceRegistry::instance()->profileByName(csFactory->defaultProfile()));
KoHistogramProducerFactoryRegistry::instance()->add(
new KoBasicHistogramProducerFactory<KoBasicU8HistogramProducer>
(KoID("GRAYA8HISTO", i18n("GRAY/Alpha8 Histogram")), colorSpaceGrayA) );
......
......@@ -26,8 +26,8 @@
#include "compositeops/KoCompositeOpOver.h"
#include "compositeops/KoCompositeOpErase.h"
KisGrayColorSpace ::KisGrayColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) :
KoLcmsColorSpace<GrayU8Traits>("GRAYU8", i18n("Grayscale without alpha (8-bit integer/channel)"), parent, TYPE_GRAY_8, icSigGrayData, p)
KisGrayColorSpace ::KisGrayColorSpace( KoColorProfile *p) :
KoLcmsColorSpace<GrayU8Traits>("GRAYU8", i18n("Grayscale without alpha (8-bit integer/channel)"), TYPE_GRAY_8, icSigGrayData, p)
{
addChannel(new KoChannelInfo(i18n("Gray"), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8));
......@@ -39,5 +39,5 @@ KisGrayColorSpace ::KisGrayColorSpace(KoColorSpaceRegistry * parent, KoColorProf
KoColorSpace* KisGrayColorSpace::clone() const
{
return new KisGrayColorSpace(0, profile()->clone());
return new KisGrayColorSpace(profile()->clone());
}
......@@ -30,7 +30,7 @@ typedef KoColorSpaceTrait<quint8, 1, -1> GrayU8Traits;
class KRITA_GRAY_U8_EXPORT KisGrayColorSpace : public KoLcmsColorSpace<GrayU8Traits>
{
public:
KisGrayColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisGrayColorSpace( KoColorProfile *p);
virtual bool willDegrade(ColorSpaceIndependence ) const { return false; }
virtual KoID colorModelId() const { return GrayColorModelID; }
virtual KoID colorDepthId() const { return Integer8BitsColorDepthID; }
......@@ -49,7 +49,7 @@ public:
virtual int referenceDepth() const { return 8; }
virtual bool userVisible() const { return false; }
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) const { return new KisGrayColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile *p) const { return new KisGrayColorSpace( p); }
virtual QString defaultProfile() const { return "gray built-in - (lcms internal)"; }
};
......
......@@ -25,8 +25,8 @@
#include "kis_rgb_f32_hdr_colorspace.h"
KisRgbF32HDRColorSpace::KisRgbF32HDRColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p)
: KisRgbFloatHDRColorSpace<RgbF32Traits>(colorSpaceId(), i18n("RGB (32-bit float/channel) for High Dynamic Range imaging"), parent, p)
KisRgbF32HDRColorSpace::KisRgbF32HDRColorSpace( KoColorProfile *p)
: KisRgbFloatHDRColorSpace<RgbF32Traits>(colorSpaceId(), i18n("RGB (32-bit float/channel) for High Dynamic Range imaging"), p)
{
}
......@@ -37,6 +37,6 @@ QString KisRgbF32HDRColorSpace::colorSpaceId()
KoColorSpace* KisRgbF32HDRColorSpace::clone() const
{
return new KisRgbF32HDRColorSpace(0, profile()->clone());
return new KisRgbF32HDRColorSpace(profile()->clone());
}
......@@ -32,7 +32,7 @@ typedef KoRgbTraits<float> RgbF32Traits;
class KRITA_RGBF32_EXPORT KisRgbF32HDRColorSpace : public KisRgbFloatHDRColorSpace<RgbF32Traits>
{
public:
KisRgbF32HDRColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisRgbF32HDRColorSpace( KoColorProfile *p);
virtual KoID colorModelId() const { return RGBAColorModelID; }
virtual KoID colorDepthId() const { return Float32BitsColorDepthID; }
......@@ -59,7 +59,7 @@ public:
virtual int referenceDepth() const { return 32; }
virtual bool userVisible() const { return true; }
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile * p) const { return new KisRgbF32HDRColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile * p) const { return new KisRgbF32HDRColorSpace( p); }
virtual QList<KoColorConversionTransformationFactory*> colorConversionLinks() const
{
QList<KoColorConversionTransformationFactory*> list;
......
......@@ -40,8 +40,8 @@ template <class _CSTraits>
class KisRgbFloatHDRColorSpace : public KoIncompleteColorSpace<_CSTraits>
{
public:
KisRgbFloatHDRColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent, KoColorProfile *profile)
: KoIncompleteColorSpace<_CSTraits>(id, name, parent, parent->rgb16(""))
KisRgbFloatHDRColorSpace(const QString &id, const QString &name, KoColorProfile *profile)
: KoIncompleteColorSpace<_CSTraits>(id, name, KoColorSpaceRegistry::instance()->rgb16(""))
{
// We assume an alpha channel at the moment
Q_ASSERT(_CSTraits::alpha_pos != -1);
......
......@@ -69,7 +69,7 @@ RGBFloatHDRPlugin::RGBFloatHDRPlugin(QObject *parent, const QStringList &)
#ifdef HAVE_OPENEXR
// Register F16 HDR colorspace
{
KoColorSpace * colorSpaceRGBF16Half = new KisRgbF16HDRColorSpace(f, profile);
KoColorSpace * colorSpaceRGBF16Half = new KisRgbF16HDRColorSpace(profile);
KoColorSpaceFactory *csf = new KisRgbF16HDRColorSpaceFactory();
Q_CHECK_PTR(colorSpaceRGBF16Half);
f->add(csf);
......@@ -80,7 +80,7 @@ RGBFloatHDRPlugin::RGBFloatHDRPlugin(QObject *parent, const QStringList &)
#endif
// Register F32 HDR colorspace
{
KoColorSpace * colorSpaceRGBF32 = new KisRgbF32HDRColorSpace(f, profile);
KoColorSpace * colorSpaceRGBF32 = new KisRgbF32HDRColorSpace( profile);
KoColorSpaceFactory *csf = new KisRgbF32HDRColorSpaceFactory();
Q_CHECK_PTR(colorSpaceRGBF32);
f->add(csf);
......
......@@ -26,8 +26,8 @@
#include "kis_xyz_to_rgb_color_conversion_transformation.h"
#include "kis_rgb_to_xyz_color_conversion_transformation.h"
KisXyzF32HDRColorSpace::KisXyzF32HDRColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p)
: KisXyzFloatHDRColorSpace<XyzF32Traits>(colorSpaceId(), i18n("XYZ (32-bit float/channel) for High Dynamic Range imaging"), parent, p)
KisXyzF32HDRColorSpace::KisXyzF32HDRColorSpace( KoColorProfile *p)
: KisXyzFloatHDRColorSpace<XyzF32Traits>(colorSpaceId(), i18n("XYZ (32-bit float/channel) for High Dynamic Range imaging"), p)
{
}
......@@ -53,5 +53,5 @@ QList<KoColorConversionTransformationFactory*> KisXyzF32HDRColorSpaceFactory::co
KoColorSpace* KisXyzF32HDRColorSpace::clone() const
{
return new KisXyzF32HDRColorSpace(0, 0);
return new KisXyzF32HDRColorSpace( 0);
}
......@@ -30,7 +30,7 @@ typedef KoXyzTraits<float> XyzF32Traits;
class KisXyzF32HDRColorSpace : public KisXyzFloatHDRColorSpace<XyzF32Traits>
{
public:
KisXyzF32HDRColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisXyzF32HDRColorSpace( KoColorProfile *p);
virtual KoID colorModelId() const { return XYZAColorModelID; }
virtual KoID colorDepthId() const { return Float32BitsColorDepthID; }
......@@ -69,7 +69,7 @@ public:
return 0;
}
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile * p) const { return new KisXyzF32HDRColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile * p) const { return new KisXyzF32HDRColorSpace( p); }
virtual bool profileIsCompatible(const KoColorProfile* profile) const
{
return profile == 0;
......
......@@ -40,8 +40,8 @@ template <class _CSTraits>
class KisXyzFloatHDRColorSpace : public KoIncompleteColorSpace<_CSTraits>
{
public:
KisXyzFloatHDRColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent, KoColorProfile *profile)
: KoIncompleteColorSpace<_CSTraits>(id, name, parent, parent->lab16(""))
KisXyzFloatHDRColorSpace(const QString &id, const QString &name, KoColorProfile *profile)
: KoIncompleteColorSpace<_CSTraits>(id, name, KoColorSpaceRegistry::instance()->lab16(""))
{
Q_UNUSED(profile);
......
......@@ -45,7 +45,7 @@ XYZFloatHDRPlugin::XYZFloatHDRPlugin(QObject *parent, const QStringList &)
// Register F32 HDR colorspace
{
KoColorSpace * colorSpaceXYZF32 = new KisXyzF32HDRColorSpace(f, 0);
KoColorSpace * colorSpaceXYZF32 = new KisXyzF32HDRColorSpace(0);
KoColorSpaceFactory *csf = new KisXyzF32HDRColorSpaceFactory();
Q_CHECK_PTR(colorSpaceXYZF32);
f->add(csf);
......
......@@ -28,8 +28,8 @@
#include "compositeops/KoCompositeOpDivide.h"
#include "compositeops/KoCompositeOpBurn.h"
KisXyzU16ColorSpace::KisXyzU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) :
KoLcmsColorSpace<XyzU16Traits>("XYZA16", i18n("XYZ (16-bit integer/channel)"), parent, TYPE_XYZA_16, icSigXYZData, p)
KisXyzU16ColorSpace::KisXyzU16ColorSpace(KoColorProfile *p) :
KoLcmsColorSpace<XyzU16Traits>("XYZA16", i18n("XYZ (16-bit integer/channel)"), TYPE_XYZA_16, icSigXYZData, p)
{
addChannel(new KoChannelInfo(i18n("X"), XyzU16Traits::x_pos * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::cyan));
addChannel(new KoChannelInfo(i18n("Y"), XyzU16Traits::y_pos * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::magenta));
......@@ -54,6 +54,6 @@ bool KisXyzU16ColorSpace::willDegrade(ColorSpaceIndependence independence) const
KoColorSpace* KisXyzU16ColorSpace::clone() const
{
return new KisXyzU16ColorSpace(0, profile()->clone());
return new KisXyzU16ColorSpace( profile()->clone());
}
......@@ -31,7 +31,7 @@ typedef KoXyzTraits<quint16> XyzU16Traits;
class PIGMENT_XYZ_U16_EXPORT KisXyzU16ColorSpace : public KoLcmsColorSpace<XyzU16Traits>
{
public:
KisXyzU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisXyzU16ColorSpace( KoColorProfile *p);
virtual bool willDegrade(ColorSpaceIndependence independence) const;
virtual KoID colorModelId() const { return XYZAColorModelID; }
virtual KoID colorDepthId() const { return Integer16BitsColorDepthID; }
......@@ -54,7 +54,7 @@ class KisXyzU16ColorSpaceFactory : public KoLcmsColorSpaceFactory
virtual KoID colorDepthId() const { return Integer16BitsColorDepthID; }
virtual int referenceDepth() const { return 16; }
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p) const { return new KisXyzU16ColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile *p) const { return new KisXyzU16ColorSpace( p); }
virtual QString defaultProfile() const { return "XYZ built-in - (lcms internal)"; }
};
......
......@@ -39,7 +39,7 @@ XYZU16Plugin::XYZU16Plugin(QObject *parent, const QStringList &)
KoColorProfile *xyzProfile = KoLcmsColorProfileContainer::createFromLcmsProfile(cmsCreateXYZProfile());
f->addProfile(xyzProfile);
KoColorSpace * colorSpaceXYZU16 = new KisXyzU16ColorSpace(f, KoColorSpaceRegistry::instance()->profileByName(csf->defaultProfile()));
KoColorSpace * colorSpaceXYZU16 = new KisXyzU16ColorSpace( KoColorSpaceRegistry::instance()->profileByName(csf->defaultProfile()));
Q_CHECK_PTR(colorSpaceXYZU16);
KoHistogramProducerFactoryRegistry::instance()->add(
......
......@@ -32,8 +32,8 @@ template <class _CSTraits>
class KisYCbCrBaseColorSpace : public KoIncompleteColorSpace<_CSTraits>
{
public:
KisYCbCrBaseColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent)
: KoIncompleteColorSpace<_CSTraits>(id, name, parent, parent->rgb16(""))
KisYCbCrBaseColorSpace(const QString &id, const QString &name)
: KoIncompleteColorSpace<_CSTraits>(id, name, KoColorSpaceRegistry::instance()->rgb16(""))
{
}
......
......@@ -33,8 +33,8 @@
#include "compositeops/KoCompositeOpOver.h"
#include "compositeops/KoCompositeOpErase.h"
KisYCbCrU16ColorSpace::KisYCbCrU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile */*p*/)
: KisYCbCrBaseColorSpace<YCbCrU16Traits>("YCbCrAU16", i18n("YCbCr (16-bit integer/channel)"), parent)
KisYCbCrU16ColorSpace::KisYCbCrU16ColorSpace( KoColorProfile */*p*/)
: KisYCbCrBaseColorSpace<YCbCrU16Traits>("YCbCrAU16", i18n("YCbCr (16-bit integer/channel)"))
{
addChannel(new KoChannelInfo(i18n("Y"), YCbCrU16Traits::y_pos * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), QColor(255,0,0)));
addChannel(new KoChannelInfo(i18n("Cb"), YCbCrU16Traits::cb_pos * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), QColor(0,255,0)));
......@@ -59,6 +59,6 @@ QList<KoColorConversionTransformationFactory*> KisYCbCrU16ColorSpaceFactory::col
KoColorSpace* KisYCbCrU16ColorSpace::clone() const
{
return new KisYCbCrU16ColorSpace(0, 0);
return new KisYCbCrU16ColorSpace( 0);
}
......@@ -29,7 +29,7 @@ typedef KoYCbCrTraits<quint16> YCbCrU16Traits;
class KisYCbCrU16ColorSpace : public KisYCbCrBaseColorSpace<YCbCrU16Traits>
{
public:
KisYCbCrU16ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisYCbCrU16ColorSpace( KoColorProfile *p);
virtual bool willDegrade(ColorSpaceIndependence independence) const {
if (independence == TO_RGBA8 )
return true;
......@@ -55,7 +55,7 @@ public:
return false;
}
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile * p) const { return new KisYCbCrU16ColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile * p) const { return new KisYCbCrU16ColorSpace( p); }
virtual KoColorConversionTransformationFactory* createICCColorConversionTransformationFactory(QString _colorModelId, QString _colorDepthId) const
{
return 0;
......
......@@ -33,8 +33,8 @@
#include "compositeops/KoCompositeOpOver.h"
#include "compositeops/KoCompositeOpErase.h"
KisYCbCrU8ColorSpace::KisYCbCrU8ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile */*p*/)
: KisYCbCrBaseColorSpace<YCbCrU8Traits>("YCbCrAU8", i18n("YCbCr (8-bit integer/channel)"), parent)
KisYCbCrU8ColorSpace::KisYCbCrU8ColorSpace( KoColorProfile */*p*/)
: KisYCbCrBaseColorSpace<YCbCrU8Traits>("YCbCrAU8", i18n("YCbCr (8-bit integer/channel)"))
{
addChannel(new KoChannelInfo(i18n("Y"), YCbCrU8Traits::y_pos * sizeof(quint8), KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), QColor(255,0,0)));
addChannel(new KoChannelInfo(i18n("Cb"), YCbCrU8Traits::cb_pos * sizeof(quint8), KoChannelInfo::COLOR, KoChannelInfo::UINT8, sizeof(quint8), QColor(0,255,0)));
......@@ -58,6 +58,6 @@ QList<KoColorConversionTransformationFactory*> KisYCbCrU8ColorSpaceFactory::colo
KoColorSpace* KisYCbCrU8ColorSpace::clone() const
{
return new KisYCbCrU8ColorSpace(0, 0);
return new KisYCbCrU8ColorSpace( 0);
}
......@@ -29,7 +29,7 @@ typedef KoYCbCrTraits<quint8> YCbCrU8Traits;
class KisYCbCrU8ColorSpace : public KisYCbCrBaseColorSpace<YCbCrU8Traits>
{
public:
KisYCbCrU8ColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *p);
KisYCbCrU8ColorSpace( KoColorProfile *p);
virtual bool willDegrade(ColorSpaceIndependence /*independence*/) const {
return false;
}
......@@ -52,7 +52,7 @@ public:
return false;
}
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile * p) const { return new KisYCbCrU8ColorSpace(parent, p); }
virtual KoColorSpace *createColorSpace( KoColorProfile * p) const { return new KisYCbCrU8ColorSpace(p); }
virtual int referenceDepth() const { return 8; }
virtual bool isIcc() const { return false; }
......
......@@ -42,7 +42,7 @@ YCbCrPlugin::YCbCrPlugin(QObject *parent, const QStringList &)
KoColorSpaceRegistry * f = KoColorSpaceRegistry::instance();
// Register U16 YCbCr colorspace
{
KoColorSpace * colorSpaceYCbCr16 = new KisYCbCrU16ColorSpace(f, 0);
KoColorSpace * colorSpaceYCbCr16 = new KisYCbCrU16ColorSpace( 0);
KoColorSpaceFactory *csf = new KisYCbCrU16ColorSpaceFactory();
Q_CHECK_PTR(colorSpaceYCbCr16);
f->add(csf);
......@@ -52,7 +52,7 @@ YCbCrPlugin::YCbCrPlugin(QObject *parent, const QStringList &)
}
// Register U8 YCbCr colorspace
{
KoColorSpace * colorSpaceYCbCr8 = new KisYCbCrU8ColorSpace(f, 0);
KoColorSpace * colorSpaceYCbCr8 = new KisYCbCrU8ColorSpace( 0);
KoColorSpaceFactory *csf = new KisYCbCrU8ColorSpaceFactory();
Q_CHECK_PTR(colorSpaceYCbCr8);
f->add(csf);
......
......@@ -73,7 +73,7 @@ class KisGenericColorSpace : public KoColorSpace {
public:
KisGenericColorSpace() :
KoColorSpace("genericcolorspace", "genericcolorspace",0, 0, new KisGenericColorSpaceConvolutionOpImpl)
KoColorSpace("genericcolorspace", "genericcolorspace",0, new KisGenericColorSpaceConvolutionOpImpl)
{ }
virtual ~KisGenericColorSpace() { }
......
......@@ -42,10 +42,10 @@ public:
return false;
}
KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile * p) const
KoColorSpace *createColorSpace( KoColorProfile * p) const
{
Q_UNUSED( p );
return new KisPainterlyOverlayColorSpace("painterlyoverlay", "", parent);
return new KisPainterlyOverlayColorSpace("painterlyoverlay", "");
}
virtual KoColorConversionTransformationFactory* createICCColorConversionTransformationFactory(QString _colorModelId, QString _colorDepthId) const
{
......@@ -87,8 +87,8 @@ const KisPainterlyOverlayColorSpace * KisPainterlyOverlayColorSpace::instance()
KisPainterlyOverlayColorSpace::KisPainterlyOverlayColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent)
: KoIncompleteColorSpace<PainterlyOverlayFloatTraits>(id, name, parent, parent->rgb16(""))
KisPainterlyOverlayColorSpace::KisPainterlyOverlayColorSpace(const QString &id, const QString &name)
: KoIncompleteColorSpace<PainterlyOverlayFloatTraits>(id, name, KoColorSpaceRegistry::instance()->rgb16(""))
{
addChannel(new KoChannelInfo(i18n("Adsorbency"),
PainterlyOverlayFloatTraits::adsorbency_pos * sizeof(float),
......
......@@ -93,7 +93,7 @@ private: // This is a singleton
friend class KisPainterlyOverlayColorSpaceFactory;
KisPainterlyOverlayColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent);
KisPainterlyOverlayColorSpace(const QString &id, const QString &name);
KisPainterlyOverlayColorSpace(const KisPainterlyOverlayColorSpace&);
KisPainterlyOverlayColorSpace operator=(const KisPainterlyOverlayColorSpace&);
......
......@@ -37,7 +37,6 @@ struct KoColorSpace::Private {
QString id;
QString name;
QHash<QString, KoCompositeOp *> compositeOps;
KoColorSpaceRegistry * parent;
QList<KoChannelInfo *> channels;
KoMixColorsOp* mixColorsOp;
KoConvolutionOp* convolutionOp;
......@@ -62,12 +61,11 @@ KoColorSpace::KoColorSpace()
{
}
KoColorSpace::KoColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent, KoMixColorsOp* mixColorsOp, KoConvolutionOp* convolutionOp )
KoColorSpace::KoColorSpace(const QString &id, const QString &name, KoMixColorsOp* mixColorsOp, KoConvolutionOp* convolutionOp )
: d (new Private())
{
d->id = id;
d->name = name;
d->parent = parent;
d->mixColorsOp = mixColorsOp;
d->convolutionOp = convolutionOp;
d->lastUsedDstColorSpace = 0;
......@@ -180,7 +178,7 @@ const KoColorConversionTransformation* KoColorSpace::toLabA16Converter() const
{
if(not d->transfoToLABA16)
{
d->transfoToLABA16 = d->parent->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->lab16("") ) ;
d->transfoToLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter(this, KoColorSpaceRegistry::instance()->lab16("") ) ;
}
return d->transfoToLABA16;
}
......@@ -188,7 +186,7 @@ const KoColorConversionTransformation* KoColorSpace::fromLabA16Converter() const
{
if(not d->transfoFromLABA16)
{
d->transfoFromLABA16 = d->parent->colorConversionSystem()->createColorConverter( KoColorSpaceRegistry::instance()->lab16("") , this ) ;
d->transfoFromLABA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter( KoColorSpaceRegistry::instance()->lab16("") , this ) ;
}
return d->transfoFromLABA16;
}
......@@ -196,7 +194,7 @@ const KoColorConversionTransformation* KoColorSpace::toRgbA16Converter() const
{
if(not d->transfoToRGBA16)
{
d->transfoToRGBA16 = d->parent->colorConversionSystem()->createColorConverter( this, KoColorSpaceRegistry::instance()->rgb16("") ) ;
d->transfoToRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter( this, KoColorSpaceRegistry::instance()->rgb16("") ) ;
}
return d->transfoToRGBA16;
}
......@@ -204,7 +202,7 @@ const KoColorConversionTransformation* KoColorSpace::fromRgbA16Converter() const
{
if(not d->transfoFromRGBA16)
{
d->transfoFromRGBA16 = d->parent->colorConversionSystem()->createColorConverter( KoColorSpaceRegistry::instance()->rgb16("") , this ) ;
d->transfoFromRGBA16 = KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter( KoColorSpaceRegistry::instance()->rgb16("") , this ) ;
}
return d->transfoFromRGBA16;
}
......@@ -235,7 +233,7 @@ KoColorConversionTransformation* KoColorSpace::createColorConverter(const KoColo
{
return new KoCopyColorConversionTransformation(this);
} else {
return d->parent->colorConversionSystem()->createColorConverter( this, dstColorSpace, renderingIntent);
return KoColorSpaceRegistry::instance()->colorConversionSystem()->createColorConverter( this, dstColorSpace, renderingIntent);
}
}
......@@ -460,3 +458,4 @@ KoColorTransformation* KoColorSpace::createColorTransformation( QString id, QHas
return new KoFallBackColorTransformation( csToFallBack, fallBackToCs, transfo);
}
}
......@@ -37,7 +37,6 @@
class KoCompositeOp;
class KoColorProfile;
class KoColorSpaceRegistry;
class KoColorTransformation;
class KoColorConversionTransformationFactory;
class KisFilter;
......@@ -133,7 +132,7 @@ protected:
public:
/// Should be called by real color spaces
KoColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent, KoMixColorsOp* mixColorsOp, KoConvolutionOp* convolutionOp );
KoColorSpace(const QString &id, const QString &name, KoMixColorsOp* mixColorsOp, KoConvolutionOp* convolutionOp );
virtual ~KoColorSpace();
virtual bool operator==(const KoColorSpace& rhs) const {
......@@ -144,7 +143,7 @@ public:
public:
/**
* Use this function to created a cloned version of this color space,
* Use this function to create a cloned version of this color space,
* and of its profile.
*/
virtual KoColorSpace* clone() const = 0;
......@@ -699,7 +698,7 @@ public:
/**
* creates a color space using the given profile.
*/
virtual KoColorSpace *createColorSpace(KoColorSpaceRegistry * parent, KoColorProfile *) const = 0;
virtual KoColorSpace *createColorSpace(KoColorProfile *) const = 0;
/**
* @return true if the color space follows ICC specification
......
......@@ -281,8 +281,8 @@ class KoInvertColorTransformation : public KoColorTransformation {
template<class _CSTraits>
class KoColorSpaceAbstract : public KoColorSpace {
public:
KoColorSpaceAbstract(const QString &id, const QString &name, KoColorSpaceRegistry * parent ) :
KoColorSpace(id, name, parent, new KoMixColorsOpImpl< _CSTraits>(), new KoConvolutionOpImpl< _CSTraits>())
KoColorSpaceAbstract(const QString &id, const QString &name) :
KoColorSpace(id, name, new KoMixColorsOpImpl< _CSTraits>(), new KoConvolutionOpImpl< _CSTraits>())
{
this->addCompositeOp( new CompositeCopy( this ) );
}
......
......@@ -125,7 +125,7 @@ void KoColorSpaceRegistry::init()
addProfile(defProfile);
// Create the built-in colorspaces
d->alphaCs = new KoAlphaColorSpace(this);
d->alphaCs = new KoAlphaColorSpace();
KoPluginLoader::PluginsConfig config;
config.whiteList = "ColorSpacePlugins";
......@@ -241,7 +241,7 @@ const KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const
kDebug(31000) <<"Profile not found :" << profileName;
return 0;
}
const KoColorSpace *cs = csf->createColorSpace(this, p);
const KoColorSpace *cs = csf->createColorSpace( p);
if(!cs)
return 0;
......@@ -271,7 +271,7 @@ const KoColorSpace * KoColorSpaceRegistry::colorSpace(const QString &csID, const
return 0;
}
cs = csf->createColorSpace(this, const_cast<KoColorProfile *>(profile));
cs = csf->createColorSpace( const_cast<KoColorProfile *>(profile));
if(!cs )
return 0;
......
......@@ -34,8 +34,8 @@ class KoIncompleteColorSpace : public KoColorSpaceAbstract<_CSTraits> {
protected:
KoIncompleteColorSpace(const QString &id,
const QString &name,
KoColorSpaceRegistry * parent, const KoColorSpace* fallBack)
: KoColorSpaceAbstract<_CSTraits>(id, name, parent),
const KoColorSpace* fallBack)
: KoColorSpaceAbstract<_CSTraits>(id, name),
m_fallBackColorSpace(fallBack)
{
m_qcolordata = new quint16[4];
......
......@@ -152,9 +152,9 @@ class KoLcmsColorSpace : public KoColorSpaceAbstract<_CSTraits>, public KoLcmsIn
KoColorProfile* colorProfile;
};
protected:
KoLcmsColorSpace(const QString &id, const QString &name, KoColorSpaceRegistry * parent, DWORD cmType,
KoLcmsColorSpace(const QString &id, const QString &name, DWORD cmType,
icColorSpaceSignature colorSpaceSignature,
KoColorProfile *p) : KoColorSpaceAbstract<_CSTraits>(id, name, parent), KoLcmsInfo( cmType, colorSpaceSignature), d( new Private())
KoColorProfile *p) : KoColorSpaceAbstract<_CSTraits>(id, name), KoLcmsInfo( cmType, colorSpaceSignature), d( new Private())
{
Q_ASSERT(p); // No profile means the lcms color space can't work
......
......@@ -344,8 +344,8 @@ namespace {
}
KoAlphaColorSpace::KoAlphaColorSpace(KoColorSpaceRegistry * parent) :
KoColorSpaceAbstract<AlphaU8Traits>("ALPHA", i18n("Alpha mask"), parent )
KoAlphaColorSpace::KoAlphaColorSpace() :
KoColorSpaceAbstract<AlphaU8Traits>("ALPHA", i18n("Alpha mask") )
{