Commit cea6f712 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Removed unused memento classes

* Moved all colour strategies to modules
* Create a new type of plugins, provisionally loaded when
  KisPluginRegistry's static initializer constructs the singleton.
* Renamed KisGenericFactory, KisFilterFactory and KisColorSpaceFactory
  to ...Registry since these classes do not construct, but register
  and make avialable their objects.
* Removed composite ops. This is a good idea in principle, but comp ops
  belong to the colour strategy and this particular way of doing has
  already been tried and found wanting.

svn path=/trunk/koffice/; revision=334120
parent 2f757ebe
......@@ -58,10 +58,16 @@ Function naming
introduced by a language that needs to prefix the 'class' name to every function
in order to have something that not quite OO.
Variable/Parameter names
Variable/parameter names start with an undercast letter. A name composed of different
words is done in camelBackedStyle.
Designer
Krita doesn't use .ui files. Yet. When we get down to the great UI redesign,
all dialogs should be done in Designer.
Krita has started to use designer. All dialogs and all widgets that have a layout
manager must be done in designer. We don't add code nor add signal/slot connections
in designer
Enums
......
......@@ -30,7 +30,7 @@ kdemimedir = $(kde_mimedir)/application
rcdir = $(kde_datadir)/krita
rc_DATA = krita.rc krita_readonly.rc
SUBDIRS = ui core tools . dtd plugins data pics
SUBDIRS = ui core tools . dtd plugins modules data pics
# Needed to compile libkritacommon.la, which has no source files to itself
# but everything in static libs.
......
# all_includes must remain last!
INCLUDES = -I$(srcdir)/builder \
-I$(srcdir)/visitors \
-I$(srcdir)/helper/ \
-I$(srcdir)/helper \
-I$(srcdir)/tiles \
-I$(srcdir)/../ui \
-I../ui \
......@@ -14,7 +14,6 @@ INCLUDES = -I$(srcdir)/builder \
$(KOPAINTER_INCLUDES) \
-I$(srcdir)/strategy \
-I$(srcdir)/color_strategy \
-I$(srcdir)/compositeop \
$(all_includes)
#CXXFLAGS = -shared -fPIC
......@@ -26,7 +25,6 @@ libkritacore_la_LIBADD = tiles/libkistile.la \
builder/libkiscorebuilder.la \
strategy/libkisstrategy.la \
color_strategy/libkiscolor_strategy.la \
compositeop/libkiscompositeop.la \
$(LIB_KOPAINTER)
libkritacore_la_SOURCES = kis_paint_device.cc \
......@@ -54,7 +52,6 @@ libkritacore_la_SOURCES = kis_paint_device.cc \
kis_resource.cc \
kis_resource_mediator.cc \
kis_guide.cc \
kis_memento_originator.cc \
kis_canvas_subject.cc \
kis_canvas_controller.cc \
kis_canvas_observer.cc \
......@@ -76,7 +73,7 @@ libkritacore_la_SOURCES = kis_paint_device.cc \
KIsImageIface.cc \
KIsImageIface.skel \
kis_filter.cc \
kis_filter_factory.cc \
kis_filter_registry.cc \
kis_plugin_registry.cc
noinst_HEADERS = kis_paint_device.h \
......@@ -104,7 +101,6 @@ noinst_HEADERS = kis_paint_device.h \
kis_resource.h \
kis_resource_mediator.h \
kis_guide.h \
kis_memento_originator.h \
kis_canvas_subject.h \
kis_canvas_controller.h \
kis_canvas_observer.h \
......@@ -125,8 +121,8 @@ noinst_HEADERS = kis_paint_device.h \
KIsImageIface.h \
kis_matrix.h \
kis_filter.h \
kis_filter_factory.h
kis_filter_registry.h
libkritacore_la_METASOURCES = AUTO
libkritacore_la_LDFLAGS = $(all_libraries)
SUBDIRS = helper tiles builder strategy color_strategy compositeop
SUBDIRS = helper tiles builder strategy color_strategy
......@@ -18,14 +18,20 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <magick/api.h>
#include <qfile.h>
#include <qstring.h>
#include <kdeversion.h>
#include <kapplication.h>
#include <klocale.h>
#include <kurl.h>
#include <kio/netaccess.h>
#include <koColor.h>
#include "kis_types.h"
#include "kis_global.h"
#include "kis_doc.h"
......@@ -36,7 +42,8 @@
#include "kistilemgr.h"
#include "kispixeldata.h"
#include "kis_image_magick_converter.h"
#include <qfile.h>
#include "kis_colorspace_registry.h"
#include "../../../config.h"
namespace {
......@@ -184,7 +191,7 @@ KisImageBuilder_Result KisImageMagickConverter::decode(const KURL& uri, bool isB
emit notify(this, KisImageBuilder_STEP_ERROR, 0);
return KisImageBuilder_RESULT_FAILURE;
}
m_img = new KisImage(m_adapter, 0, 0, KisColorSpaceFactory::singleton()->colorSpace("RGBA"), m_doc -> nextImageName());
m_img = new KisImage(m_adapter, 0, 0, KisColorSpaceRegistry::singleton()->colorSpace("RGBA"), m_doc -> nextImageName());
emit notify(this, KisImageBuilder_STEP_TILING, 0);
while ((image = RemoveFirstImageFromList(&images))) {
......
......@@ -5,10 +5,9 @@ INCLUDES = -I$(srcdir)/.. \
noinst_LTLIBRARIES = libkiscolor_strategy.la
libkiscolor_strategy_la_SOURCES = kis_strategy_colorspace.cc \
kis_strategy_colorspace_rgb.cc \
kis_strategy_colorspace_grayscale.cc \
kis_colorspace_factory.cc
libkiscolor_strategy_la_SOURCES = \
kis_strategy_colorspace.cc \
kis_colorspace_registry.cc
libkiscolor_strategy_la_METASOURCES = AUTO
......@@ -18,38 +18,37 @@
*/
#include "kdebug.h"
#include "kis_colorspace_factory.h"
#include "kis_colorspace_registry.h"
#include "kis_paint_device.h"
KisColorSpaceFactory *KisColorSpaceFactory::m_singleton = 0;
KisColorSpaceRegistry *KisColorSpaceRegistry::m_singleton = 0;
KisColorSpaceFactory::KisColorSpaceFactory()
KisColorSpaceRegistry::KisColorSpaceRegistry()
{
kdDebug() << " creating a KisColorSpaceFactory" << endl;
Q_ASSERT(KisColorSpaceFactory::m_singleton == 0);
KisColorSpaceFactory::m_singleton = this;
kdDebug() << " creating a KisColorSpaceRegistry" << endl;
Q_ASSERT(KisColorSpaceRegistry::m_singleton == 0);
KisColorSpaceRegistry::m_singleton = this;
}
KisColorSpaceFactory::~KisColorSpaceFactory()
KisColorSpaceRegistry::~KisColorSpaceRegistry()
{
}
KisColorSpaceFactory* KisColorSpaceFactory::singleton()
KisColorSpaceRegistry* KisColorSpaceRegistry::singleton()
{
// Q_ASSERT(KisColorSpaceFactoryInterface::m_singleton);
if(KisColorSpaceFactory::m_singleton == 0)
if(KisColorSpaceRegistry::m_singleton == 0)
{
KisColorSpaceFactory::m_singleton = new KisColorSpaceFactory();
KisColorSpaceRegistry::m_singleton = new KisColorSpaceRegistry();
}
return KisColorSpaceFactory::m_singleton;
return KisColorSpaceRegistry::m_singleton;
}
KisStrategyColorSpaceSP KisColorSpaceFactory::colorSpace(const QString& name) const
KisStrategyColorSpaceSP KisColorSpaceRegistry::colorSpace(const QString& name) const
{
return get(name);
}
QStringList KisColorSpaceFactory::listColorSpaceNames() const
QStringList KisColorSpaceRegistry::listColorSpaceNames() const
{
return listKeys();
}
......@@ -17,33 +17,33 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#if !defined KIS_COLORSPACE_FACTORY_H_
#define KIS_COLORSPACE_FACTORY_H_
#if !defined KIS_COLORSPACE_REGISTRY_H_
#define KIS_COLORSPACE_REGISTRY_H_
#include "kis_types.h"
#include "kis_generic_factory.h"
#include "kis_generic_registry.h"
class QStringList;
class KisColorSpaceFactory : public KisGenericFactory<KisStrategyColorSpaceSP> {
class KisColorSpaceRegistry : public KisGenericRegistry<KisStrategyColorSpaceSP> {
public:
virtual ~KisColorSpaceFactory();
virtual ~KisColorSpaceRegistry();
public:
KisStrategyColorSpaceSP colorSpace(const QString& name) const KDE_DEPRECATED;
QStringList listColorSpaceNames() const KDE_DEPRECATED;
public:
static KisColorSpaceFactory* singleton();
static KisColorSpaceRegistry* singleton();
private:
KisColorSpaceFactory();
KisColorSpaceFactory(const KisColorSpaceFactory&);
KisColorSpaceFactory operator=(const KisColorSpaceFactory&);
KisColorSpaceRegistry();
KisColorSpaceRegistry(const KisColorSpaceRegistry&);
KisColorSpaceRegistry operator=(const KisColorSpaceRegistry&);
private:
static KisColorSpaceFactory *m_singleton;
static KisColorSpaceRegistry *m_singleton;
};
#endif // KIS_COLORSPACE_FACTORY_H_
#endif // KIS_COLORSPACE_REGISTRY_H_
......@@ -43,4 +43,19 @@ private:
QUANTUM* m_channels;
};
// XXX: conversions always via koColor; this class is BAD. It is unsuited as
// an intermediary colourspace format, and besides, we must use koColor and later
// littleCMS for that.
class KisPixelRepresentationRGB : public KisPixelRepresentation {
public:
inline KisPixelRepresentationRGB( const KisPixelRepresentation& pr) : KisPixelRepresentation(pr) { };
inline KisPixelRepresentationRGB( ) : KisPixelRepresentation(4) { };
public:
inline KisQuantum red() { return (*this)[PIXEL_RED]; };
inline KisQuantum green() { return (*this)[PIXEL_GREEN]; };
inline KisQuantum blue() { return (*this)[PIXEL_BLUE]; };
inline KisQuantum alpha() { return (*this)[PIXEL_ALPHA]; };
};
#endif
......@@ -17,12 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "kis_strategy_colorspace.h"
#include "kis_strategy_colorspace_rgb.h"
#include "kis_colorspace_factory.h"
#include "kis_pixel_representation.h"
KisStrategyColorSpace::KisStrategyColorSpace(const QString& name) : m_name(name)
{
KisColorSpaceFactory::singleton()->add(this);
}
KisStrategyColorSpace::~KisStrategyColorSpace()
......@@ -31,7 +30,8 @@ KisStrategyColorSpace::~KisStrategyColorSpace()
void KisStrategyColorSpace::convertTo(KisPixelRepresentation& src, KisPixelRepresentation& dst, KisStrategyColorSpaceSP cs)
{
KisPixelRepresentationRGB intermediaire;
this->convertToRGBA(src, intermediaire);
cs->convertFromRGBA(intermediaire, dst);
KisPixelRepresentationRGB intermediate;
this->convertToRGBA(src, intermediate);
cs->convertFromRGBA(intermediate, dst);
}
......@@ -28,7 +28,7 @@
#include "kis_global.h"
#include "kis_types.h"
#include "kis_channelinfo.h"
#include "kis_compositeop.h"
// #include "kis_compositeop.h"
class QPainter;
class KisIteratorPixel;
......@@ -36,7 +36,9 @@ class KisPixelRepresentation;
class KisPixelRepresentationRGB;
class KisStrategyColorSpace : public KShared {
typedef std::map<QString, KisCompositeOp*> compositeOpStorage;
// typedef std::map< QString, KisCompositeOp* > compositeOpStorage;
public:
KisStrategyColorSpace(const QString& name);
virtual ~KisStrategyColorSpace();
......@@ -55,21 +57,32 @@ public:
// XXX: make this a proper vector. Pointers to arrays are _so_ seventies, and
// Stroustrup assures us a vector is as effecient a mem array anyway.
virtual ChannelInfo * channelsInfo() const = 0;
virtual Q_INT32 depth() const = 0;
virtual bool alpha() const = 0;
inline QString name() { return m_name; };
virtual void render(KisImageSP projection, QPainter& painter, Q_INT32 x, Q_INT32 y, Q_INT32 width, Q_INT32 height) = 0;
/** This function is used to convert a KisPixelRepresentation to an other color strategy.
* When implementing a color space, there is no need to implement a conversion to all strategy,
/**
* This function is used to convert a KisPixelRepresentation to an other color strategy.
* When implementing a color space, there is no need to implement a conversion to all strategies,
* if there is no direct conversion facilities, the function should use the conversion to/from RGBA
*
* XXX: bsar. RGBA is a bad choice for an intermediate format. Use koColor; which can be expanded to use
* littleCms.
*/
virtual void convertTo(KisPixelRepresentation& src, KisPixelRepresentation& dst, KisStrategyColorSpaceSP cs);
/** This function convert a pixel to RGBA */
virtual void convertToRGBA(KisPixelRepresentation& src, KisPixelRepresentationRGB& dst) =0;
/** This function convert a pixel from RGBA */
virtual void convertFromRGBA(KisPixelRepresentationRGB& src, KisPixelRepresentation& dst) =0;
// XXX: convertToRGBA and convertFromRGBA must use LAB or XYZ; furthermore, they should
// use koColor for now, and littlecms later.
/** This function converts a pixel to RGBA */
virtual void convertToRGBA(KisPixelRepresentation& src, KisPixelRepresentationRGB& dst) = 0;
/** This function converts a pixel from RGBA */
virtual void convertFromRGBA(KisPixelRepresentationRGB& src, KisPixelRepresentation& dst) = 0;
virtual QImage convertToImage(KisImageSP image, Q_INT32 x, Q_INT32 y, Q_INT32 width, Q_INT32 height) const = 0;
virtual QImage convertToImage(KisTileMgrSP tm, Q_UINT32 depth, Q_INT32 x, Q_INT32 y, Q_INT32 width, Q_INT32 height) const = 0;
......@@ -95,25 +108,29 @@ public:
virtual void computeDuplicatePixel(KisIteratorPixel* dst, KisIteratorPixel* dab, KisIteratorPixel* src) =0;
void addCompositeOp(KisCompositeOp* newco);
KisCompositeOp* compositeOp(const QString& name);
// void addCompositeOp(KisCompositeOp* newco);
// KisCompositeOp* compositeOp(const QString& name);
private:
KisStrategyColorSpace(const KisStrategyColorSpace&);
KisStrategyColorSpace& operator=(const KisStrategyColorSpace&);
compositeOpStorage m_compositeOpStorage;
private:
// compositeOpStorage m_compositeOpStorage;
QString m_name;
};
inline void KisStrategyColorSpace::addCompositeOp(KisCompositeOp* newco)
{
m_compositeOpStorage.insert(compositeOpStorage::value_type( newco->name(),newco));
}
inline KisCompositeOp* KisStrategyColorSpace::compositeOp(const QString& name)
{
return m_compositeOpStorage.find(name)->second;
}
// inline void KisStrategyColorSpace::addCompositeOp(KisCompositeOp* newco)
// {
// m_compositeOpStorage.insert(compositeOpStorage::value_type( newco->name(),newco));
// }
// inline KisCompositeOp* KisStrategyColorSpace::compositeOp(const QString& name)
// {
// return m_compositeOpStorage.find(name)->second;
// }
#endif // KIS_STRATEGY_COLORSPACE_H_
INCLUDES = -I$(srcdir)/.. -I$(srcdir)/../color_strategy -I$(srcdir)/../tiles $(KOFFICE_INCLUDES) -I$(interfacedir) $(KOPAINTER_INCLUDES) $(all_includes)
noinst_LTLIBRARIES = libkiscompositeop.la
libkiscompositeop_la_SOURCES = kis_compositeop.cc kis_compositeoprgba.cc
libkiscompositeop_la_METASOURCES = AUTO
/* This file is part of the KDE project
Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "kis_compositeop.h"
KisCompositeOp::KisCompositeOp(const QString& name) :
m_name ( name )
{
}
KisCompositeOp::~KisCompositeOp()
{
}
/* This file is part of the KDE project
Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef _kis_composite_op_h_
#define _kis_composite_op_h_
#include "kis_global.h"
#include <qstring.h>
class KisPixelRepresentation;
class KisCompositeOp
{
public:
KisCompositeOp(const QString& name);
virtual ~KisCompositeOp();
public:
virtual void compose(KisPixelRepresentation dst, KisPixelRepresentation src, QUANTUM opacity) =0;
inline QString name() const { return m_name; };
private:
QString m_name;
};
#endif
/*
* Copyright (c) 2004 Boudewijn Rempt <boud@valdyas.org>
* Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
All compositing code except for the 'OVER' operator is derived from
GraphicsMagick/magick/composite.c and is subject to the following
license and copyright:
Copyright (C) 2002 GraphicsMagick Group, an organization dedicated
to making software imaging solutions freely available.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
("GraphicsMagick"), to deal in GraphicsMagick without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of GraphicsMagick,
and to permit persons to whom GraphicsMagick is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of GraphicsMagick.
The software is provided "as is", without warranty of any kind, express
or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose and noninfringement.
In no event shall GraphicsMagick Group be liable for any claim,
damages or other liability, whether in an action of contract, tort or
otherwise, arising from, out of or in connection with GraphicsMagick
or the use or other dealings in GraphicsMagick.
Except as contained in this notice, the name of the GraphicsMagick
Group shall not be used in advertising or otherwise to promote the
sale, use or other dealings in GraphicsMagick without prior written
authorization from the GraphicsMagick Group.
*/
#include "kis_compositeoprgba.h"
#include "kis_strategy_colorspace_rgb.h"
KisCompositeOpRGBAOver::KisCompositeOpRGBAOver() :
KisCompositeOp("Over")
{ };
void KisCompositeOpRGBAOver::compose(KisPixelRepresentation dst, KisPixelRepresentation src, QUANTUM opacity)
{
KisPixelRepresentationRGB dstRGB(dst);
KisPixelRepresentationRGB srcRGB(src);
if (opacity == OPACITY_TRANSPARENT)
return;
if (opacity != OPACITY_OPAQUE) {
int srcAlpha = (srcRGB.alpha() * opacity + QUANTUM_MAX / 2) / QUANTUM_MAX;
int dstAlpha = (dstRGB.alpha() * (QUANTUM_MAX - srcAlpha) + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.red() = (dstRGB.red() * dstAlpha + srcRGB.red() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.green() = (dstRGB.green() * dstAlpha + srcRGB.green() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.blue() = (dstRGB.blue() * dstAlpha + srcRGB.blue() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.alpha() = (dstRGB.alpha() * (QUANTUM_MAX - srcAlpha) + srcAlpha * QUANTUM_MAX + QUANTUM_MAX / 2) / QUANTUM_MAX;
if (dstRGB.alpha() != 0) {
dstRGB.red() = (dstRGB.red() * QUANTUM_MAX) / dstRGB.alpha();
dstRGB.green() = (dstRGB.green() * QUANTUM_MAX) / dstRGB.alpha();
dstRGB.blue() = (dstRGB.blue() * QUANTUM_MAX) / dstRGB.alpha();
}
}
else {
if (srcRGB.alpha() == OPACITY_TRANSPARENT)
return;
if (dstRGB.alpha() == OPACITY_TRANSPARENT || srcRGB.alpha() == OPACITY_OPAQUE) {
// memcpy(d, s, stride * sizeof(QUANTUM));
return;
}
int srcAlpha = srcRGB.alpha();
int dstAlpha = (dstRGB.alpha() * (QUANTUM_MAX - srcAlpha) + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.red() = (dstRGB.red() * dstAlpha + srcRGB.red() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.green() = (dstRGB.green() * dstAlpha + srcRGB.green() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.blue() = (dstRGB.blue() * dstAlpha + srcRGB.blue() * srcAlpha + QUANTUM_MAX / 2) / QUANTUM_MAX;
dstRGB.alpha() = (dstRGB.alpha() * (QUANTUM_MAX - srcAlpha) + srcAlpha * QUANTUM_MAX + QUANTUM_MAX / 2) / QUANTUM_MAX;
if (dstRGB.alpha() != 0) {
dstRGB.red() = (dstRGB.red() * QUANTUM_MAX) / dstRGB.alpha();
dstRGB.green() = (dstRGB.green() * QUANTUM_MAX) / dstRGB.alpha();
dstRGB.blue() = (dstRGB.blue() * QUANTUM_MAX) / dstRGB.alpha();
}
}
}
/*
* Copyright (c) 2004 Cyrille Berger <cberger@cberger.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*
*/
#include "kis_compositeop.h"
#ifndef _KIS_COMPOSITE_OP_RGBA_H_
#define _KIS_COMPOSITE_OP_RGBA_H_
class KisCompositeOpRGBAOver : public KisCompositeOp
{
public:
KisCompositeOpRGBAOver();
virtual void compose(KisPixelRepresentation dst, KisPixelRepresentation src, QUANTUM opacity);
};
#endif
......@@ -41,6 +41,7 @@
#include "kis_global.h"
#include "kis_brush.h"
#include "kis_alpha_mask.h"
#include "kis_colorspace_registry.h"
namespace {
struct GimpBrushV1Header {
......@@ -389,7 +390,7 @@ void KisBrush::createImages(const QImage & img) const
QImage scaledImage = img.smoothScale(static_cast<int>(img.width() * scale + 0.5),
static_cast<int>(img.height() * scale + 0.5));
KisLayer *layer = new KisLayer(scaledImage.width(), scaledImage.height(),
KisColorSpaceFactory::singleton()->colorSpace("RGBA"), "brush image");
KisColorSpaceRegistry::singleton()->colorSpace("RGBA"), "brush image");
for (int y = 0; y < scaledImage.height(); y++) {
for (int x = 0; x < scaledImage.width(); x++) {
......
......@@ -19,8 +19,10 @@
#include "kis_types.h"
#include "kis_channel.h"
#include "kis_image.h"
#include "kis_colorspace_registry.h"
KisChannel::KisChannel(KisImageSP img, Q_INT32 width, Q_INT32 height, const QString& name, const KoColor&) : super(img, width, height, KisColorSpaceFactory::singleton()->colorSpace("Grayscale + Alpha"), name)
KisChannel::KisChannel(KisImageSP img, Q_INT32 width, Q_INT32 height, const QString& name, const KoColor&)
: super(img, width, height, KisColorSpaceRegistry::singleton()->colorSpace("Grayscale + Alpha"), name)
{
}
......
......@@ -73,16 +73,13 @@
#include "builder/kis_builder_subject.h"
#include "builder/kis_builder_monitor.h"
#include "builder/kis_image_magick_converter.h"
#include "color_strategy/kis_strategy_colorspace.h"
#include "color_strategy/kis_strategy_colorspace_rgb.h"
#include "color_strategy/kis_strategy_colorspace_grayscale.h"
#include "kis_colorspace_factory.h"
#include "kis_strategy_colorspace.h"
#include "kis_colorspace_registry.h"
#include "tiles/kistilemgr.h"
#include "KIsDocIface.h"
static const char *CURRENT_DTD_VERSION = "1.3";
bool KisDoc::m_singletonsHasBeenInited = false;
namespace {
class KisCommandImageAdd : public KisCommand {
......@@ -339,7 +336,8 @@ namespace {
KisDoc::KisDoc(QWidget *parentWidget, const char *widgetName, QObject *parent, const char *name, bool singleViewMode) :
super(parentWidget, widgetName, parent, name, singleViewMode)
{
initSingletons();
kdDebug() << "KisDoc created for " << widgetName << "\n";