Commit e9fdc563 authored by Boudewijn Rempt's avatar Boudewijn Rempt

* Fix saving of per-channel adj. layers

* Fix some warnings from the icefox.net
* Always initialize exifdata when copying

svn path=/trunk/koffice/; revision=516617
parent 8f49ae3c
/*
* Copyright (c) 2006 Boudewijn Rempt
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef COMPOSITE_CMYK
#define COMPOSITE_CMYK
void compositeCopyCyan(Q_INT32 stride,
Q_UINT8 *dst,
Q_INT32 dststride,
......@@ -51,3 +72,5 @@ void compositeCopyBlack(Q_INT32 stride,
compositeCopyChannel(PIXEL_BLACK, stride, dst, dststride, src, srcstride, rows, cols, opacity);
}
#endif
\ No newline at end of file
/*
* Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_filter_config_widget.h"
......
......@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if !defined KIS_ITERATOR_H_
#ifndef KIS_ITERATOR_H_
#define KIS_ITERATOR_H_
#include <qglobal.h>
......
......@@ -296,6 +296,9 @@ KisPaintDevice::KisPaintDevice(const KisPaintDevice& rhs) : QObject(), KShared(r
{
m_exifInfo = new KisExifInfo(*rhs.m_exifInfo);
}
else {
m_exifInfo = 0;
}
}
}
......
......@@ -38,7 +38,7 @@ class KisPaintDevice;
struct KisPaletteEntry {
QColor color;
QString name;
bool operator==(const KisPaletteEntry& rhs) {
bool operator==(const KisPaletteEntry& rhs) const {
return color == rhs.color && name == rhs.name;
}
};
......
......@@ -117,7 +117,7 @@ void KisScaleWorker::run()
{
for(int channel = 0; channel < m_pixelSize; channel++){
weight[channel] = 0.0;
bPelDelta[channel] = FALSE;
bPelDelta[channel] = false;
pel[channel]=tmpRows[contribY.p[0].m_pixel][ x * m_pixelSize + channel ];
}
for(int srcpos = 0; srcpos < contribY.n; srcpos++)
......@@ -126,7 +126,7 @@ void KisScaleWorker::run()
for(int channel = 0; channel < m_pixelSize; channel++)
{
pel2[channel]=tmpRows[contribY.p[srcpos].m_pixel][ x * m_pixelSize + channel ];
if(pel2[channel] != pel[channel]) bPelDelta[channel] = TRUE;
if(pel2[channel] != pel[channel]) bPelDelta[channel] = true;
weight[channel] += pel2[channel] * contribY.p[srcpos].m_weight;
}
}
......@@ -143,7 +143,7 @@ void KisScaleWorker::run()
{
for(int channel = 0; channel < m_pixelSize; channel++){
weight[channel] = 0.0;
bPelDelta[channel] = FALSE;
bPelDelta[channel] = false;
pel[channel] = tmp[ contribX[x].p[0].m_pixel * m_pixelSize + channel ];
}
for(int srcpos = 0; srcpos < contribX[x].n; srcpos++)
......@@ -151,7 +151,7 @@ void KisScaleWorker::run()
for(int channel = 0; channel < m_pixelSize; channel++){
pel2[channel] = tmp[ contribX[x].p[srcpos].m_pixel * m_pixelSize + channel ];
if(pel2[channel] != pel[channel])
bPelDelta[channel] = TRUE;
bPelDelta[channel] = true;
weight[channel] += pel2[channel] * contribX[x].p[srcpos].m_weight;
}
}
......
......@@ -323,7 +323,7 @@ template <class T> void KisTransformWorker::transformPass(KisPaintDevice *src, K
int sum = 0;
Q_INT32 t = (((begin<<8) - center) * invfscale)>>8;
Q_INT32 dt = invfscale;
for(int srcpos = begin; srcpos <= end; srcpos++)
for(int srcpos = begin; srcpos <= end; ++srcpos)
{
Q_UINT32 tmpw = filterStrategy->intValueAt(t) * invfscale;
......
......@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if !defined KIS_TILE_H_
#ifndef KIS_TILE_H_
#define KIS_TILE_H_
#include <qglobal.h>
......
......@@ -15,7 +15,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if !defined KIS_TILED_ITERATOR_H_
#ifndef KIS_TILED_ITERATOR_H_
#define KIS_TILED_ITERATOR_H_
#include <qglobal.h>
......
......@@ -15,7 +15,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#if !defined KIS_TILEMANAGER_H_
#ifndef KIS_TILEMANAGER_H_
#define KIS_TILEMANAGER_H_
#include <qglobal.h>
......
......@@ -21,3 +21,7 @@
part. the user interface loads tools and other plugins.
*/
#ifndef DESIGN
#define DESIGN
// Let's keep icefox.net/kde/tests.headerincluded_koffice.html happy
#endif
\ No newline at end of file
......@@ -62,7 +62,7 @@ public:
virtual ~KisAbstractColorSpace();
virtual bool operator==(const KisAbstractColorSpace& rhs) {
virtual bool operator==(const KisAbstractColorSpace& rhs) const {
return (m_id == rhs.m_id && m_profile == rhs.m_profile);
}
......
......@@ -56,7 +56,7 @@ public:
virtual DCOPObject * dcopObject();
virtual bool operator==(const KisColorSpace& rhs) {
virtual bool operator==(const KisColorSpace& rhs) const {
return id().id() == rhs.id().id();
}
......
......@@ -141,7 +141,7 @@ KisColorSpace * KisColorSpaceFactoryRegistry::getColorSpace(const KisID & csID,
{
QString profileName = pName;
if(profileName == "")
if(profileName.isEmpty())
{
KisColorSpaceFactory *csf = get(csID);
......
......@@ -164,6 +164,12 @@ bool KisBrightnessContrastFilter::workWith(KisColorSpace* cs)
void KisBrightnessContrastFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration* config, const QRect& rect)
{
if (!config) {
kdWarning() << "No configuration object for brightness/contrast filter\n";
return;
}
KisBrightnessContrastFilterConfiguration* configBC = (KisBrightnessContrastFilterConfiguration*) config;
if (src!=dst) {
......
......@@ -40,9 +40,9 @@ KisPerChannelFilterConfiguration::KisPerChannelFilterConfiguration(int n)
: KisFilterConfiguration( "perchannel", 1 )
{
curves = new QSortedList<QPair<double,double> >[n];
for(int i=0;i<n;i++) {
transfers[i] = new Q_UINT16[256];
memset(transfers[i], 0, 256);
}
nTransfers = n;
}
......@@ -54,8 +54,6 @@ KisPerChannelFilterConfiguration::~KisPerChannelFilterConfiguration()
delete [] transfers[i];
}
void KisPerChannelFilterConfiguration::fromXML( const QString& s )
{
QDomDocument doc;
......@@ -69,9 +67,14 @@ void KisPerChannelFilterConfiguration::fromXML( const QString& s )
if (e.attribute("name") == "transfers") {
QDomNode transferNode = e.firstChild();
nTransfers = e.attribute("number").toUShort();
for (int i = 0; i < nTransfers ; i++) {
transfers[i] = new Q_UINT16[256];
memset(transfers[i], 0, 256);
}
int count = 0;
while (!transferNode.isNull()) {
QDomElement transferElement = transferNode.toElement();
if (!transferElement.isNull()) {
QStringList data = QStringList::split( ",", transferElement.text() );
......@@ -131,7 +134,7 @@ QString KisPerChannelFilterConfiguration::toString()
for (int i = 0; i < nTransfers; ++i) {
QDomElement t = doc.createElement("transfer");
QString sTransfer;
for ( uint j = 0; j < 255 ; ++i ) {
for ( uint j = 0; j < 255 ; ++j ) {
sTransfer += QString::number( transfers[i][j] );
sTransfer += ",";
}
......@@ -193,6 +196,11 @@ std::list<KisFilterConfiguration*> KisPerChannelFilter::listOfExamplesConfigurat
void KisPerChannelFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration* config, const QRect& rect)
{
if (!config) {
kdWarning() << "No configuration object for per-channel filter\n";
return;
}
KisPerChannelFilterConfiguration* configBC = (KisPerChannelFilterConfiguration*) config;
KisColorAdjustment *adj = src->colorSpace()->createPerChannelAdjustment(configBC->transfers);
......
......@@ -57,6 +57,7 @@ public:
public:
virtual KisFilterConfigWidget * createConfigurationWidget(QWidget* parent, KisPaintDeviceSP dev);
virtual KisFilterConfiguration* configuration(QWidget*);
virtual KisFilterConfiguration* configuration() { return new KisPerChannelFilterConfiguration(0); };
virtual void process(KisPaintDeviceSP, KisPaintDeviceSP, KisFilterConfiguration* , const QRect&);
static inline KisID id() { return KisID("perchannel", i18n("Color Adjustment")); };
virtual bool supportsPainting() { return true; }
......
......@@ -57,6 +57,11 @@ KisOilPaintFilter::KisOilPaintFilter() : KisFilter(id(), "artistic", i18n("&Oilp
void KisOilPaintFilter::process(KisPaintDeviceSP src, KisPaintDeviceSP dst, KisFilterConfiguration* configuration, const QRect& rect)
{
if (!configuration) {
kdWarning() << "No configuration object for oilpaint filter\n";
return;
}
Q_UNUSED(dst);
Q_INT32 x = rect.x(), y = rect.y();
......
/*
* Copyright (c) 1999 Matthias Elter
* Copyright (c) 2002 Patrick Julien
*
* 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
......@@ -16,7 +15,6 @@
* 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_TOOL_SELECT_PICKER_H_
#define KIS_TOOL_SELECT_PICKER_H_
......
/*
* colorrange.h -- Part of Krita
*
* Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org)
*
* 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
......
// -*- c++ -*-
/*
* (c) Richard J. Moore 1997-2002
* (c) Matthias Ettrich 2000
* (c) Aaron J. Seigo 2002
* (c) Nadeem Hasan 2003
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef KSNAPSHOT_H
#define KSNAPSHOT_H
......
......@@ -12,6 +12,10 @@ G = Gábor Level
S = Sander Koning
TZ = Thomas Zander (to refer to his ui hints)
Configure
The 1.14 test doesn't work -- I've 1.13 and 1.15 and not 1.14 and it still
warns me!
Colorspaces
......
......@@ -83,7 +83,7 @@ void KisAutogradient::slotChangedInterpolation(int type)
KisGradientSegment* segment = gradientSlider -> selectedSegment();
if(segment)
segment -> setInterpolation( type );
gradientSlider -> repaint();
gradientSlider -> update();
paramChanged();
}
......@@ -93,7 +93,7 @@ void KisAutogradient::slotChangedColorInterpolation(int type)
KisGradientSegment* segment = gradientSlider -> selectedSegment();
if(segment)
segment -> setColorInterpolation( type );
gradientSlider -> repaint();
gradientSlider -> update();
paramChanged();
}
......@@ -103,7 +103,7 @@ void KisAutogradient::slotChangedLeftColor( const QColor& color)
KisGradientSegment* segment = gradientSlider -> selectedSegment();
if(segment)
segment -> setStartColor( Color( color, segment -> startColor().alpha() ) );
gradientSlider -> repaint();
gradientSlider -> update();
paramChanged();
}
......
......@@ -635,6 +635,7 @@ KisAdjustmentLayerSP KisDoc::loadAdjustmentLayer(const QDomElement& element, Kis
if ((filtername = element.attribute("filtername")).isNull()) {
// XXX: Invalid adjustmentlayer! We should warn about it!
kdWarning(DBG_AREA_FILE) << "No filter in adjustment layer" << endl;
return 0;
}
......
......@@ -29,7 +29,7 @@ KisIconWidget::KisIconWidget(QWidget *parent, const char *name) : super(parent,
void KisIconWidget::slotSetItem(KoIconItem& item)
{
m_item = &item;
repaint();
update();
}
void KisIconWidget::drawButtonLabel(QPainter *p)
......
/*
* Copyright (c) 2004 Boudewijn Rempt (boud@valdyas.org)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "kis_label_zoom.h"
#include "kis_label_zoom.moc"
......@@ -146,7 +146,6 @@ public:
m_store -> close();
if (data) {
KisFilterConfiguration * kfc = layer->filter();
kdDebug() << "loaded adj layer xml for " << kfc << "\n" << QString(data) << "\n";
kfc->fromXML(QString(data));
}
}
......
......@@ -140,7 +140,7 @@ QPixmap KisPaintopBox::paintopPixmap(const KisID & paintop)
{
QString pixmapName = KisPaintOpRegistry::instance()->pixmap(paintop);
if (pixmapName.isEmpty() /*|| pixmapName.isNull() || pixmapName == ""*/) {
if (pixmapName.isEmpty()) {
return QPixmap();
}
......
......@@ -113,7 +113,7 @@ void KisRuler::setUnit(KoUnit::Unit u)
m_unit = u;
drawRuler();
updatePointer(m_currentPosition, m_currentPosition);
repaint();
update();
}
void KisRuler::setZoom(double zoom)
......@@ -122,7 +122,7 @@ void KisRuler::setZoom(double zoom)
recalculateSize();
drawRuler();
updatePointer(m_currentPosition, m_currentPosition);
repaint();
update();
}
void KisRuler::updatePointer(Q_INT32 x, Q_INT32 y)
......@@ -130,7 +130,7 @@ void KisRuler::updatePointer(Q_INT32 x, Q_INT32 y)
if (m_pixmapBuffer) {
if (m_orientation == Qt::Horizontal) {
if (m_currentPosition != -1)
repaint(m_currentPosition, 1, MARKER_WIDTH, MARKER_HEIGHT);
update(m_currentPosition, 1, MARKER_WIDTH, MARKER_HEIGHT);
if (x != -1) {
bitBlt(this, x, 1, &m_pixmapMarker, 0, 0, MARKER_WIDTH, MARKER_HEIGHT);
......@@ -138,7 +138,7 @@ void KisRuler::updatePointer(Q_INT32 x, Q_INT32 y)
}
} else {
if (m_currentPosition != -1)
repaint(1, m_currentPosition, MARKER_HEIGHT, MARKER_WIDTH);
update(1, m_currentPosition, MARKER_HEIGHT, MARKER_WIDTH);
if (y != -1) {
bitBlt(this, 1, y, &m_pixmapMarker, 0, 0, MARKER_HEIGHT, MARKER_WIDTH);
......@@ -156,7 +156,7 @@ void KisRuler::updateVisibleArea(Q_INT32 xpos, Q_INT32 ypos)
m_firstVisible = ypos;
drawRuler();
repaint();
update();
updatePointer(m_currentPosition, m_currentPosition);
}
......
......@@ -79,8 +79,10 @@ void KisToolManager::setUp(KoToolBox * toolbox, KoPaletteManager * paletteManage
toolbox->setupTools();
KisTool * t = findTool("tool_brush");
t->activate();
setCurrentTool(t);
if (t) {
t->activate();
setCurrentTool(t);
}
setup = true;
}
......
......@@ -322,10 +322,10 @@ KisView::KisView(KisDoc *doc, KisUndoAdapter *adapter, QWidget *parent, const ch
insertChildClient(plugin);
}
else {
kdDebug(51006) << "found plugin " << service -> property("Name").toString() << ", " << errCode << "\n";
kdDebug(41006) << "found plugin " << service -> property("Name").toString() << ", " << errCode << "\n";
if( errCode == KParts::ComponentFactory::ErrNoLibrary)
{
kdWarning(51006) << " Error loading plugin was : ErrNoLibrary " << KLibLoader::self()->lastErrorMessage() << endl;
kdWarning(41006) << " Error loading plugin was : ErrNoLibrary " << KLibLoader::self()->lastErrorMessage() << endl;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment