Commit 82df3900 authored by Casper Boemann's avatar Casper Boemann

This is a big one. The colorspaces now have

profiles as attributes rather the being two 
seperate entities.

The colorspace registry has been replaced by a 
colorspace_factory_registry. Each colormode (eg 
rgb_u08) has a factory that make colorspaces. So 
now we can have many colorspaces, but only when 
they have different profiles.

The new registry handles it so that colorspace 
instances are still shared.

Some colorspaces do not have profiles. Wet is one 
of those.

I can't guarantee that there will be no fallout or 
regression.

Nothing new featurewise in this commit, although it 
does open the possibilities for future colorspace 
independence, which we all know IS a big thing.


svn path=/trunk/koffice/; revision=463852
parent 016ce447
...@@ -12,7 +12,7 @@ OPENEXR_SOURCES=kis_f16half_base_colorspace.cc ...@@ -12,7 +12,7 @@ OPENEXR_SOURCES=kis_f16half_base_colorspace.cc
endif endif
libkiscolor_strategy_la_SOURCES = kis_abstract_colorspace.cc \ libkiscolor_strategy_la_SOURCES = kis_abstract_colorspace.cc \
kis_colorspace_registry.cc \ kis_colorspace_factory_registry.cc \
kis_alpha_colorspace.cc \ kis_alpha_colorspace.cc \
kis_color_conversions.cc \ kis_color_conversions.cc \
kis_xyz_colorspace.cc \ kis_xyz_colorspace.cc \
......
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
#include "kis_id.h" #include "kis_id.h"
#include "kis_integer_maths.h" #include "kis_integer_maths.h"
#include "kis_color_conversions.h" #include "kis_color_conversions.h"
#include "kis_colorspace_registry.h" #include "kis_colorspace_factory_registry.h"
#include "kis_channelinfo.h" #include "kis_channelinfo.h"
#include "kis_xyz_colorspace.h" #include "kis_xyz_colorspace.h"
KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, DWORD cmType, icColorSpaceSignature colorSpaceSignature) KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisProfile *p)
: m_id(id), : m_id(id),
m_cmType(cmType), m_cmType(cmType),
m_colorSpaceSignature(colorSpaceSignature) m_colorSpaceSignature(colorSpaceSignature)
...@@ -44,22 +44,19 @@ KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, DWORD cmType, icCo ...@@ -44,22 +44,19 @@ KisAbstractColorSpace::KisAbstractColorSpace(const KisID& id, DWORD cmType, icCo
m_alphaSize = -1; m_alphaSize = -1;
m_qcolordata = 0; m_qcolordata = 0;
m_lastUsedDstProfile = 0; m_lastUsedDstProfile = 0;
m_lastUsedSrcProfile = 0;
m_lastUsedTransform = 0; m_lastUsedTransform = 0;
m_defaultProfile = 0; m_profile = p;
} }
void KisAbstractColorSpace::init() void KisAbstractColorSpace::init()
{ {
// Only create the defaul transforms if
if (m_defaultProfile == 0) return;
// Default pixel buffer for QColor conversion // Default pixel buffer for QColor conversion
m_qcolordata = new Q_UINT8[3]; m_qcolordata = new Q_UINT8[3];
Q_CHECK_PTR(m_qcolordata); Q_CHECK_PTR(m_qcolordata);
cmsHPROFILE hProfile = m_defaultProfile->profile(); if(m_profile==0) return;
cmsHPROFILE hProfile = m_profile->profile();
if (m_cmType != TYPE_BGR_8) { if (m_cmType != TYPE_BGR_8) {
// For conversions from default rgb // For conversions from default rgb
...@@ -96,13 +93,13 @@ KisAbstractColorSpace::~KisAbstractColorSpace() ...@@ -96,13 +93,13 @@ KisAbstractColorSpace::~KisAbstractColorSpace()
bool KisAbstractColorSpace::convertTo(KisPixel& src, KisPixel& dst, Q_INT32 renderingIntent) bool KisAbstractColorSpace::convertTo(KisPixel& src, KisPixel& dst, Q_INT32 renderingIntent)
{ {
return convertPixelsTo(src.channels(), src.profile(), return convertPixelsTo(src.channels(),
dst.channels(), dst.colorSpace(), dst.profile(), dst.channels(), dst.colorSpace(),
renderingIntent); renderingIntent);
} }
bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfile * srcProfile, bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src,
Q_UINT8 * dst, KisColorSpace * dstColorSpace, KisProfile * dstProfile, Q_UINT8 * dst, KisColorSpace * dstColorSpace,
Q_UINT32 numPixels, Q_UINT32 numPixels,
Q_INT32 renderingIntent) Q_INT32 renderingIntent)
{ {
...@@ -112,46 +109,38 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfile * s ...@@ -112,46 +109,38 @@ bool KisAbstractColorSpace::convertPixelsTo(const Q_UINT8 * src, KisProfile * s
Q_INT32 srcPixelSize = pixelSize(); Q_INT32 srcPixelSize = pixelSize();
Q_INT32 dstPixelSize = dstColorSpace -> pixelSize(); Q_INT32 dstPixelSize = dstColorSpace -> pixelSize();
if (!srcProfile) {
srcProfile = getDefaultProfile();
}
if (!dstProfile) {
dstProfile = dstColorSpace->getDefaultProfile();
}
// kdDebug() << "src space: " << id().name() << ", src profile " << srcProfile->productName() // kdDebug() << "src space: " << id().name() << ", src profile " << srcProfile->productName()
// << ", dst space: " << dstColorSpace->id().name() << ", dst profile " << dstProfile->productName() // << ", dst space: " << dstColorSpace->id().name() << ", dst profile " << dstProfile->productName()
// << ", number of pixels: " << numPixels << "\n"; // << ", number of pixels: " << numPixels << "\n";
if (m_lastUsedTransform != 0) { if (m_lastUsedTransform != 0) {
if (dstProfile == m_lastUsedDstProfile && srcProfile == m_lastUsedSrcProfile) if (dstColorSpace->getProfile() == m_lastUsedDstProfile)
tf = m_lastUsedTransform; tf = m_lastUsedTransform;
} }
if (!tf && srcProfile && dstProfile) { if (!tf && m_profile && dstColorSpace->getProfile()) {
if (!m_transforms.contains(KisProfilePair(srcProfile, dstProfile))) { if (!m_transforms.contains(KisProfilePair(m_profile, dstColorSpace->getProfile()))) {
tf = createTransform(dstColorSpace, tf = createTransform(dstColorSpace,
srcProfile, m_profile,
dstProfile, dstColorSpace->getProfile(),
renderingIntent); renderingIntent);
if (tf) { if (tf) {
// kdDebug() << "Going to add transform to cache " // kdDebug() << "Going to add transform to cache "
// << " srcprofile: " << srcProfile->productName() // << " m_profile: " << m_profile->productName()
// << " dstProfile " << dstProfile->productName() << "\n"; // << " dstProfile " << dstColorSpace->getProfile()->productName() << "\n";
m_transforms[KisProfilePair(srcProfile, dstProfile)] = tf; m_transforms[KisProfilePair(m_profile, dstColorSpace->getProfile())] = tf;
} }
} }
else { else {
tf = m_transforms[KisProfilePair(srcProfile, dstProfile)]; tf = m_transforms[KisProfilePair(m_profile, dstColorSpace->getProfile())];
} }
if ( tf ) { if ( tf ) {
m_lastUsedTransform = tf; m_lastUsedTransform = tf;
m_lastUsedSrcProfile = srcProfile; m_lastUsedDstProfile = dstColorSpace->getProfile();
m_lastUsedDstProfile = dstProfile;
} }
} }
...@@ -208,7 +197,7 @@ void KisAbstractColorSpace::applyAdjustment(const Q_UINT8 */*src*/, Q_UINT8 */*d ...@@ -208,7 +197,7 @@ void KisAbstractColorSpace::applyAdjustment(const Q_UINT8 */*src*/, Q_UINT8 */*d
Q_INT8 KisAbstractColorSpace::difference(const Q_UINT8* src1, const Q_UINT8* src2) Q_INT8 KisAbstractColorSpace::difference(const Q_UINT8* src1, const Q_UINT8* src2)
{ {
if ( m_defaultToXYZ != 0 && m_defaultFromXYZ != 0 ) { if ( m_defaultToXYZ != 0 && m_defaultFromXYZ != 0 ) {
Q_INT32 psize = xyz::MAX_CHANNEL_XYZA * sizeof(Q_UINT16); Q_UINT32 psize = xyz::MAX_CHANNEL_XYZA * sizeof(Q_UINT16);
if ( m_conversionCache.size() < 2 * psize ) { if ( m_conversionCache.size() < 2 * psize ) {
...@@ -218,7 +207,7 @@ Q_INT8 KisAbstractColorSpace::difference(const Q_UINT8* src1, const Q_UINT8* src ...@@ -218,7 +207,7 @@ Q_INT8 KisAbstractColorSpace::difference(const Q_UINT8* src1, const Q_UINT8* src
cmsDoTransform( m_defaultToXYZ, const_cast<Q_UINT8*>( src1 ), m_conversionCache.data(), 1); cmsDoTransform( m_defaultToXYZ, const_cast<Q_UINT8*>( src1 ), m_conversionCache.data(), 1);
cmsDoTransform( m_defaultToXYZ, const_cast<Q_UINT8*>( src2 ), m_conversionCache.data() + psize, 1); cmsDoTransform( m_defaultToXYZ, const_cast<Q_UINT8*>( src2 ), m_conversionCache.data() + psize, 1);
return KisColorSpaceRegistry::getXYZ16()->difference( m_conversionCache.data(), m_conversionCache.data() + psize ); return KisColorSpaceFactoryRegistry::getXYZ16()->difference( m_conversionCache.data(), m_conversionCache.data() + psize );
} }
else { else {
...@@ -368,9 +357,7 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, ...@@ -368,9 +357,7 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
Q_UINT8 opacity, Q_UINT8 opacity,
Q_INT32 rows, Q_INT32 rows,
Q_INT32 cols, Q_INT32 cols,
const KisCompositeOp& op, const KisCompositeOp& op)
KisProfile * srcProfile,
KisProfile * dstProfile)
{ {
if (rows <= 0 || cols <= 0) if (rows <= 0 || cols <= 0)
return; return;
...@@ -378,8 +365,8 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, ...@@ -378,8 +365,8 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
if (m_id!= srcSpace -> id()) { if (m_id!= srcSpace -> id()) {
Q_UINT32 len = pixelSize() * rows * cols; Q_UINT32 len = pixelSize() * rows * cols;
if ( !srcProfile ) srcProfile = srcSpace->getDefaultProfile(); KisProfile * srcProfile = srcSpace -> getProfile();
if ( !dstProfile ) dstProfile = getDefaultProfile(); KisProfile * dstProfile = getProfile();
// If our conversion cache is too small, extend it. // If our conversion cache is too small, extend it.
if (!m_conversionCache.resize( len, QGArray::SpeedOptim )) { if (!m_conversionCache.resize( len, QGArray::SpeedOptim )) {
...@@ -390,15 +377,15 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, ...@@ -390,15 +377,15 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
if (srcProfile && dstProfile) { if (srcProfile && dstProfile) {
for (Q_INT32 row = 0; row < rows; row++) { for (Q_INT32 row = 0; row < rows; row++) {
srcSpace -> convertPixelsTo(src + row * srcRowStride, srcProfile, srcSpace -> convertPixelsTo(src + row * srcRowStride,
m_conversionCache.data() + row * cols * pixelSize(), this, dstProfile, m_conversionCache.data() + row * cols * pixelSize(), this,
cols); cols);
} }
} }
else { else {
for (Q_INT32 row = 0; row < rows; row++) { for (Q_INT32 row = 0; row < rows; row++) {
srcSpace -> convertPixelsTo(src + row * srcRowStride, 0, srcSpace -> convertPixelsTo(src + row * srcRowStride,
m_conversionCache.data() + row * cols * pixelSize(), this, 0, m_conversionCache.data() + row * cols * pixelSize(), this,
cols); cols);
} }
} }
...@@ -433,34 +420,24 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst, ...@@ -433,34 +420,24 @@ void KisAbstractColorSpace::bitBlt(Q_UINT8 *dst,
} }
} }
QValueVector<KisProfile *> KisAbstractColorSpace::profiles()
{
return KisColorSpaceRegistry::instance()->profilesFor( this );
}
Q_INT32 KisAbstractColorSpace::profileCount()
{
return KisColorSpaceRegistry::instance()->profilesFor( this ).size();
}
QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, QImage KisAbstractColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfile * srcProfile, KisProfile * dstProfile, KisProfile * dstProfile,
Q_INT32 renderingIntent, float /*exposure*/) Q_INT32 renderingIntent, float /*exposure*/)
{ {
QImage img = QImage(width, height, 32, 0, QImage::LittleEndian); QImage img = QImage(width, height, 32, 0, QImage::LittleEndian);
img.setAlphaBuffer( true ); img.setAlphaBuffer( true );
KisColorSpace * dstCS = KisColorSpaceRegistry::instance() -> get("RGBA"); KisColorSpace * dstCS = KisColorSpaceFactoryRegistry::instance() -> getColorSpace(KisID("RGBA",""),"");
printf("profile = %d dstProfile = %d\n",getProfile(),dstProfile);
if (! srcProfile && ! dstProfile) { if(getProfile())
srcProfile = getDefaultProfile(); printf("profile = %s\n",getProfile()->productName().ascii());
dstProfile = dstCS->getDefaultProfile(); if(dstProfile)
} printf("dstProfile = %s\n",dstProfile->productName().ascii());
if(dstCS->getProfile())
printf("dstCS->Profile = %s\n",dstCS->getProfile()->productName().ascii());
convertPixelsTo(const_cast<Q_UINT8 *>(data), srcProfile, convertPixelsTo(const_cast<Q_UINT8 *>(data), img.bits(), dstCS, width * height, renderingIntent);
img.bits(), dstCS, dstProfile,
width * height, renderingIntent);
return img; return img;
} }
......
...@@ -71,12 +71,13 @@ public: ...@@ -71,12 +71,13 @@ public:
* @param id The Krita identification of this color model. * @param id The Krita identification of this color model.
* @param cmType The littlecms colorstrategy type we wrap. * @param cmType The littlecms colorstrategy type we wrap.
* @param colorSpaceSignature The icc signature for the colorspace we are. * @param colorSpaceSignature The icc signature for the colorspace we are.
* @param p The KisProfile for the colorspace we are, can be 0.
*/ */
KisAbstractColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature); KisAbstractColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature, KisProfile *p);
/** /**
* After creating the default profile, call init to setup the default * Call init to setup the default
* colortransforms from and to rgb and xyz -- if your colorspace needs * colortransforms from and to sRGB and xyz -- if your colorspace needs
* the fallback to the default transforms for the qcolor conversion * the fallback to the default transforms for the qcolor conversion
* and the default pixel ops. * and the default pixel ops.
*/ */
...@@ -175,16 +176,9 @@ public: ...@@ -175,16 +176,9 @@ public:
//========== Display profiles =============================================// //========== Display profiles =============================================//
/** /**
* Get a list of profiles that apply to this color space * Return the profile of this color space. This may be 0
*/ */
QValueVector<KisProfile *> profiles(); virtual KisProfile * getProfile() { return m_profile; };
/**
* Return the number of profiles available for this color space
*/
Q_INT32 profileCount();
//================= Conversion functions ==================================// //================= Conversion functions ==================================//
...@@ -195,29 +189,24 @@ public: ...@@ -195,29 +189,24 @@ public:
* and fills a byte array with the corresponding color in the * and fills a byte array with the corresponding color in the
* the colorspace managed by this strategy. * the colorspace managed by this strategy.
* *
* The profile parameter is the profile of the paint device; the other profile * XXX: We actually do not use the display profile yet
* is the display profile -- since we are moving from QColor
* that have most likely been picked from the display itself.
*
* XXX: We actually do not use the display yet, nor the paint device profile
*/ */
virtual void fromQColor(const QColor& c, Q_UINT8 *dst, KisProfile * profile = 0) = 0; virtual void fromQColor(const QColor& c, Q_UINT8 *dst) = 0;
virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * profile = 0) = 0; virtual void fromQColor(const QColor& c, Q_UINT8 opacity, Q_UINT8 *dst) = 0;
/** /**
* The toQColor methods take a byte array that is at least pixelSize() long * The toQColor methods take a byte array that is at least pixelSize() long
* and converts the contents to a QColor, using the given profile as a source * and converts the contents to a QColor, using the display profile as a destination profile.
* profile and the display profile as a destination profile.
* *
* XXX: We actually do not use the display yet, nor the paint device profile * XXX: We actually do not use the display profile yet
* *
*/ */
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfile * profile= 0 ) = 0; virtual void toQColor(const Q_UINT8 *src, QColor *c) = 0;
virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * profile = 0) = 0; virtual void toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity) = 0;
virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src, KisProfile * profile) = 0; virtual KisPixelRO toKisPixelRO(const Q_UINT8 *src) = 0;
virtual KisPixel toKisPixel(Q_UINT8 *src, KisProfile * profile) = 0; virtual KisPixel toKisPixel(Q_UINT8 *src) = 0;
/** /**
* This function is used to convert a KisPixelRepresentation from this color strategy to the specified * This function is used to convert a KisPixelRepresentation from this color strategy to the specified
...@@ -235,13 +224,12 @@ public: ...@@ -235,13 +224,12 @@ public:
* @param data A pointer to a contiguous memory region containing width * height pixels * @param data A pointer to a contiguous memory region containing width * height pixels
* @param width in pixels * @param width in pixels
* @param height in pixels * @param height in pixels
* @param srcProfile source profile
* @param dstProfile destination profile * @param dstProfile destination profile
* @param renderingIntent the rendering intent * @param renderingIntent the rendering intent
* @param exposure The exposure setting for rendering a preview of a high dynamic range image. * @param exposure The exposure setting for rendering a preview of a high dynamic range image.
*/ */
virtual QImage convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height, virtual QImage convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfile * srcProfile, KisProfile * dstProfile, KisProfile * dstProfile,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL, Q_INT32 renderingIntent = INTENT_PERCEPTUAL,
float exposure = 0.0f); float exposure = 0.0f);
...@@ -253,8 +241,8 @@ public: ...@@ -253,8 +241,8 @@ public:
* *
* Returns false if the conversion failed, true if it succeeded * Returns false if the conversion failed, true if it succeeded
*/ */
virtual bool convertPixelsTo(const Q_UINT8 * src, KisProfile * srcProfile, virtual bool convertPixelsTo(const Q_UINT8 * src,
Q_UINT8 * dst, KisColorSpace * dstColorSpace, KisProfile * dstProfile, Q_UINT8 * dst, KisColorSpace * dstColorSpace,
Q_UINT32 numPixels, Q_UINT32 numPixels,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL); Q_INT32 renderingIntent = INTENT_PERCEPTUAL);
...@@ -368,17 +356,8 @@ public: ...@@ -368,17 +356,8 @@ public:
Q_UINT8 opacity, Q_UINT8 opacity,
Q_INT32 rows, Q_INT32 rows,
Q_INT32 cols, Q_INT32 cols,
const KisCompositeOp& op, const KisCompositeOp& op);
KisProfile * srcProfile = 0,
KisProfile * dstProfile = 0);
/**
* Return the default profile for this colorspace. This may be 0.
*/
virtual KisProfile * getDefaultProfile() { return m_defaultProfile; };
void setDefaultProfile(KisProfile * profile) { m_defaultProfile = profile; };
//========================== END of Public API ========================================// //========================== END of Public API ========================================//
...@@ -410,7 +389,6 @@ protected: ...@@ -410,7 +389,6 @@ protected:
protected: protected:
QStringList m_profileFilenames; QStringList m_profileFilenames;
KisProfile * m_defaultProfile;
Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor. Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor.
Q_INT32 m_alphaPos; // The position in _bytes_ of the alpha channel Q_INT32 m_alphaPos; // The position in _bytes_ of the alpha channel
Q_INT32 m_alphaSize; // The width in _bytes_ of the alpha channel Q_INT32 m_alphaSize; // The width in _bytes_ of the alpha channel
...@@ -420,7 +398,7 @@ protected: ...@@ -420,7 +398,7 @@ protected:
cmsHTRANSFORM m_defaultToXYZ; cmsHTRANSFORM m_defaultToXYZ;
cmsHTRANSFORM m_defaultFromXYZ; cmsHTRANSFORM m_defaultFromXYZ;
KisProfile * m_lastUsedSrcProfile; KisProfile * m_profile;
KisProfile * m_lastUsedDstProfile; KisProfile * m_lastUsedDstProfile;
cmsHTRANSFORM m_lastUsedTransform; cmsHTRANSFORM m_lastUsedTransform;
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include LCMS_HEADER #include LCMS_HEADER
#include "kis_colorspace_registry.h"
#include "kis_image.h" #include "kis_image.h"
#include "kis_alpha_colorspace.h" #include "kis_alpha_colorspace.h"
#include "kis_u8_base_colorspace.h" #include "kis_u8_base_colorspace.h"
...@@ -41,24 +40,23 @@ namespace { ...@@ -41,24 +40,23 @@ namespace {
const Q_UINT8 PIXEL_MASK = 0; const Q_UINT8 PIXEL_MASK = 0;
} }
KisAlphaColorSpace::KisAlphaColorSpace() : KisAlphaColorSpace::KisAlphaColorSpace(KisProfile *p) :
KisU8BaseColorSpace(KisID("ALPHA", i18n("Alpha mask")), TYPE_GRAY_8, icSigGrayData) KisU8BaseColorSpace(KisID("ALPHA", i18n("Alpha mask")), TYPE_GRAY_8, icSigGrayData, p)
{ {
m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 0, ALPHA)); m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 0, ALPHA));
m_alphaPos = 0; m_alphaPos = 0;
m_defaultProfile = 0;
} }
KisAlphaColorSpace::~KisAlphaColorSpace() KisAlphaColorSpace::~KisAlphaColorSpace()
{ {
} }
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfile * /*profile*/) void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 *dst)
{ {
dst[PIXEL_MASK] = OPACITY_OPAQUE; dst[PIXEL_MASK] = OPACITY_OPAQUE;
} }
void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 opacity, Q_UINT8 *dst, KisProfile * /*profile*/) void KisAlphaColorSpace::fromQColor(const QColor& /*c*/, Q_UINT8 opacity, Q_UINT8 *dst)
{ {
dst[PIXEL_MASK] = opacity; dst[PIXEL_MASK] = opacity;
} }
...@@ -68,12 +66,12 @@ void KisAlphaColorSpace::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha) ...@@ -68,12 +66,12 @@ void KisAlphaColorSpace::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha)
*alpha = *pixel; *alpha = *pixel;
} }
void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfile * /*profile*/) void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c)
{ {
c -> setRgb(255, 255, 255); c -> setRgb(255, 255, 255);
} }
void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity, KisProfile * /*profile*/) void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, Q_UINT8 *opacity)
{ {
c -> setRgb(255, 255, 255); c -> setRgb(255, 255, 255);
*opacity = src[PIXEL_MASK]; *opacity = src[PIXEL_MASK];
...@@ -145,12 +143,12 @@ QImage KisAlphaColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q ...@@ -145,12 +143,12 @@ QImage KisAlphaColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q
} }