Commit b0966ddc authored by Casper Boemann's avatar Casper Boemann

Move color management from Krita to Koffice libs. Currently only Krita

uses it though, but that will change soon.

Karbon will break on this commit. Simply replace KoColor with KoColorOld 
in Karbon to make it work.


svn path=/trunk/koffice/; revision=548209
parent 96ce5e7e
......@@ -40,11 +40,13 @@ set(KOSTORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/store ${CMAKE_BINARY_DIR}/libs/sto
set(KOFFICECORE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficecore ${CMAKE_BINARY_DIR}/libs/kofficecore ${KOSTORE_INCLUDES})
# kofficeui depends on kofficecore
set(KOFFICEUI_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kofficeui ${CMAKE_BINARY_DIR}/libs/kofficeui ${KOFFICECORE_INCLUDES} ${FLAKE_INCLUDES} )
# pigment depends on kofficecore
set(PIGMENT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/pigment ${CMAKE_SOURCE_DIR}/libs/pigment/colorspaces ${KOFFICECORE_INCLUDES} )
# The rest must be specified independently, in addition to one of the above three
set(KWMF_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kwmf ${CMAKE_BINARY_DIR}/libs/kwmf)
set(KOTEXT_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kotext ${CMAKE_BINARY_DIR}/libs/kotext)
set(KOPAINTER_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter)
set(KOPAINTER_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopainter ${CMAKE_BINARY_DIR}/libs/kopainter ${CMAKE_SOURCE_DIR}/libs/pigment)
set(KOPALETTE_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kopalette ${CMAKE_BINARY_DIR}/libs/kopalette)
set(KFORMULA_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kformula ${CMAKE_BINARY_DIR}/libs/kformula)
set(KROSS_INCLUDES ${CMAKE_SOURCE_DIR}/libs/kross ${CMAKE_BINARY_DIR}/libs/kross)
......
......@@ -89,6 +89,7 @@ if (SHOULD_BUILD_KRITA)
${KOPALETTE_INCLUDES}
${KOFFICEUI_INCLUDES}
${LCMS_INCLUDE_DIR}
${PIGMENT_INCLUDES}
# 'Export' this for use by filters
CACHE INTERNAL ""
......
......@@ -24,7 +24,7 @@
#include <kdebug.h>
#include <kis_debug_areas.h>
#include <kis_colorspace_factory_registry.h>
#include <KoColorSpaceFactoryRegistry.h>
#include <kis_basic_histogram_producers.h>
#include <kis_debug_areas.h>
#include "cmyk_u16_plugin.h"
......@@ -39,17 +39,17 @@ CMYKU16Plugin::CMYKU16Plugin(QObject *parent, const QStringList &)
{
setInstance(CMYKU16PluginFactory::instance());
if ( parent->inherits("KisColorSpaceFactoryRegistry") )
if ( parent->inherits("KoColorSpaceFactoryRegistry") )
{
KisColorSpaceFactoryRegistry * f = dynamic_cast<KisColorSpaceFactoryRegistry*>( parent );
KoColorSpaceFactoryRegistry * f = dynamic_cast<KoColorSpaceFactoryRegistry*>( parent );
KisColorSpace * colorSpaceCMYKU16 = new KisCmykU16ColorSpace(f, 0);
KisColorSpaceFactory * csf = new KisCmykU16ColorSpaceFactory();
KoColorSpace * colorSpaceCMYKU16 = new KisCmykU16ColorSpace(f, 0);
KoColorSpaceFactory * csf = new KisCmykU16ColorSpaceFactory();
Q_CHECK_PTR(colorSpaceCMYKU16);
f->add(csf);
KisHistogramProducerFactoryRegistry::instance()->add(
new KisBasicHistogramProducerFactory<KisBasicU16HistogramProducer>
(KisID("CMYK16HISTO", i18n("CMYK16 Histogram")), colorSpaceCMYKU16) );
(KoID("CMYK16HISTO", i18n("CMYK16 Histogram")), colorSpaceCMYKU16) );
}
}
......
......@@ -30,26 +30,26 @@
#include <kis_debug_areas.h>
#include "kis_cmyk_u16_colorspace.h"
#include "kis_u16_base_colorspace.h"
#include "KoU16ColorSpaceTrait.h"
#include "kis_color_conversions.h"
#include "kis_integer_maths.h"
#include "kis_colorspace_factory_registry.h"
#include "KoColorSpaceFactoryRegistry.h"
namespace {
const qint32 MAX_CHANNEL_CMYK = 4;
const qint32 MAX_CHANNEL_CMYKA = 5;
}
KisCmykU16ColorSpace::KisCmykU16ColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) :
KisColorSpace(KisID("CMYKA16", i18n("CMYK (16-bit integer/channel)")), parent)
, KisU16BaseColorSpace(PIXEL_ALPHA * sizeof(quint16))
, KisLcmsBaseColorSpace(TYPE_CMYK5_16, icSigCmykData, p)
KisCmykU16ColorSpace::KisCmykU16ColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p) :
KoColorSpace(KoID("CMYKA16", i18n("CMYK (16-bit integer/channel)")), parent)
, KoU16ColorSpaceTrait(PIXEL_ALPHA * sizeof(quint16))
, KoLcmsColorSpaceTrait(TYPE_CMYK5_16, icSigCmykData, p)
{
m_channels.push_back(new KisChannelInfo(i18n("Cyan"), 0 * sizeof(quint16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(quint16), Qt::cyan));
m_channels.push_back(new KisChannelInfo(i18n("Magenta"), 1 * sizeof(quint16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(quint16), Qt::magenta));
m_channels.push_back(new KisChannelInfo(i18n("Yellow"), 2 * sizeof(quint16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(quint16), Qt::yellow));
m_channels.push_back(new KisChannelInfo(i18n("Black"), 3 * sizeof(quint16), KisChannelInfo::COLOR, KisChannelInfo::UINT16, sizeof(quint16), Qt::black));
m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 4 * sizeof(quint16), KisChannelInfo::ALPHA, KisChannelInfo::UINT16, sizeof(quint16)));
m_channels.push_back(new KoChannelInfo(i18n("Cyan"), 0 * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::cyan));
m_channels.push_back(new KoChannelInfo(i18n("Magenta"), 1 * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::magenta));
m_channels.push_back(new KoChannelInfo(i18n("Yellow"), 2 * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::yellow));
m_channels.push_back(new KoChannelInfo(i18n("Black"), 3 * sizeof(quint16), KoChannelInfo::COLOR, KoChannelInfo::UINT16, sizeof(quint16), Qt::black));
m_channels.push_back(new KoChannelInfo(i18n("Alpha"), 4 * sizeof(quint16), KoChannelInfo::ALPHA, KoChannelInfo::UINT16, sizeof(quint16)));
init();
}
......@@ -98,7 +98,7 @@ void KisCmykU16ColorSpace::mixColors(const quint8 **colors, const quint8 *weight
dstPixel->black = totalBlack;
}
void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KoChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
{
qint32 totalCyan = 0, totalMagenta = 0, totalYellow = 0, totalK = 0, totalAlpha = 0;
......@@ -121,13 +121,13 @@ void KisCmykU16ColorSpace::convolveColors(quint8** colors, qint32* kernelValues,
Pixel * p = reinterpret_cast< Pixel *>( dst );
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
if (channelFlags & KoChannelInfo::FLAG_COLOR) {
p->cyan = CLAMP( ( totalCyan / factor) + offset, 0, quint16_MAX);
p->magenta = CLAMP( ( totalMagenta / factor) + offset, 0, quint16_MAX);
p->yellow = CLAMP( ( totalYellow / factor) + offset, 0, quint16_MAX);
p->black = CLAMP( ( totalK / factor) + offset, 0, quint16_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
if (channelFlags & KoChannelInfo::FLAG_ALPHA) {
p->alpha = CLAMP((totalAlpha/ factor) + offset, 0, quint16_MAX);
}
}
......@@ -150,7 +150,7 @@ void KisCmykU16ColorSpace::invertColor(quint8 * src, qint32 nPixels)
void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColorAdjustment *adj, qint32 nPixels)
void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KoColorAdjustment *adj, qint32 nPixels)
{
quint32 psize = pixelSize();
......@@ -158,7 +158,7 @@ void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisCo
quint8 * tmpPtr = tmp;
memcpy(tmp, dst, nPixels * psize);
KisLcmsBaseColorSpace::applyAdjustment(src, dst, adj, nPixels);
KoLcmsColorSpaceTrait::applyAdjustment(src, dst, adj, nPixels);
// Copy the alpha, which lcms doesn't do for us, grumble.
......@@ -176,7 +176,7 @@ void KisCmykU16ColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisCo
delete [] tmp;
}
Q3ValueVector<KisChannelInfo *> KisCmykU16ColorSpace::channels() const
Q3ValueVector<KoChannelInfo *> KisCmykU16ColorSpace::channels() const
{
return m_channels;
}
......@@ -563,7 +563,7 @@ void KisCmykU16ColorSpace::bitBlt(quint8 *dst,
quint8 U8_opacity,
qint32 rows,
qint32 cols,
const KisCompositeOp& op)
const KoCompositeOp& op)
{
quint16 opacity = UINT8_TO_UINT16(U8_opacity);
......@@ -688,19 +688,19 @@ void KisCmykU16ColorSpace::bitBlt(quint8 *dst,
}
}
KisCompositeOpList KisCmykU16ColorSpace::userVisiblecompositeOps() const
KoCompositeOpList KisCmykU16ColorSpace::userVisiblecompositeOps() const
{
KisCompositeOpList list;
list.append(KisCompositeOp(COMPOSITE_OVER));
list.append(KisCompositeOp(COMPOSITE_MULT));
list.append(KisCompositeOp(COMPOSITE_BURN));
list.append(KisCompositeOp(COMPOSITE_DODGE));
list.append(KisCompositeOp(COMPOSITE_DIVIDE));
list.append(KisCompositeOp(COMPOSITE_SCREEN));
list.append(KisCompositeOp(COMPOSITE_OVERLAY));
list.append(KisCompositeOp(COMPOSITE_DARKEN));
list.append(KisCompositeOp(COMPOSITE_LIGHTEN));
KoCompositeOpList list;
list.append(KoCompositeOp(COMPOSITE_OVER));
list.append(KoCompositeOp(COMPOSITE_MULT));
list.append(KoCompositeOp(COMPOSITE_BURN));
list.append(KoCompositeOp(COMPOSITE_DODGE));
list.append(KoCompositeOp(COMPOSITE_DIVIDE));
list.append(KoCompositeOp(COMPOSITE_SCREEN));
list.append(KoCompositeOp(COMPOSITE_OVERLAY));
list.append(KoCompositeOp(COMPOSITE_DARKEN));
list.append(KoCompositeOp(COMPOSITE_LIGHTEN));
return list;
}
......@@ -23,12 +23,12 @@
#include <krita_export.h>
#include "kis_global.h"
#include "kis_u16_base_colorspace.h"
#include "kis_lcms_base_colorspace.h"
#include "KoU16ColorSpaceTrait.h"
#include "KoLcmsColorSpaceTrait.h"
#include "kis_integer_maths.h"
class KRITACOLOR_EXPORT KisCmykU16ColorSpace : public KisU16BaseColorSpace, public KisLcmsBaseColorSpace {
class KRITACOLOR_EXPORT KisCmykU16ColorSpace : public KoU16ColorSpaceTrait, public KoLcmsColorSpaceTrait {
public:
struct Pixel {
......@@ -40,7 +40,7 @@ public:
};
public:
KisCmykU16ColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p);
KisCmykU16ColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p);
virtual ~KisCmykU16ColorSpace();
virtual bool willDegrade(ColorSpaceIndependence independence)
......@@ -53,18 +53,18 @@ public:
public:
virtual Q3ValueVector<KisChannelInfo *> channels() const;
virtual Q3ValueVector<KoChannelInfo *> channels() const;
virtual quint32 nChannels() const;
virtual quint32 nColorChannels() const;
virtual quint32 pixelSize() const;
virtual void applyAdjustment(const quint8 *src, quint8 *dst, KisColorAdjustment *adj, qint32 nPixels);
virtual void applyAdjustment(const quint8 *src, quint8 *dst, KoColorAdjustment *adj, qint32 nPixels);
virtual void mixColors(const quint8 **colors, const quint8 *weights, quint32 nColors, quint8 *dst) const;
virtual void invertColor(quint8 * src, qint32 nPixels);
virtual void convolveColors(quint8** colors, qint32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const;
virtual void convolveColors(quint8** colors, qint32 * kernelValues, KoChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const;
virtual void getSingleChannelPixel(quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex);
virtual KisCompositeOpList userVisiblecompositeOps() const;
virtual KoCompositeOpList userVisiblecompositeOps() const;
protected:
......@@ -77,7 +77,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KisCompositeOp& op);
const KoCompositeOp& op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint16 opacity);
......@@ -100,14 +100,14 @@ private:
static const quint8 PIXEL_ALPHA = 4;
};
class KisCmykU16ColorSpaceFactory : public KisColorSpaceFactory
class KisCmykU16ColorSpaceFactory : public KoColorSpaceFactory
{
public:
/**
* Krita definition for use in .kra files and internally: unchanging name +
* i18n'able description.
*/
virtual KisID id() const { return KisID("CMYKA16", i18n("CMYK (16-bit integer/channel)")); };
virtual KoID id() const { return KoID("CMYKA16", i18n("CMYK (16-bit integer/channel)")); };
/**
* lcms colorspace type definition.
......@@ -116,7 +116,7 @@ public:
virtual icColorSpaceSignature colorSpaceSignature() { return icSigCmykData; };
virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) { return new KisCmykU16ColorSpace(parent, p); };
virtual KoColorSpace *createColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p) { return new KisCmykU16ColorSpace(parent, p); };
virtual QString defaultProfile() { return "Adobe CMYK"; };
};
......
......@@ -28,7 +28,7 @@
#include <kgenericfactory.h>
#include <kis_debug_areas.h>
#include <kis_colorspace_factory_registry.h>
#include <KoColorSpaceFactoryRegistry.h>
#include <kis_basic_histogram_producers.h>
#include "cmyk_plugin.h"
......@@ -43,18 +43,18 @@ CMYKPlugin::CMYKPlugin(QObject *parent, const QStringList &)
: KParts::Plugin(parent)
{
setInstance(CMYKPluginFactory::instance());
if ( parent->inherits("KisColorSpaceFactoryRegistry") )
if ( parent->inherits("KoColorSpaceFactoryRegistry") )
{
KisColorSpaceFactoryRegistry * f = dynamic_cast<KisColorSpaceFactoryRegistry*>( parent );
KoColorSpaceFactoryRegistry * f = dynamic_cast<KoColorSpaceFactoryRegistry*>( parent );
KisColorSpace * colorSpaceCMYK = new KisCmykColorSpace(f, 0);
KisColorSpaceFactory * csf = new KisCmykColorSpaceFactory();
KoColorSpace * colorSpaceCMYK = new KisCmykColorSpace(f, 0);
KoColorSpaceFactory * csf = new KisCmykColorSpaceFactory();
Q_CHECK_PTR(colorSpaceCMYK);
f->add(csf);
KisHistogramProducerFactoryRegistry::instance()->add(
new KisBasicHistogramProducerFactory<KisBasicU8HistogramProducer>
(KisID("CMYKHISTO", i18n("CMYK Histogram")), colorSpaceCMYK) );
(KoID("CMYKHISTO", i18n("CMYK Histogram")), colorSpaceCMYK) );
}
}
......
......@@ -26,27 +26,27 @@
#include <klocale.h>
#include "kis_cmyk_colorspace.h"
#include "kis_u8_base_colorspace.h"
#include "kis_colorspace_factory_registry.h"
#include "KoU8ColorSpaceTrait.h"
#include "KoColorSpaceFactoryRegistry.h"
#include "kis_profile.h"
#include "kis_integer_maths.h"
#include "KoColorProfile.h"
#include "KoIntegerMaths.h"
namespace cmyk {
const qint32 MAX_CHANNEL_CMYK = 4;
const qint32 MAX_CHANNEL_CMYKA = 5;
}
KisCmykColorSpace::KisCmykColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) :
KisColorSpace(KisID("CMYK", i18n("CMYK")), parent)
, KisU8BaseColorSpace(PIXEL_CMYK_ALPHA)
, KisLcmsBaseColorSpace(TYPE_CMYK5_8, icSigCmykData, p)
KisCmykColorSpace::KisCmykColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p) :
KoColorSpace(KoID("CMYK", i18n("CMYK")), parent)
, KoU8ColorSpaceTrait(PIXEL_CMYK_ALPHA)
, KoLcmsColorSpaceTrait(TYPE_CMYK5_8, icSigCmykData, p)
{
m_channels.push_back(new KisChannelInfo(i18n("Cyan"), 0, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, Qt::cyan));
m_channels.push_back(new KisChannelInfo(i18n("Magenta"), 1, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, Qt::magenta));
m_channels.push_back(new KisChannelInfo(i18n("Yellow"), 2, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, Qt::yellow));
m_channels.push_back(new KisChannelInfo(i18n("Black"), 3, KisChannelInfo::COLOR, KisChannelInfo::UINT8, 1, Qt::black));
m_channels.push_back(new KisChannelInfo(i18n("Alpha"), 4, KisChannelInfo::ALPHA, KisChannelInfo::UINT8, 1, Qt::white));
m_channels.push_back(new KoChannelInfo(i18n("Cyan"), 0, KoChannelInfo::COLOR, KoChannelInfo::UINT8, 1, Qt::cyan));
m_channels.push_back(new KoChannelInfo(i18n("Magenta"), 1, KoChannelInfo::COLOR, KoChannelInfo::UINT8, 1, Qt::magenta));
m_channels.push_back(new KoChannelInfo(i18n("Yellow"), 2, KoChannelInfo::COLOR, KoChannelInfo::UINT8, 1, Qt::yellow));
m_channels.push_back(new KoChannelInfo(i18n("Black"), 3, KoChannelInfo::COLOR, KoChannelInfo::UINT8, 1, Qt::black));
m_channels.push_back(new KoChannelInfo(i18n("Alpha"), 4, KoChannelInfo::ALPHA, KoChannelInfo::UINT8, 1, Qt::white));
init();
}
......@@ -105,7 +105,7 @@ void KisCmykColorSpace::mixColors(const quint8 **colors, const quint8 *weights,
}
void KisCmykColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
void KisCmykColorSpace::convolveColors(quint8** colors, qint32* kernelValues, KoChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const
{
qint32 totalCyan = 0, totalMagenta = 0, totalYellow = 0, totalK = 0, totalAlpha = 0;
......@@ -125,13 +125,13 @@ void KisCmykColorSpace::convolveColors(quint8** colors, qint32* kernelValues, Ki
}
if (channelFlags & KisChannelInfo::FLAG_COLOR) {
if (channelFlags & KoChannelInfo::FLAG_COLOR) {
dst[PIXEL_CYAN] = CLAMP((totalCyan / factor) + offset, 0, quint8_MAX);
dst[PIXEL_MAGENTA] = CLAMP((totalMagenta / factor) + offset, 0, quint8_MAX);
dst[PIXEL_YELLOW] = CLAMP((totalYellow / factor) + offset, 0, quint8_MAX);
dst[PIXEL_BLACK] = CLAMP((totalK / factor) + offset, 0, quint8_MAX);
}
if (channelFlags & KisChannelInfo::FLAG_ALPHA) {
if (channelFlags & KoChannelInfo::FLAG_ALPHA) {
dst[PIXEL_CMYK_ALPHA] = CLAMP((totalAlpha/ factor) + offset, 0, quint8_MAX);
}
}
......@@ -151,7 +151,7 @@ void KisCmykColorSpace::invertColor(quint8 * src, qint32 nPixels)
}
}
void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColorAdjustment *adj, qint32 nPixels)
void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KoColorAdjustment *adj, qint32 nPixels)
{
quint32 psize = pixelSize();
......@@ -159,7 +159,7 @@ void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColor
quint8 * tmpPtr = tmp;
memcpy(tmp, dst, nPixels * psize);
KisLcmsBaseColorSpace::applyAdjustment(src, dst, adj, nPixels);
KoLcmsColorSpaceTrait::applyAdjustment(src, dst, adj, nPixels);
// Copy the alpha, which lcms doesn't do for us, grumble.
......@@ -174,7 +174,7 @@ void KisCmykColorSpace::applyAdjustment(const quint8 *src, quint8 *dst, KisColor
delete [] tmp;
}
Q3ValueVector<KisChannelInfo *> KisCmykColorSpace::channels() const
Q3ValueVector<KoChannelInfo *> KisCmykColorSpace::channels() const
{
return m_channels;
}
......@@ -561,7 +561,7 @@ void KisCmykColorSpace::bitBlt(quint8 *dst,
quint8 opacity,
qint32 rows,
qint32 cols,
const KisCompositeOp& op)
const KoCompositeOp& op)
{
switch (op.op()) {
......@@ -685,19 +685,19 @@ void KisCmykColorSpace::bitBlt(quint8 *dst,
}
}
KisCompositeOpList KisCmykColorSpace::userVisiblecompositeOps() const
KoCompositeOpList KisCmykColorSpace::userVisiblecompositeOps() const
{
KisCompositeOpList list;
list.append(KisCompositeOp(COMPOSITE_OVER));
list.append(KisCompositeOp(COMPOSITE_MULT));
list.append(KisCompositeOp(COMPOSITE_BURN));
list.append(KisCompositeOp(COMPOSITE_DODGE));
list.append(KisCompositeOp(COMPOSITE_DIVIDE));
list.append(KisCompositeOp(COMPOSITE_SCREEN));
list.append(KisCompositeOp(COMPOSITE_OVERLAY));
list.append(KisCompositeOp(COMPOSITE_DARKEN));
list.append(KisCompositeOp(COMPOSITE_LIGHTEN));
KoCompositeOpList list;
list.append(KoCompositeOp(COMPOSITE_OVER));
list.append(KoCompositeOp(COMPOSITE_MULT));
list.append(KoCompositeOp(COMPOSITE_BURN));
list.append(KoCompositeOp(COMPOSITE_DODGE));
list.append(KoCompositeOp(COMPOSITE_DIVIDE));
list.append(KoCompositeOp(COMPOSITE_SCREEN));
list.append(KoCompositeOp(COMPOSITE_OVERLAY));
list.append(KoCompositeOp(COMPOSITE_DARKEN));
list.append(KoCompositeOp(COMPOSITE_LIGHTEN));
return list;
}
......@@ -22,10 +22,10 @@
#include <QMap>
#include <krita_export.h>
#include "kis_global.h"
#include "kis_lcms_base_colorspace.h"
#include "kis_u8_base_colorspace.h"
#include "KoLcmsColorSpaceTrait.h"
#include "KoU8ColorSpaceTrait.h"
class KRITACOLOR_EXPORT KisCmykColorSpace : public KisU8BaseColorSpace, public KisLcmsBaseColorSpace {
class KRITACOLOR_EXPORT KisCmykColorSpace : public KoU8ColorSpaceTrait, public KoLcmsColorSpaceTrait {
public:
......@@ -38,7 +38,7 @@ public:
quint16 alpha;
};
public:
KisCmykColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p);
KisCmykColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p);
virtual ~KisCmykColorSpace();
......@@ -55,18 +55,18 @@ public:
public:
virtual void mixColors(const quint8 **colors, const quint8 *weights, quint32 nColors, quint8 *dst) const;
virtual void applyAdjustment(const quint8 *src, quint8 *dst, KisColorAdjustment *adj, qint32 nPixels);
virtual void applyAdjustment(const quint8 *src, quint8 *dst, KoColorAdjustment *adj, qint32 nPixels);
virtual void invertColor(quint8 * src, qint32 nPixels);
virtual void convolveColors(quint8** colors, qint32 * kernelValues, KisChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const;
virtual void convolveColors(quint8** colors, qint32 * kernelValues, KoChannelInfo::enumChannelFlags channelFlags, quint8 *dst, qint32 factor, qint32 offset, qint32 nColors) const;
// XXX: darken & intensity8?
virtual Q3ValueVector<KisChannelInfo *> channels() const;
virtual Q3ValueVector<KoChannelInfo *> channels() const;
virtual quint32 nChannels() const;
virtual quint32 nColorChannels() const;
virtual quint32 pixelSize() const;
virtual void getSingleChannelPixel(quint8 *dstPixel, const quint8 *srcPixel, quint32 channelIndex);
virtual KisCompositeOpList userVisiblecompositeOps() const;
virtual KoCompositeOpList userVisiblecompositeOps() const;
protected:
......@@ -79,7 +79,7 @@ protected:
quint8 opacity,
qint32 rows,
qint32 cols,
const KisCompositeOp& op);
const KoCompositeOp& op);
void compositeOver(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
void compositeMultiply(quint8 *dst, qint32 dstRowStride, const quint8 *src, qint32 srcRowStride, const quint8 *mask, qint32 maskRowStride, qint32 rows, qint32 columns, quint8 opacity);
......@@ -103,14 +103,14 @@ private:
static const quint8 PIXEL_CMYK_ALPHA = 4;
};
class KisCmykColorSpaceFactory : public KisColorSpaceFactory
class KisCmykColorSpaceFactory : public KoColorSpaceFactory
{
public:
/**
* Krita definition for use in .kra files and internally: unchanging name +
* i18n'able description.
*/
virtual KisID id() const { return KisID("CMYK", i18n("CMYK (8-bit integer/channel)")); };
virtual KoID id() const { return KoID("CMYK", i18n("CMYK (8-bit integer/channel)")); };
/**
* lcms colorspace type definition.
......@@ -119,7 +119,7 @@ public:
virtual icColorSpaceSignature colorSpaceSignature() { return icSigCmykData; };
virtual KisColorSpace *createColorSpace(KisColorSpaceFactoryRegistry * parent, KisProfile *p) { return new KisCmykColorSpace(parent, p); };
virtual KoColorSpace *createColorSpace(KoColorSpaceFactoryRegistry * parent, KoColorProfile *p) { return new KisCmykColorSpace(parent, p); };
virtual QString defaultProfile() { return "Adobe CMYK"; }; // Do not i18n -- this is from a data file
};
......
......@@ -25,7 +25,7 @@
#include <kis_debug_areas.h>
#include <kis_colorspace_factory_registry.h>
#include <KoColorSpaceFactoryRegistry.h>
#include <kis_basic_histogram_producers.h>
#include "gray_u16_plugin.h"
......@@ -40,18 +40,18 @@ GRAYU16Plugin::GRAYU16Plugin(QObject *parent, const QStringList &)
{
setInstance(GRAYU16PluginFactory::instance());
if ( parent->inherits("KisColorSpaceFactoryRegistry") )
if ( parent->inherits("KoColorSpaceFactoryRegistry") )
{
KisColorSpaceFactoryRegistry * f = dynamic_cast<KisColorSpaceFactoryRegistry*>( parent );
KoColorSpaceFactoryRegistry * f = dynamic_cast<KoColorSpaceFactoryRegistry*>( parent );
KisColorSpace * colorSpaceGRAYU16 = new KisGrayU16ColorSpace(f, 0);