Commit 51238ee8 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Rename all the colormodel classes. Use ColorSpace instead

of Colorspace everywhere to be consistent with lcms and icc34.
I am not done yet, I need to rename some files, too, but cannot
do that without comitting first.

svn path=/trunk/koffice/; revision=444892
parent 04d751d7
......@@ -6,11 +6,11 @@ INCLUDES = -I$(srcdir)/.. \
noinst_LTLIBRARIES = libkiscolor_strategy.la
libkiscolor_strategy_la_SOURCES = kis_strategy_colorspace.cc \
libkiscolor_strategy_la_SOURCES = kis_abstract_colorspace.cc \
kis_colorspace_registry.cc \
kis_colorspace_alpha.cc \
kis_alpha_colorspace.cc \
kis_color_conversions.cc \
kis_colorspace_xyz.cc
kis_xyz_colorspace.cc
libkiscolor_strategy_la_METASOURCES = AUTO
......
......@@ -16,8 +16,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KIS_STRATEGY_COLORSPACE_H_
#define KIS_STRATEGY_COLORSPACE_H_
#ifndef KIS_ABSTRACT_COLORSPACE_H_
#define KIS_ABSTRACT_COLORSPACE_H_
#include <qmap.h>
#include <qcolor.h>
......@@ -61,7 +61,7 @@ struct KisColorAdjustment;
* A colorspace strategy is the definition of a certain color model
* in Krita.
*/
class KRITACORE_EXPORT KisStrategyColorSpace : public KShared {
class KRITACORE_EXPORT KisAbstractColorSpace : public KShared {
public:
......@@ -73,9 +73,9 @@ public:
* @param cmType The littlecms colorstrategy type we wrap.
* @param colorSpaceSignature The icc signature for the colorspace we are.
*/
KisStrategyColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature);
KisAbstractColorSpace(const KisID & id, DWORD cmType, icColorSpaceSignature colorSpaceSignature);
virtual ~KisStrategyColorSpace();
virtual ~KisAbstractColorSpace();
//================== Information about this color strategy ========================//
......@@ -196,6 +196,8 @@ public:
* The profile parameter is the profile of the paint device; the other profile
* 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 nativeColor(const QColor& c, Q_UINT8 *dst, KisProfileSP profile = 0) = 0;
virtual void nativeColor(const QColor& c, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP profile = 0) = 0;
......@@ -204,6 +206,9 @@ public:
* 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
* profile and the display profile as a destination profile.
*
* XXX: We actually do not use the display yet, nor the paint device profile
*
*/
virtual void toQColor(const Q_UINT8 *src, QColor *c, KisProfileSP profile= 0 ) = 0;
virtual void toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP profile = 0) = 0;
......@@ -250,7 +255,7 @@ public:
* Returns false if the conversion failed, true if it succeeded
*/
virtual bool convertPixelsTo(const Q_UINT8 * src, KisProfileSP srcProfile,
Q_UINT8 * dst, KisStrategyColorSpace * dstColorStrategy, KisProfileSP dstProfile,
Q_UINT8 * dst, KisAbstractColorSpace * dstColorStrategy, KisProfileSP dstProfile,
Q_UINT32 numPixels,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL);
......@@ -323,7 +328,7 @@ public:
*/
virtual void bitBlt(Q_UINT8 *dst,
Q_INT32 dststride,
KisStrategyColorSpace * srcSpace,
KisAbstractColorSpace * srcSpace,
const Q_UINT8 *src,
Q_INT32 srcRowStride,
const Q_UINT8 *srcAlphaMask,
......@@ -355,7 +360,7 @@ protected:
Q_INT32 cols,
const KisCompositeOp& op) = 0;
virtual cmsHTRANSFORM createTransform(KisStrategyColorSpace * dstColorStrategy,
virtual cmsHTRANSFORM createTransform(KisAbstractColorSpace * dstColorStrategy,
KisProfileSP srcProfile,
KisProfileSP dstProfile,
Q_INT32 renderingIntent);
......@@ -368,7 +373,18 @@ protected:
*/
KisProfileSP getDefaultProfile() { return m_defaultProfile; };
void setDefaultProfile(KisProfileSP profile) { m_defaultProfile = profile; };
protected:
QStringList m_profileFilenames;
KisProfileSP m_defaultProfile;
Q_UINT8 * m_qcolordata; // A small buffer for conversion from and to qcolor.
Q_INT32 m_alphaPos;
Q_INT32 m_alphaSize;
cmsHTRANSFORM m_defaultToRGB;
cmsHTRANSFORM m_defaultFromRGB;
private:
KisID m_id;
......@@ -378,15 +394,13 @@ private:
typedef QMap<KisProfilePair, cmsHTRANSFORM> TransformMap;
TransformMap m_transforms; // Cache for existing transforms
KisStrategyColorSpace(const KisStrategyColorSpace&);
KisStrategyColorSpace& operator=(const KisStrategyColorSpace&);
KisAbstractColorSpace(const KisAbstractColorSpace&);
KisAbstractColorSpace& operator=(const KisAbstractColorSpace&);
vKisProfileSP m_profiles;
QStringList m_profileFilenames;
KisProfileSP m_defaultProfile;
Q_INT32 m_alphaPos;
Q_INT32 m_alphaSize;
};
#endif // KIS_STRATEGY_COLORSPACE_H_
......@@ -30,7 +30,7 @@
#include "kis_colorspace_registry.h"
#include "kis_image.h"
#include "kis_colorspace_alpha.h"
#include "kis_alpha_colorspace.h"
#include "kis_channelinfo.h"
#include "kis_types.h"
#include "kis_id.h"
......@@ -40,48 +40,48 @@ namespace {
const Q_UINT8 PIXEL_MASK = 0;
}
KisColorSpaceAlpha::KisColorSpaceAlpha() :
KisStrategyColorSpace(KisID("ALPHA", i18n("Alpha mask")), TYPE_GRAY_8, icSigGrayData)
KisAlphaColorSpace::KisAlphaColorSpace() :
KisAbstractColorSpace(KisID("ALPHA", i18n("Alpha mask")), TYPE_GRAY_8, icSigGrayData)
{
m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 0, ALPHA));
}
KisColorSpaceAlpha::~KisColorSpaceAlpha()
KisAlphaColorSpace::~KisAlphaColorSpace()
{
}
void KisColorSpaceAlpha::nativeColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfileSP /*profile*/)
void KisAlphaColorSpace::nativeColor(const QColor& /*c*/, Q_UINT8 *dst, KisProfileSP /*profile*/)
{
dst[PIXEL_MASK] = OPACITY_OPAQUE;
}
void KisColorSpaceAlpha::nativeColor(const QColor& /*c*/, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP /*profile*/)
void KisAlphaColorSpace::nativeColor(const QColor& /*c*/, QUANTUM opacity, Q_UINT8 *dst, KisProfileSP /*profile*/)
{
dst[PIXEL_MASK] = opacity;
}
void KisColorSpaceAlpha::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha)
void KisAlphaColorSpace::getAlpha(const Q_UINT8 *pixel, Q_UINT8 *alpha)
{
*alpha = *pixel;
}
void KisColorSpaceAlpha::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfileSP /*profile*/)
void KisAlphaColorSpace::toQColor(const Q_UINT8 */*src*/, QColor *c, KisProfileSP /*profile*/)
{
c -> setRgb(255, 255, 255);
}
void KisColorSpaceAlpha::toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP /*profile*/)
void KisAlphaColorSpace::toQColor(const Q_UINT8 *src, QColor *c, QUANTUM *opacity, KisProfileSP /*profile*/)
{
c -> setRgb(255, 255, 255);
*opacity = src[PIXEL_MASK];
}
Q_INT8 KisColorSpaceAlpha::difference(const Q_UINT8 *src1, const Q_UINT8 *src2)
Q_INT8 KisAlphaColorSpace::difference(const Q_UINT8 *src1, const Q_UINT8 *src2)
{
return QABS(src2[PIXEL_MASK] - src1[PIXEL_MASK]);
}
void KisColorSpaceAlpha::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const
void KisAlphaColorSpace::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weights, Q_UINT32 nColors, Q_UINT8 *dst) const
{
if (nColors > 0) {
Q_UINT32 total = 0;
......@@ -95,11 +95,11 @@ void KisColorSpaceAlpha::mixColors(const Q_UINT8 **colors, const Q_UINT8 *weight
}
}
vKisChannelInfoSP KisColorSpaceAlpha::channels() const
vKisChannelInfoSP KisAlphaColorSpace::channels() const
{
return m_channels;
}
bool KisColorSpaceAlpha::hasAlpha() const
bool KisAlphaColorSpace::hasAlpha() const
{
return true; // Of course!
}
......@@ -107,7 +107,7 @@ bool KisColorSpaceAlpha::hasAlpha() const
// XXX: We convert the alpha space to create a mask for display in selection previews
// etc. No need to actually use the profiles here to create a mask image -- they don't
// need to be true color.
QImage KisColorSpaceAlpha::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
QImage KisAlphaColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q_INT32 height,
KisProfileSP /*srcProfile*/, KisProfileSP /*dstProfile*/,
Q_INT32 /*renderingIntent*/, float /*exposure*/)
{
......@@ -141,8 +141,8 @@ QImage KisColorSpaceAlpha::convertToQImage(const Q_UINT8 *data, Q_INT32 width, Q
return img;
}
bool KisColorSpaceAlpha::convertPixelsTo(const Q_UINT8 *src, KisProfileSP /*srcProfile*/,
Q_UINT8 *dst, KisStrategyColorSpace * dstColorStrategy, KisProfileSP dstProfile,
bool KisAlphaColorSpace::convertPixelsTo(const Q_UINT8 *src, KisProfileSP /*srcProfile*/,
Q_UINT8 *dst, KisAbstractColorSpace * dstColorStrategy, KisProfileSP dstProfile,
Q_UINT32 numPixels,
Q_INT32 /*renderingIntent*/)
{
......@@ -164,14 +164,14 @@ bool KisColorSpaceAlpha::convertPixelsTo(const Q_UINT8 *src, KisProfileSP /*srcP
}
void KisColorSpaceAlpha::adjustBrightnessContrast(const Q_UINT8 *src, Q_UINT8 *dst, Q_INT8 brightness, Q_INT8 contrast, Q_INT32 nPixels) const
void KisAlphaColorSpace::adjustBrightnessContrast(const Q_UINT8 *src, Q_UINT8 *dst, Q_INT8 brightness, Q_INT8 contrast, Q_INT32 nPixels) const
{
//XXX does nothing for now
}
//XXX bitblt of ColorSpaceAlpha does not take mask into consideration as this is probably not
// used ever
void KisColorSpaceAlpha::bitBlt(Q_UINT8 *dst,
void KisAlphaColorSpace::bitBlt(Q_UINT8 *dst,
Q_INT32 dststride,
const Q_UINT8 *src,
Q_INT32 srcRowStride,
......@@ -285,7 +285,7 @@ void KisColorSpaceAlpha::bitBlt(Q_UINT8 *dst,
}
}
KisCompositeOpList KisColorSpaceAlpha::userVisiblecompositeOps() const
KisCompositeOpList KisAlphaColorSpace::userVisiblecompositeOps() const
{
KisCompositeOpList list;
......@@ -294,7 +294,7 @@ KisCompositeOpList KisColorSpaceAlpha::userVisiblecompositeOps() const
return list;
}
QString KisColorSpaceAlpha::channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
QString KisAlphaColorSpace::channelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
{
Q_ASSERT(channelIndex < nChannels());
Q_UINT32 channelPosition = m_channels[channelIndex] -> pos();
......@@ -302,7 +302,7 @@ QString KisColorSpaceAlpha::channelValueText(const Q_UINT8 *pixel, Q_UINT32 chan
return QString().setNum(pixel[channelPosition]);
}
QString KisColorSpaceAlpha::normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
QString KisAlphaColorSpace::normalisedChannelValueText(const Q_UINT8 *pixel, Q_UINT32 channelIndex) const
{
Q_ASSERT(channelIndex < nChannels());
Q_UINT32 channelPosition = m_channels[channelIndex] -> pos();
......@@ -311,7 +311,7 @@ QString KisColorSpaceAlpha::normalisedChannelValueText(const Q_UINT8 *pixel, Q_U
}
void KisColorSpaceAlpha::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const
void KisAlphaColorSpace::convolveColors(Q_UINT8** colors, Q_INT32 * kernelValues, enumChannelFlags channelFlags, Q_UINT8 *dst, Q_INT32 factor, Q_INT32 offset, Q_INT32 nColors) const
{
Q_INT32 totalAlpha = 0;
......
......@@ -23,17 +23,17 @@
#include <qcolor.h>
#include "kis_global.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
#include "kis_pixel.h"
/**
* The alpha mask is a special color strategy that treats all pixels as
* alpha value with a colour common to the mask. The default color is white.
*/
class KisColorSpaceAlpha : public KisStrategyColorSpace {
class KisAlphaColorSpace : public KisAbstractColorSpace {
public:
KisColorSpaceAlpha();
virtual ~KisColorSpaceAlpha();
KisAlphaColorSpace();
virtual ~KisAlphaColorSpace();
public:
virtual void nativeColor(const QColor& c, Q_UINT8 *dst, KisProfileSP profile = 0);
......@@ -77,7 +77,7 @@ protected:
* Returns false if the conversion failed, true if it succeeded
*/
virtual bool convertPixelsTo(const Q_UINT8 *src, KisProfileSP srcProfile,
Q_UINT8 *dst, KisStrategyColorSpace * dstColorStrategy, KisProfileSP dstProfile,
Q_UINT8 *dst, KisAbstractColorSpace * dstColorStrategy, KisProfileSP dstProfile,
Q_UINT32 numPixels,
Q_INT32 renderingIntent = INTENT_PERCEPTUAL);
......
......@@ -20,7 +20,7 @@
#include "kis_types.h"
#include "kis_colorspace_registry.h"
#include "kis_colorspace_xyz.h"
#include "kis_xyz_colorspace.h"
KisColorSpaceRegistry *KisColorSpaceRegistry::m_singleton = 0;
......@@ -40,7 +40,7 @@ KisColorSpaceRegistry* KisColorSpaceRegistry::instance()
{
KisColorSpaceRegistry::m_singleton = new KisColorSpaceRegistry();
Q_CHECK_PTR(KisColorSpaceRegistry::m_singleton);
m_singleton->add(new KisColorspaceXYZ());
m_singleton->add(new KisXyzColorSpace());
}
return KisColorSpaceRegistry::m_singleton;
}
......
......@@ -34,7 +34,7 @@ class QStringList;
* - a mapping of lcms color model identifiers to color strategies
* - a mapping of icm color model identifiers to color stratiegs
*/
class KRITACORE_EXPORT KisColorSpaceRegistry : public KisGenericRegistry<KisStrategyColorSpace *> {
class KRITACORE_EXPORT KisColorSpaceRegistry : public KisGenericRegistry<KisAbstractColorSpace *> {
public:
virtual ~KisColorSpaceRegistry();
......
......@@ -21,11 +21,11 @@
#include <qcolor.h>
#include "kis_global.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
#include "kis_pixel.h"
#include "kis_integer_maths.h"
class KisColorspaceXYZ : public KisStrategyColorSpace {
class KisXyzColorSpace : public KisAbstractColorSpace {
public:
static const Q_UINT16 U16_OPACITY_OPAQUE = UINT16_MAX;
......@@ -39,8 +39,8 @@ public:
};
public:
KisColorspaceXYZ();
virtual ~KisColorspaceXYZ();
KisXyzColorSpace();
virtual ~KisXyzColorSpace();
public:
......
......@@ -95,7 +95,7 @@ void KisClipboard::clipboardDataChanged()
QImage qimg = cb -> image();
if (!qimg.isNull()) {
KisStrategyColorSpace * cs = KisColorSpaceRegistry::instance()->get(KisID("RGBA",""));
KisAbstractColorSpace * cs = KisColorSpaceRegistry::instance()->get(KisID("RGBA",""));
m_clip =
new KisPaintDevice(cs,
......
......@@ -21,7 +21,7 @@
#include "kis_pixel.h"
#include "kis_color.h"
#include "kis_profile.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
#include "kis_colorspace_registry.h"
KisColor::KisColor()
......@@ -47,7 +47,7 @@ KisColor::KisColor(const QColor & color)
m_profile = 0;
}
KisColor::KisColor(const QColor & color, KisStrategyColorSpace * colorStrategy, KisProfileSP profile)
KisColor::KisColor(const QColor & color, KisAbstractColorSpace * colorStrategy, KisProfileSP profile)
: m_colorStrategy(colorStrategy),
m_profile(profile)
{
......@@ -59,7 +59,7 @@ KisColor::KisColor(const QColor & color, KisStrategyColorSpace * colorStrategy,
}
KisColor::KisColor(const QColor & color, Q_UINT8 alpha, KisStrategyColorSpace * colorStrategy, KisProfileSP profile)
KisColor::KisColor(const QColor & color, Q_UINT8 alpha, KisAbstractColorSpace * colorStrategy, KisProfileSP profile)
: m_colorStrategy(colorStrategy),
m_profile(profile)
{
......@@ -71,7 +71,7 @@ KisColor::KisColor(const QColor & color, Q_UINT8 alpha, KisStrategyColorSpace *
m_colorStrategy->nativeColor(color, alpha, m_data, profile);
}
KisColor::KisColor(const Q_UINT8 * data, KisStrategyColorSpace * colorStrategy, KisProfileSP profile)
KisColor::KisColor(const Q_UINT8 * data, KisAbstractColorSpace * colorStrategy, KisProfileSP profile)
: m_colorStrategy(colorStrategy),
m_profile(profile)
{
......@@ -82,7 +82,7 @@ KisColor::KisColor(const Q_UINT8 * data, KisStrategyColorSpace * colorStrategy,
}
KisColor::KisColor(const KisColor &src, KisStrategyColorSpace * colorStrategy, KisProfileSP profile)
KisColor::KisColor(const KisColor &src, KisAbstractColorSpace * colorStrategy, KisProfileSP profile)
: m_colorStrategy(colorStrategy),
m_profile(profile)
{
......@@ -123,7 +123,7 @@ KisColor & KisColor::operator=(const KisColor & rhs)
return * this;
}
void KisColor::convertTo(KisStrategyColorSpace * cs, KisProfileSP profile)
void KisColor::convertTo(KisAbstractColorSpace * cs, KisProfileSP profile)
{
kdDebug(DBG_AREA_CMS) << "Our colormodel: " << m_colorStrategy->id().name()
<< ", new colormodel: " << cs->id().name() << "\n";
......@@ -144,7 +144,7 @@ void KisColor::convertTo(KisStrategyColorSpace * cs, KisProfileSP profile)
}
void KisColor::setColor(Q_UINT8 * data, KisStrategyColorSpace * colorStrategy, KisProfileSP profile)
void KisColor::setColor(Q_UINT8 * data, KisAbstractColorSpace * colorStrategy, KisProfileSP profile)
{
delete [] m_data;
m_data = new Q_UINT8[colorStrategy->pixelSize()];
......@@ -158,7 +158,7 @@ void KisColor::toQColor(QColor *c) const
{
if (m_colorStrategy && m_data) {
// XXX (bsar): There must be a better way, but I'm getting hopelessly confused about constness by now
KisStrategyColorSpace * cs(const_cast<KisStrategyColorSpace*>(m_colorStrategy));
KisAbstractColorSpace * cs(const_cast<KisAbstractColorSpace*>(m_colorStrategy));
cs->toQColor(m_data, c, m_profile);
}
......@@ -168,7 +168,7 @@ void KisColor::toQColor(QColor *c, QUANTUM *opacity) const
{
if (m_colorStrategy && m_data) {
// XXX (bsar): There must be a better way, but I'm getting hopelessly confused about constness by now
KisStrategyColorSpace * cs(const_cast<KisStrategyColorSpace*>(m_colorStrategy));
KisAbstractColorSpace * cs(const_cast<KisAbstractColorSpace*>(m_colorStrategy));
cs->toQColor(m_data, c, opacity, m_profile);
}
}
......
......@@ -25,7 +25,7 @@
#include "kis_global.h"
#include "kis_types.h"
#include "kis_profile.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
/**
......@@ -46,17 +46,17 @@ public:
// Create a KisColor from a QColor. The QColor is immediately converted to native. The QColor
// is assumed to have the current monitor profile.
KisColor(const QColor & color, KisStrategyColorSpace * colorStrategy, KisProfileSP profile = 0);
KisColor(const QColor & color, KisAbstractColorSpace * colorStrategy, KisProfileSP profile = 0);
// Create a KisColor from a QColor. The QColor is immediately converted to native. The QColor
// is assumed to have the current monitor profile.
KisColor(const QColor & color, Q_UINT8 alpha, KisStrategyColorSpace * colorStrategy, KisProfileSP profile = 0);
KisColor(const QColor & color, Q_UINT8 alpha, KisAbstractColorSpace * colorStrategy, KisProfileSP profile = 0);
// Create a KisColor using a native color strategy. The data is copied.
KisColor(const Q_UINT8 * data, KisStrategyColorSpace * colorStrategy, KisProfileSP profile = 0);
KisColor(const Q_UINT8 * data, KisAbstractColorSpace * colorStrategy, KisProfileSP profile = 0);
// Create a KisColor by converting src into another colorspace
KisColor(const KisColor &src, KisStrategyColorSpace * colorStrategy, KisProfileSP profile = 0);
KisColor(const KisColor &src, KisAbstractColorSpace * colorStrategy, KisProfileSP profile = 0);
// Copy constructor -- deep copies the colors.
KisColor(const KisColor & rhs);
......@@ -67,16 +67,16 @@ public:
// For easy memcpy'ing etc.
Q_UINT8 * data() const { return m_data; }
KisStrategyColorSpace * colorStrategy() const { return m_colorStrategy; }
KisAbstractColorSpace * colorStrategy() const { return m_colorStrategy; }
KisProfileSP profile() const { return m_profile; }
// Convert this KisColor to the specified colorspace. If the specified colorspace is the
// same as the original colorspace, do nothing. Returns the converted KisColor.
void convertTo(KisStrategyColorSpace * cs, KisProfileSP profile = 0);
void convertTo(KisAbstractColorSpace * cs, KisProfileSP profile = 0);
// Replace the existing color data with the specified data.
void setColor(Q_UINT8 * data, KisStrategyColorSpace * colorStrategy = 0, KisProfileSP profile = 0);
void setColor(Q_UINT8 * data, KisAbstractColorSpace * colorStrategy = 0, KisProfileSP profile = 0);
// To save the user the trouble of doing color->colorStrategy()->toQColor(color->data(), &c, &a, profile
void toQColor(QColor *c) const;
......@@ -94,7 +94,7 @@ private:
Q_UINT8 * m_data;
KisStrategyColorSpace * m_colorStrategy;
KisAbstractColorSpace * m_colorStrategy;
KisProfileSP m_profile;
};
......
......@@ -49,7 +49,7 @@
#include "kis_painter.h"
#include "kis_pattern.h"
#include "kis_rect.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
#include "kis_types.h"
#include "kis_vec.h"
#include "kis_selection.h"
......@@ -116,7 +116,7 @@ void KisConvolutionPainter::applyMatrix(KisKernel * kernel, Q_INT32 x, Q_INT32 y
int lastProgressPercent = 0;
emit notifyProgress(this, 0);
KisStrategyColorSpace * cs = m_device->colorStrategy();
KisAbstractColorSpace * cs = m_device->colorStrategy();
// Determine whether we convolve border pixels, or not.
switch (borderOp) {
......
......@@ -65,7 +65,7 @@
#include "kis_fill_painter.h"
#include "kis_command.h"
#include "kis_view.h"
#include "kis_strategy_colorspace.h"
#include "kis_abstract_colorspace.h"
#include "kis_colorspace_registry.h"
#include "kis_profile.h"
#include "kis_id.h"
......@@ -398,7 +398,7 @@ KisImageSP KisDoc::loadImage(const QDomElement& element)
colorspacename = "RGBA";
}
KisStrategyColorSpace * cs = KisColorSpaceRegistry::instance() -> get(colorspacename);
KisAbstractColorSpace * cs = KisColorSpaceRegistry::instance() -> get(colorspacename);
if (cs == 0) {
// return 0;
if (colorspacename == "Grayscale + Alpha")
......@@ -548,13 +548,13 @@ KisLayerSP KisDoc::loadLayer(const QDomElement& element, KisImageSP img)
kdDebug(DBG_AREA_FILE) << "Locked: " << locked<< "\n";
QString colorspacename = element.attribute("colorspacename");
KisStrategyColorSpace * colorSpace = img -> colorStrategy();
KisAbstractColorSpace * colorSpace = img -> colorStrategy();
kdDebug() << "Colorspace name in layer: " << colorspacename << "\n";
kdDebug() << "ColorSpace name in layer: " << colorspacename << "\n";
if (!colorspacename.isNull()) {
colorSpace = KisColorSpaceRegistry::instance() -> get(KisID(colorspacename, ""));
}
kdDebug(DBG_AREA_FILE) << "Colorspace: " << colorspacename << "\n";
kdDebug(DBG_AREA_FILE) << "ColorSpace: " << colorspacename << "\n";
if (colorSpace == 0) {
kdDebug() << "Could not get colorspace: aborting\n";
......@@ -770,7 +770,7 @@ void KisDoc::renameImage(const QString& oldName, const QString& newName)
}