Commit 423c99e8 authored by Adrian Page's avatar Adrian Page
Browse files

Check in progress. Lots of fixes.

svn path=/trunk/koffice/; revision=527953
parent 2f59a146
......@@ -67,6 +67,10 @@ if (SHOULD_BUILD_KRITA)
include_directories(${CMAKE_SOURCE_DIR}/krita/kritacolor)
include_directories(${CMAKE_SOURCE_DIR}/krita/kritacolor/colorspaces)
include_directories(${CMAKE_SOURCE_DIR}/krita/ui)
include_directories(${CMAKE_SOURCE_DIR}/krita/colorspaces/rgb_u8)
# For generated files from .ui
include_directories(${CMAKE_BINARY_DIR}/krita/ui)
include_directories(${KOPAINTER_INCLUDES})
include_directories(${KOFFICEUI_INCLUDES})
......
kde4_header()
########### next target ###############
set(kritawsbrushpaintop_PART_SRCS dummy.cpp )
set(kritawsbrushpaintop_PART_SRCS
dummy.cpp
wsbrushpaintop_plugin.cc
kis_wsbrushop.cc
)
kde4_automoc(${kritawsbrushpaintop_PART_SRCS})
......
kde4_header()
########### next target ###############
set(kritabumpmap_PART_SRCS dummy.cpp )
set(kritabumpmap_PART_SRCS
bumpmap.cc
)
kde4_automoc(${kritabumpmap_PART_SRCS})
file(WRITE dummy.cpp "//autogenerated file by cmake\n")
kde4_add_ui3_files(kritabumpmap_PART_SRCS wdgbumpmap.ui)
#file(WRITE dummy.cpp "//autogenerated file by cmake\n")
kde4_add_plugin(kritabumpmap ${kritabumpmap_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritabumpmap )
......
......@@ -72,14 +72,15 @@ typedef KGenericFactory<KritaBumpmap> KritaBumpmapFactory;
K_EXPORT_COMPONENT_FACTORY( kritabumpmap, KritaBumpmapFactory( "krita" ) )
KritaBumpmap::KritaBumpmap(QObject *parent, const char *name, const QStringList &)
: KParts::Plugin(parent, name)
: KParts::Plugin(parent)
{
setObjectName(name);
setInstance(KritaBumpmapFactory::instance());
if (parent->inherits("KisFilterRegistry")) {
KisFilterRegistry * manager = dynamic_cast<KisFilterRegistry *>(parent);
manager->add(new KisFilterBumpmap());
manager->add(KisFilterSP(new KisFilterBumpmap()));
}
}
......@@ -187,7 +188,7 @@ void KisFilterBumpmap::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFi
if (!config->bumpmap.isNull() && src->image()) {
KisLayerSP l = src->image()->findLayer(config->bumpmap);
KisPaintDeviceSP bumplayer = 0;
KisPaintDeviceSP bumplayer = KisPaintDeviceSP(0);
KisPaintLayer * pl = dynamic_cast<KisPaintLayer*>(l.data());
if (pl) {
......@@ -213,12 +214,12 @@ void KisFilterBumpmap::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFi
}
else {
bmRect = rect;
bumpmap = src;
bumpmap = src.data();
}
}
else {
bmRect = rect;
bumpmap = src;
bumpmap = src.data();
}
......@@ -321,7 +322,7 @@ void KisFilterBumpmap::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFi
}
else {
shade = (qint32)(ndotl / sqrt(nx * nx + ny * ny + nz2));
shade = (qint32)(shade + qMax(0, (255 * compensation - shade)) * config->ambient / 255);
shade = (qint32)(shade + qMax(0, (int)((255 * compensation - shade)) * config->ambient / 255));
}
}
......
......@@ -346,6 +346,20 @@ layer, the current layer will be used.</string>
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KDoubleSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>txtSourceLayer</tabstop>
......@@ -363,13 +377,4 @@ layer, the current layer will be used.</string>
<tabstop>bnRefresh</tabstop>
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
</includehints>
</UI>
......@@ -2364,7 +2364,7 @@ namespace cimg_library {
case 1: // palette for greyscale images
for (unsigned int index=0; index<256; index++) {
palette[index].pixel = index;
palette[index].Qt::red = palette[index].Qt::green = palette[index].Qt::blue = index<<8;
palette[index].red = palette[index].green = palette[index].blue = index<<8;
palette[index].flags = DoRed | DoGreen | DoBlue;
}
break;
......@@ -2372,8 +2372,8 @@ namespace cimg_library {
for (unsigned int index=0, r=8; r<256; r+=16)
for (unsigned int g=8; g<256; g+=16) {
palette[index].pixel = index;
palette[index].Qt::red = palette[index].Qt::blue = r<<8;
palette[index].Qt::green = g<<8;
palette[index].red = palette[index].blue = r<<8;
palette[index].green = g<<8;
palette[index++].flags = DoRed | DoGreen | DoBlue;
}
break;
......@@ -2382,9 +2382,9 @@ namespace cimg_library {
for (unsigned int g=16; g<256; g+=32)
for (unsigned int b=32; b<256; b+=64) {
palette[index].pixel = index;
palette[index].Qt::red = r<<8;
palette[index].Qt::green = g<<8;
palette[index].Qt::blue = b<<8;
palette[index].red = r<<8;
palette[index].green = g<<8;
palette[index].blue = b<<8;
palette[index++].flags = DoRed | DoGreen | DoBlue;
}
break;
......@@ -2768,10 +2768,10 @@ namespace cimg_library {
DEVMODE curr_mode;
HWND window;
HDC hdc;
Qt::HANDLE thread;
Qt::HANDLE wait_disp;
Qt::HANDLE created;
Qt::HANDLE mutex;
HANDLE thread;
HANDLE wait_disp;
HANDLE created;
HANDLE mutex;
 
CImgDisplay(const unsigned int dimw,const unsigned int dimh,const char *title=NULL,
const unsigned int normalization_type=1,const unsigned int events_type=3,
......@@ -7735,8 +7735,8 @@ namespace cimg_library {
const double ymin=0,const double ymax=0,const float opacity=1) {
if (!is_empty()) {
if (!color) throw CImgArgumentException("CImg<%s>::draw_graph() : Specified color is (null)",pixel_type());
T *Qt::color1 = new T[dim], *color2 = new T[dim];
cimg_mapV(*this,k) { Qt::color1[k]=(T)(color[k]*0.6f); color2[k]=(T)(color[k]*0.3f); }
T *color1 = new T[dim], *color2 = new T[dim];
cimg_mapV(*this,k) { color1[k]=(T)(color[k]*0.6f); color2[k]=(T)(color[k]*0.3f); }
CImgStats st;
if (ymin==ymax) { st = CImgStats(data,false); cimg::swap(st.min,st.max); } else { st.min = ymin; st.max = ymax; }
if (st.min==st.max) { st.min--; st.max++; }
......@@ -7751,7 +7751,7 @@ namespace cimg_library {
break;
case 1: { // plot with bars
const unsigned int X = off*width/data.size(), nX = (off+1)*width/data.size()-1;
draw_rectangle(X,(int)Y0,nX,Y,Qt::color1,opacity);
draw_rectangle(X,(int)Y0,nX,Y,color1,opacity);
draw_line(X,Y,X,(int)Y0,color2,~0L,opacity);
draw_line(X,(int)Y0,nX,(int)Y0,Y<=Y0?color2:color,~0L,opacity);
draw_line(nX,Y,nX,(int)Y0,color,~0L,opacity);
......@@ -7768,7 +7768,7 @@ namespace cimg_library {
pY=Y;
}
}
delete[] Qt::color1; delete[] color2;
delete[] color1; delete[] color2;
}
return *this;
}
......@@ -12993,17 +12993,17 @@ namespace cimg {
const CImg<t>& logo) {
#if cimg_display_type!=0
const unsigned char
Qt::black[3]={0,0,0}, Qt::white[3]={255,255,255}, Qt::gray[3]={200,200,200}, gray2[3]={150,150,150};
black[3]={0,0,0}, white[3]={255,255,255}, gray[3]={200,200,200}, gray2[3]={150,150,150};
// Create buttons and canvas graphics
CImgl<unsigned char> buttons, cbuttons, sbuttons;
const CImgl<unsigned char> tahoma = CImgl<unsigned char>::get_font10x13(false);
if (button1_txt) { buttons.insert(CImg<unsigned char>().draw_text(button1_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button2_txt) { buttons.insert(CImg<unsigned char>().draw_text(button2_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button3_txt) { buttons.insert(CImg<unsigned char>().draw_text(button3_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button4_txt) { buttons.insert(CImg<unsigned char>().draw_text(button4_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button5_txt) { buttons.insert(CImg<unsigned char>().draw_text(button5_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button6_txt) { buttons.insert(CImg<unsigned char>().draw_text(button6_txt,0,0,Qt::black,Qt::gray,tahoma));
if (button1_txt) { buttons.insert(CImg<unsigned char>().draw_text(button1_txt,0,0,black,gray,tahoma));
if (button2_txt) { buttons.insert(CImg<unsigned char>().draw_text(button2_txt,0,0,black,gray,tahoma));
if (button3_txt) { buttons.insert(CImg<unsigned char>().draw_text(button3_txt,0,0,black,gray,tahoma));
if (button4_txt) { buttons.insert(CImg<unsigned char>().draw_text(button4_txt,0,0,black,gray,tahoma));
if (button5_txt) { buttons.insert(CImg<unsigned char>().draw_text(button5_txt,0,0,black,gray,tahoma));
if (button6_txt) { buttons.insert(CImg<unsigned char>().draw_text(button6_txt,0,0,black,gray,tahoma));
}}}}}}
if (!buttons.size) throw CImgArgumentException("cimg::dialog() : No buttons have been defined. At least one is necessary");
......@@ -13016,23 +13016,23 @@ namespace cimg {
if (bh>48) bh=48;
CImg<unsigned char> button = CImg<unsigned char>(bw,bh,1,3).
draw_rectangle(0,0,bw-1,bh-1,Qt::gray).
draw_line(0,0,bw-1,0,Qt::white).draw_line(0,bh-1,0,0,Qt::white).
draw_line(bw-1,0,bw-1,bh-1,Qt::black).draw_line(bw-1,bh-1,0,bh-1,Qt::black).
draw_rectangle(0,0,bw-1,bh-1,gray).
draw_line(0,0,bw-1,0,white).draw_line(0,bh-1,0,0,white).
draw_line(bw-1,0,bw-1,bh-1,black).draw_line(bw-1,bh-1,0,bh-1,black).
draw_line(1,bh-2,bw-2,bh-2,gray2).draw_line(bw-2,bh-2,bw-2,1,gray2);
CImg<unsigned char> sbutton = CImg<unsigned char>(bw,bh,1,3).
draw_rectangle(0,0,bw-1,bh-1,Qt::gray).
draw_line(0,0,bw-1,0,Qt::black).draw_line(bw-1,0,bw-1,bh-1,Qt::black).
draw_line(bw-1,bh-1,0,bh-1,Qt::black).draw_line(0,bh-1,0,0,Qt::black).
draw_line(1,1,bw-2,1,Qt::white).draw_line(1,bh-2,1,1,Qt::white).
draw_line(bw-2,1,bw-2,bh-2,Qt::black).draw_line(bw-2,bh-2,1,bh-2,Qt::black).
draw_rectangle(0,0,bw-1,bh-1,gray).
draw_line(0,0,bw-1,0,black).draw_line(bw-1,0,bw-1,bh-1,black).
draw_line(bw-1,bh-1,0,bh-1,black).draw_line(0,bh-1,0,0,black).
draw_line(1,1,bw-2,1,white).draw_line(1,bh-2,1,1,white).
draw_line(bw-2,1,bw-2,bh-2,black).draw_line(bw-2,bh-2,1,bh-2,black).
draw_line(2,bh-3,bw-3,bh-3,gray2).draw_line(bw-3,bh-3,bw-3,2,gray2).
draw_line(4,4,bw-5,4,Qt::black,0xAAAAAAAA).draw_line(bw-5,4,bw-5,bh-5,Qt::black,0xAAAAAAAA).
draw_line(bw-5,bh-5,4,bh-5,Qt::black,0xAAAAAAAA).draw_line(4,bh-5,4,4,Qt::black,0xAAAAAAAA);
draw_line(4,4,bw-5,4,black,0xAAAAAAAA).draw_line(bw-5,4,bw-5,bh-5,black,0xAAAAAAAA).
draw_line(bw-5,bh-5,4,bh-5,black,0xAAAAAAAA).draw_line(4,bh-5,4,4,black,0xAAAAAAAA);
CImg<unsigned char> cbutton = CImg<unsigned char>(bw,bh,1,3).
draw_rectangle(0,0,bw-1,bh-1,Qt::black).draw_rectangle(1,1,bw-2,bh-2,gray2).draw_rectangle(2,2,bw-3,bh-3,Qt::gray).
draw_line(4,4,bw-5,4,Qt::black,0xAAAAAAAA).draw_line(bw-5,4,bw-5,bh-5,Qt::black,0xAAAAAAAA).
draw_line(bw-5,bh-5,4,bh-5,Qt::black,0xAAAAAAAA).draw_line(4,bh-5,4,4,Qt::black,0xAAAAAAAA);
draw_rectangle(0,0,bw-1,bh-1,black).draw_rectangle(1,1,bw-2,bh-2,gray2).draw_rectangle(2,2,bw-3,bh-3,gray).
draw_line(4,4,bw-5,4,black,0xAAAAAAAA).draw_line(bw-5,4,bw-5,bh-5,black,0xAAAAAAAA).
draw_line(bw-5,bh-5,4,bh-5,black,0xAAAAAAAA).draw_line(4,bh-5,4,4,black,0xAAAAAAAA);
 
cimgl_map(buttons,ll) {
cbuttons.insert(CImg<unsigned char>(cbutton).draw_image(buttons[ll],1+(bw-buttons[ll].dimx())/2,1+(bh-buttons[ll].dimy())/2));
......@@ -13041,7 +13041,7 @@ namespace cimg {
}
CImg<unsigned char> canvas;
if (msg) canvas = CImg<unsigned char>().draw_text(msg,0,0,Qt::black,Qt::gray,tahoma);
if (msg) canvas = CImg<unsigned char>().draw_text(msg,0,0,black,gray,tahoma);
const unsigned int
bwall = (buttons.size-1)*(12+bw) + bw,
w = cimg::max(196U,36+logo.width+canvas.width, 24+bwall),
......@@ -13055,15 +13055,15 @@ namespace cimg {
if (canvas.data)
canvas = CImg<unsigned char>(w,h,1,3).
draw_rectangle(0,0,w-1,h-1,Qt::gray).
draw_line(0,0,w-1,0,Qt::white).draw_line(0,h-1,0,0,Qt::white).
draw_line(w-1,0,w-1,h-1,Qt::black).draw_line(w-1,h-1,0,h-1,Qt::black).
draw_rectangle(0,0,w-1,h-1,gray).
draw_line(0,0,w-1,0,white).draw_line(0,h-1,0,0,white).
draw_line(w-1,0,w-1,h-1,black).draw_line(w-1,h-1,0,h-1,black).
draw_image(canvas,tx,ty);
else
canvas = CImg<unsigned char>(w,h,1,3).
draw_rectangle(0,0,w-1,h-1,Qt::gray).
draw_line(0,0,w-1,0,Qt::white).draw_line(0,h-1,0,0,Qt::white).
draw_line(w-1,0,w-1,h-1,Qt::black).draw_line(w-1,h-1,0,h-1,Qt::black);
draw_rectangle(0,0,w-1,h-1,gray).
draw_line(0,0,w-1,0,white).draw_line(0,h-1,0,0,white).
draw_line(w-1,0,w-1,h-1,black).draw_line(w-1,h-1,0,h-1,black);
if (logo.data) canvas.draw_image(logo,lx,ly);
unsigned int xbuttons[6];
......
kde4_header()
set(kritacimg_PART_SRCS
kis_cimg_filter.cc
kis_cimg_plugin.cc
kis_cimgconfig_widget.cc
)
kde4_automoc(${kritacimg_PART_SRCS})
kde4_add_ui3_files(kritacimg_PART_SRCS wdg_cimg.ui)
########### next target ###############
set(kritacimg_PART_SRCS dummy.cpp )
kde4_automoc(${kritacimg_PART_SRCS})
add_definitions(${KDE4_ENABLE_EXCEPTIONS})
file(WRITE dummy.cpp "//autogenerated file by cmake\n")
#file(WRITE dummy.cpp "//autogenerated file by cmake\n")
kde4_add_plugin(kritacimg ${kritacimg_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritacimg )
......
......@@ -180,9 +180,9 @@ void KisCImgFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilte
qint32 x = it.x() - rect.x();
qint32 y = it.y() - rect.y();
img(x, y, 0) = color.Qt::red();
img(x, y, 1) = color.Qt::green();
img(x, y, 2) = color.Qt::blue();
img(x, y, 0) = color.red();
img(x, y, 1) = color.green();
img(x, y, 2) = color.blue();
++it;
}
......
......@@ -28,13 +28,14 @@
typedef KGenericFactory<KisCImgPlugin> KisCImgPluginFactory;
K_EXPORT_COMPONENT_FACTORY( kritacimg, KisCImgPluginFactory( "krita" ) )
KisCImgPlugin::KisCImgPlugin(QObject *parent, const char *name, const QStringList &) : KParts::Plugin(parent, name)
KisCImgPlugin::KisCImgPlugin(QObject *parent, const char *name, const QStringList &) : KParts::Plugin(parent)
{
setObjectName(name);
setInstance(KisCImgPluginFactory::instance());
if (parent->inherits("KisFilterRegistry")) {
KisFilterRegistry * manager = dynamic_cast<KisFilterRegistry *>(parent);
manager->add(new KisCImgFilter());
manager->add(KisFilterSP(new KisCImgFilter()));
}
}
......
......@@ -75,10 +75,10 @@
<property name="value">
<number>45</number>
</property>
<property name="minValue">
<property name="minimum">
<number>5</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>90</number>
</property>
</widget>
......@@ -89,10 +89,10 @@
<property name="value">
<number>0.8</number>
</property>
<property name="minValue">
<property name="minimum">
<number>0.1</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>10</number>
</property>
</widget>
......@@ -103,10 +103,10 @@
<property name="value">
<number>3</number>
</property>
<property name="minValue">
<property name="minimum">
<number>0.1</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>10</number>
</property>
</widget>
......@@ -168,7 +168,7 @@
<property name="value">
<number>0.1</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>100</number>
</property>
</widget>
......@@ -179,7 +179,7 @@
<property name="value">
<number>0.9</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>100</number>
</property>
</widget>
......@@ -190,7 +190,7 @@
<property name="value">
<number>20</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>500</number>
</property>
</widget>
......@@ -201,7 +201,7 @@
<property name="value">
<number>1.4</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>10</number>
</property>
</widget>
......@@ -252,10 +252,10 @@
<property name="value">
<number>1</number>
</property>
<property name="minValue">
<property name="minimum">
<number>1</number>
</property>
<property name="maxValue">
<property name="maximum">
<number>16</number>
</property>
</widget>
......@@ -264,6 +264,18 @@
</grid>
</widget>
<customwidgets>
<customwidget>
<class>KIntNumInput</class>
<header>knuminput.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
<customwidget>
<class>KDoubleNumInput</class>
<header>knuminput.h</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>numDetail</tabstop>
......@@ -278,21 +290,5 @@
</tabstops>
<layoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>
</includehints>
</UI>
kde4_header()
########### next target ###############
set(kritacolorsfilters_PART_SRCS dummy.cpp )
set(kritacolorsfilters_PART_SRCS
kis_perchannel_filter.cc
kis_brightness_contrast_filter.cc
)
kde4_automoc(${kritacolorsfilters_PART_SRCS})
file(WRITE dummy.cpp "//autogenerated file by cmake\n")
kde4_add_ui3_files(kritacolorsfilters_PART_SRCS
wdg_perchannel.ui
wdg_brightness_contrast.ui
)
#file(WRITE dummy.cpp "//autogenerated file by cmake\n")
kde4_add_plugin(kritacolorsfilters ${kritacolorsfilters_PART_SRCS})
kde4_install_libtool_file( ${PLUGIN_INSTALL_DIR} kritacolorsfilters )
target_link_libraries(kritacolorsfilters ${KDE4_KDECORE_LIBS} )
target_link_libraries(kritacolorsfilters ${KDE4_KDECORE_LIBS} kritacommon)
install_targets(${LIB_INSTALL_DIR}/kde4 kritacolorsfilters )
......
......@@ -290,7 +290,7 @@ KisBrightnessContrastConfigWidget::KisBrightnessContrastConfigWidget(QWidget * p
}
m_page->vgradient->setPixmap(vgradientpix);
KisHistogramProducerSP producer = new KisGenericLabHistogramProducer();
KisHistogramProducerSP producer = KisHistogramProducerSP(new KisGenericLabHistogramProducer());
KisHistogram histogram(dev, producer, LINEAR);
QPixmap pix(256, height);
pix.fill();
......
......@@ -34,7 +34,7 @@ KisKernelSP createKernel( qint32 i0, qint32 i1, qint32 i2,
qint32 i6, qint32 i7, qint32 i8,
qint32 factor, qint32 offset )
{
KisKernelSP kernel = new KisKernel();
KisKernelSP kernel = KisKernelSP(new KisKernel());
kernel->width = 3;
kernel->height = 3;
......@@ -61,25 +61,26 @@ typedef KGenericFactory<KritaConvolutionFilters> KritaConvolutionFiltersFactory;
K_EXPORT_COMPONENT_FACTORY( kritaconvolutionfilters, KritaConvolutionFiltersFactory( "krita" ) )
KritaConvolutionFilters::KritaConvolutionFilters(QObject *parent, const char *name, const QStringList &)
: KParts::Plugin(parent, name)
: KParts::Plugin(parent)
{
setObjectName(name);
setInstance(KritaConvolutionFiltersFactory::instance());
if (parent->inherits("KisFilterRegistry")) {
KisFilterRegistry * manager = dynamic_cast<KisFilterRegistry *>(parent);
manager->add(new KisGaussianBlurFilter());
manager->add(new KisSharpenFilter());
manager->add(new KisMeanRemovalFilter());
manager->add(new KisEmbossLaplascianFilter());
manager->add(new KisEmbossInAllDirectionsFilter());
manager->add(new KisEmbossHorizontalVerticalFilter());
manager->add(new KisEmbossVerticalFilter());
manager->add(new KisEmbossHorizontalFilter());
manager->add(new KisTopEdgeDetectionFilter());
manager->add(new KisRightEdgeDetectionFilter());
manager->add(new KisBottomEdgeDetectionFilter());
manager->add(new KisLeftEdgeDetectionFilter());
manager->add(new KisCustomConvolutionFilter());
manager->add(KisFilterSP(new KisGaussianBlurFilter()));
manager->add(KisFilterSP(new KisSharpenFilter()));
manager->add(KisFilterSP(new KisMeanRemovalFilter()));
manager->add(KisFilterSP(new KisEmbossLaplascianFilter()));
manager->add(KisFilterSP(new KisEmbossInAllDirectionsFilter()));
manager->add(KisFilterSP(new KisEmbossHorizontalVerticalFilter()));
manager->add(KisFilterSP(new KisEmbossVerticalFilter()));
manager->add(KisFilterSP(new KisEmbossHorizontalFilter()));
manager->add(KisFilterSP(new KisTopEdgeDetectionFilter()));
manager->add(KisFilterSP(new KisRightEdgeDetectionFilter()));
manager->add(KisFilterSP(new KisBottomEdgeDetectionFilter()));
manager->add(KisFilterSP(new KisLeftEdgeDetectionFilter()));
manager->add(KisFilterSP(new KisCustomConvolutionFilter()));
}
}
......
......@@ -117,7 +117,7 @@ void KisConvolutionFilter::process(KisPaintDeviceSP src,
KisFilterConfiguration* KisConvolutionConstFilter::configuration(QWidget*)
{
return new KisConvolutionConfiguration( id().id(), m_matrix );
return new KisConvolutionConfiguration( id().id(), m_matrix.data() );
}
#include "kis_convolution_filter.moc"
......@@ -44,7 +44,7 @@ KisFilterConfiguration * KisCustomConvolutionFilter::configuration(QWidget* nwid
if ( widget == 0 )
{
// Create the identity matrix:
KisKernelSP kernel = new KisKernel();
KisKernelSP kernel = KisKernelSP(new KisKernel());
kernel->width = 3;
kernel->height = 3;
......@@ -62,12 +62,12 @@ KisFilterConfiguration * KisCustomConvolutionFilter::configuration(QWidget* nwid
kernel->data[7] = 0;
kernel->data[8] = 0;
return new KisConvolutionConfiguration( "custom convolution", kernel );
return new KisConvolutionConfiguration( "custom convolution", kernel.data() );
} else {
// Create the identity matrices:
KisKernelSP kernel = new KisKernel();
KisKernelSP kernel = KisKernelSP(new KisKernel());
kernel->width = 3;