Commit 7022ebdf authored by Casper Boemann's avatar Casper Boemann

make the grayscale load again

svn path=/trunk/koffice/; revision=467655
parent f7bcb0d1
......@@ -86,6 +86,13 @@ QValueVector<KisProfile *> KisColorSpaceFactoryRegistry::profilesFor(KisColorSp
return profiles;
}
void KisColorSpaceFactoryRegistry::addProfile(KisProfile *p)
{
if (p -> valid()) {
m_profileMap[p->productName()] = p;
}
}
void KisColorSpaceFactoryRegistry::resetProfiles()
{
// XXX: Should find a way to make sure not all profiles are read for all color strategies
......
......@@ -50,6 +50,11 @@ public:
*/
void resetProfiles();
/**
* Add the profile to the list.
*/
void addProfile(KisProfile * p);
/**
* Return the profile associated with the given product name,
* or 0.
......
......@@ -52,6 +52,13 @@ GrayPlugin::GrayPlugin(QObject *parent, const char *name, const QStringList &)
// This is not a gui plugin; only load it when the doc is created.
if ( parent->inherits("KisFactory") )
{
// .22 gamma grayscale or something like that. Taken from the lcms tutorial...
LPGAMMATABLE Gamma = cmsBuildGamma(256, 2.2);
cmsHPROFILE hProfile = cmsCreateGrayProfile(cmsD50_xyY(), Gamma);
cmsFreeGamma(Gamma);
KisProfile *defProfile = new KisProfile(hProfile);
KisColorSpaceFactoryRegistry::instance() -> addProfile(defProfile);
kdDebug() << "defprofile " << defProfile->productName() << endl;
KisColorSpace * colorSpaceGrayA = new KisGrayColorSpace(0);
KisColorSpaceFactory * csf = new KisGrayColorSpaceFactory();
Q_CHECK_PTR(colorSpaceGrayA);
......
......@@ -49,13 +49,7 @@ KisGrayColorSpace::KisGrayColorSpace(KisProfile *p) :
{
m_channels.push_back(new KisChannelInfo(i18n("Gray"), 0, COLOR));
m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 1, ALPHA));
/*
// .22 gamma grayscale or something like that. Taken from the lcms tutorial...
LPGAMMATABLE Gamma = cmsBuildGamma(256, 2.2);
cmsHPROFILE hProfile = cmsCreateGrayProfile(cmsD50_xyY(), Gamma);
cmsFreeGamma(Gamma);
*/
m_alphaPos = PIXEL_GRAY_ALPHA;
init();
......
......@@ -115,7 +115,7 @@ public:
virtual KisColorSpace *createColorSpace(KisProfile *p) { return new KisGrayColorSpace(p); };
virtual QString defaultProfile() { return "sRGB"; };
virtual QString defaultProfile() { return "gray built-in - (lcms internal)"; };
};
#endif // KIS_STRATEGY_COLORSPACE_GRAYSCALE_H_
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