Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Remove unused leftover .cpp/.h files

Freya Lupen20d2a5dee3ed
diff --git a/libs/flake/commands/KoShapeConnectionChangeCommand.cpp b/libs/flake/commands/KoShapeConnectionChangeCommand.cpp
deleted file mode 100644
index 3291412e1c..0000000000
--- a/libs/flake/commands/KoShapeConnectionChangeCommand.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2011 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoShapeConnectionChangeCommand.h"
-
-class Q_DECL_HIDDEN KoShapeConnectionChangeCommand::Private
-{
-public:
- Private()
- : connection(0), newConnectedShape(0), oldConnectedShape(0)
- , newConnectionPointId(-1), oldConnectionPointId(-1)
- {
- }
-
- KoConnectionShape *connection;
- KoConnectionShape::HandleId connectionHandle;
- KoShape *newConnectedShape;
- KoShape *oldConnectedShape;
- int newConnectionPointId;
- int oldConnectionPointId;
-
-};
-
-KoShapeConnectionChangeCommand::KoShapeConnectionChangeCommand(
- KoConnectionShape *connection, KoConnectionShape::HandleId connectionHandle,
- KoShape *oldConnectedShape, int oldConnectionPointId,
- KoShape *newConnectedShape, int newConnectionPointId, KUndo2Command *parent)
- : KUndo2Command(parent), d(new Private)
-{
- d->connection = connection;
- d->connectionHandle = connectionHandle;
- d->oldConnectedShape = oldConnectedShape;
- d->oldConnectionPointId = oldConnectionPointId;
- d->newConnectedShape = newConnectedShape;
- d->newConnectionPointId = newConnectionPointId;
-}
-
-KoShapeConnectionChangeCommand::~KoShapeConnectionChangeCommand()
-{
- delete d;
-}
-
-void KoShapeConnectionChangeCommand::redo()
-{
- if(d->connection) {
- if(d->connectionHandle == KoConnectionShape::StartHandle) {
- d->connection->connectFirst(d->newConnectedShape, d->newConnectionPointId);
- }
- else {
- d->connection->connectSecond(d->newConnectedShape, d->newConnectionPointId);
- }
- }
-
- KUndo2Command::redo();
-}
-
-void KoShapeConnectionChangeCommand::undo()
-{
- KUndo2Command::undo();
-
- if(d->connection) {
- if(d->connectionHandle == KoConnectionShape::StartHandle) {
- d->connection->connectFirst(d->oldConnectedShape, d->oldConnectionPointId);
- }
- else {
- d->connection->connectSecond(d->oldConnectedShape, d->oldConnectionPointId);
- }
- }
-}
diff --git a/libs/flake/commands/KoShapeConnectionChangeCommand.h b/libs/flake/commands/KoShapeConnectionChangeCommand.h
deleted file mode 100644
index 19ac5acea3..0000000000
--- a/libs/flake/commands/KoShapeConnectionChangeCommand.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2011 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOSHAPECONNECTIONCHANGECOMMAND_H
-#define KOSHAPECONNECTIONCHANGECOMMAND_H
-
-#include "kritaflake_export.h"
-#include <kundo2command.h>
-#include "KoConnectionShape.h"
-
-/// A command to add a connection between two shapes
-class KRITAFLAKE_EXPORT KoShapeConnectionChangeCommand : public KUndo2Command
-{
-public:
- /**
- * Creates command to connect a connection shape to a shape
- * @param connection the connection shape to connect to the shape
- * @param connectionHandle the handle of the connection to connect to
- * @param oldConnectedShape the old shape we were connected to
- * @param newConnectedShape the new shape to connect to
- * @param connectionPointId the id of the connection point to connect to
- * @param parent the parent undo command
- */
- KoShapeConnectionChangeCommand(KoConnectionShape *connection, KoConnectionShape::HandleId connectionHandle,
- KoShape *oldConnectedShape, int oldConnectionPointId,
- KoShape *newConnectedShape, int newConnectionPointId, KUndo2Command *parent = 0);
-
- /// Destroys the command
- ~KoShapeConnectionChangeCommand() override;
-
- /// redo the command
- void redo() override;
- /// revert the actions done in redo
- void undo() override;
-
-private:
- class Private;
- Private * const d;
-};
-
-#endif // KOSHAPECONNECTIONCHANGECOMMAND_H
diff --git a/libs/resources/KisTagList.cpp b/libs/resources/KisTagList.cpp
deleted file mode 100644
index 53801aa600..0000000000
--- a/libs/resources/KisTagList.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-/*
- * SPDX-License-Identifier: GPL-3.0-or-later
- */
-
-#include <KisTagList.h>
-
-KisTagList::KisTagList()
-{
-
-
-}
diff --git a/libs/resources/KisTagList.h b/libs/resources/KisTagList.h
deleted file mode 100644
index 2bda06250e..0000000000
--- a/libs/resources/KisTagList.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2018 Agata Cacko <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include <QList>
-
-#include <KisTag.h>
-
-class KisTagList : public QList<KisTagSP>
-{
- KisTagList();
-
-
-
-}
-
diff --git a/libs/ui/kis_md5_generator.cpp b/libs/ui/kis_md5_generator.cpp
deleted file mode 100644
index 0b438542c3..0000000000
--- a/libs/ui/kis_md5_generator.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2015 Stefano Bonicatti <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.1-or-later
-*/
-#include "kis_md5_generator.h"
-
-#include <kis_debug.h>
-#include <KoStore.h>
-
-KisMD5Generator::KisMD5Generator()
-{
-
-}
-
-KisMD5Generator::~KisMD5Generator()
-{
-
-}
-
-QByteArray KisMD5Generator::generateHash(const QString &filename)
-{
- QByteArray ba;
- if(filename.startsWith("bundle://")) {
- QString bn = filename.mid(9);
- int pos = bn.lastIndexOf(":");
- QString fn = bn.right(bn.size() - pos - 1);
- bn = bn.left(pos);
-
- QScopedPointer<KoStore> resourceStore(KoStore::createStore(bn, KoStore::Read, "application/x-krita-resourcebundle", KoStore::Zip));
- if (!resourceStore || resourceStore->bad()) {
- warnKrita << "Could not open store on bundle" << bn;
- return ba;
- }
-
- if (resourceStore->isOpen()) resourceStore->close();
-
- if (!resourceStore->open(fn)) {
- warnKrita << "Could not open preset" << fn << "in bundle" << bn;
- return ba;
- }
-
- ba = resourceStore->device()->readAll();
-
- resourceStore->close();
- return KoMD5Generator::generateHash(ba);
-
- }
-
- return KoMD5Generator::generateHash(filename);
-}
diff --git a/libs/ui/tool/KisToolShapeUtils.cpp b/libs/ui/tool/KisToolShapeUtils.cpp
deleted file mode 100644
index 8b72dfbf65..0000000000
--- a/libs/ui/tool/KisToolShapeUtils.cpp
+++ /dev/null
@@ -1,5 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2019 Dmitry Kazakov <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
diff --git a/libs/widgets/KoEditColorSetDialog.cpp b/libs/widgets/KoEditColorSetDialog.cpp
deleted file mode 100644
index 53aeb973c8..0000000000
--- a/libs/widgets/KoEditColorSetDialog.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2007 Fredy Yanardi <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoEditColorSetDialog.h"
-
-#include <KoIcon.h>
-
-#include <QScrollArea>
-#include <QHBoxLayout>
-#include <QColorDialog>
-#include <QInputDialog>
-
-#include <klocalizedstring.h>
-#include <kmessagebox.h>
-
-#include <resources/KoColorSet.h>
-#include <KoColorPatch.h>
-#include <KoColorSpaceRegistry.h>
-#include <KoFileDialog.h>
-
-// debug
-#include <WidgetsDebug.h>
-
-KoEditColorSetWidget::KoEditColorSetWidget(const QList<KoColorSet *> &palettes, const QString &activePalette, QWidget *parent)
- : QWidget(parent),
- m_colorSets(palettes),
- m_gridLayout(0),
- m_activeColorSet(0),
- m_activePatch(0),
- m_initialColorSetCount(palettes.count()),
- m_activeColorSetRequested(false)
-{
- widget.setupUi(this);
- foreach (KoColorSet *colorSet, m_colorSets) {
- //colorSet->load(); resources are loaded at startup...
- widget.selector->addItem(colorSet->name());
- }
- connect(widget.selector, SIGNAL(currentIndexChanged(int)), this, SLOT(setActiveColorSet(int)));
-
- // A widget that shows all colors from active palette
- // FIXME no need to hand code the QScrollArea if designer can add QScrollArea (Qt 4.4?)
- m_scrollArea = new QScrollArea(widget.patchesFrame);
-
- int index = 0;
- foreach (KoColorSet *set, m_colorSets) {
- if (set->name() == activePalette) {
- m_activeColorSet = set;
- index = widget.selector->findText(set->name());
- widget.selector->setCurrentIndex(index);
- }
- }
- if (!m_activeColorSet && !palettes.isEmpty()) {
- m_activeColorSet = palettes.first();
- index = widget.selector->findText(m_activeColorSet->name());
- }
-
- int columns = 16;
- if(m_activeColorSet) {
- columns = m_activeColorSet->columnCount();
- if (columns==0){
- columns = 16;
- }
- }
- m_scrollArea->setMinimumWidth(columns*(12+2));
-
- QHBoxLayout *layout = new QHBoxLayout(widget.patchesFrame);
- layout->setContentsMargins(0, 0, 0, 0);
- layout->addWidget(m_scrollArea);
-
- widget.add->setIcon(koIcon("list-add"));
- widget.remove->setIcon(koIcon("list-remove"));
- widget.open->setIcon(koIcon("document-open"));
- widget.save->setIcon(koIcon("document-save"));
-
- setEnabled(m_activeColorSet != 0);
- setActiveColorSet(index);
- widget.remove->setEnabled(false); // initially no color selected
-
- connect(widget.add, SIGNAL(clicked()), this, SLOT(addColor()));
- connect(widget.remove, SIGNAL(clicked()), this, SLOT(removeColor()));
- connect(widget.open, SIGNAL(clicked()), this, SLOT(open()));
- connect(widget.save, SIGNAL(clicked()), this, SLOT(save()));
-}
-
-KoEditColorSetWidget::~KoEditColorSetWidget()
-{
- // only delete new color sets
- uint colorSetCount = m_colorSets.count();
- for( uint i = m_initialColorSetCount; i < colorSetCount; ++i ) {
- KoColorSet * cs = m_colorSets[i];
- // if the active color set was requested by activeColorSet()
- // the caller takes ownership and then we do not delete it here
- if( cs == m_activeColorSet && m_activeColorSetRequested )
- continue;
- delete cs;
- }
-}
-
-void KoEditColorSetWidget::setActiveColorSet(int index)
-{
- if (m_gridLayout) {
- qDeleteAll(m_gridLayout->children());
- delete m_gridLayout;
- m_activePatch = 0;
- }
-
- QWidget *wdg = new QWidget(m_scrollArea);
- m_gridLayout = new QGridLayout(wdg);
- m_gridLayout->setContentsMargins(0, 0, 0, 0);
- m_gridLayout->setSpacing(2);
-
- m_activeColorSet = m_colorSets.value(index);
- setEnabled(m_activeColorSet != 0);
- int columns = 16;
-
- if (m_activeColorSet) {
- columns = m_activeColorSet->columnCount();
- if (columns==0){columns=16;}
- widget.remove->setEnabled(false);
- for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) {
- KoColorPatch *patch = new KoColorPatch(widget.patchesFrame);
- KoColorSetEntry c = m_activeColorSet->getColorGlobal(i);
- patch->setColor(c.color());
- patch->setToolTip(c.name());
- connect(patch, SIGNAL(triggered(KoColorPatch*)), this, SLOT(setTextLabel(KoColorPatch*)));
- m_gridLayout->addWidget(patch, i/columns, i%columns);
- }
- }
-
- m_scrollArea->setMinimumWidth(columns*(12+2));
- m_scrollArea->setWidget(wdg);
-}
-
-void KoEditColorSetWidget::setTextLabel(KoColorPatch *patch)
-{
- widget.colorName->setText(patch->toolTip());
- if (m_activePatch) {
- m_activePatch->setFrameShape(QFrame::NoFrame);
- m_activePatch->setFrameShadow(QFrame::Plain);
- }
- m_activePatch = patch;
- m_activePatch->setFrameShape(QFrame::Panel);
- m_activePatch->setFrameShadow(QFrame::Raised);
- widget.remove->setEnabled(true);
-}
-
-void KoEditColorSetWidget::addColor()
-{
- QColor color;
-
- color = QColorDialog::getColor(color);
- if (color.isValid()) {
- KoColorSetEntry newEntry(
- KoColor(color, KoColorSpaceRegistry::instance()->rgb8()),
- QInputDialog::getText(this, i18n("Add Color To Palette"), i18n("Color name:")));
- KoColorPatch *patch = new KoColorPatch(widget.patchesFrame);
- patch->setColor(newEntry.color());
- patch->setToolTip(newEntry.name());
- connect(patch, SIGNAL(triggered(KoColorPatch*)), this, SLOT(setTextLabel(KoColorPatch*)));
- Q_ASSERT(m_gridLayout);
- Q_ASSERT(m_activeColorSet);
- m_gridLayout->addWidget(patch, m_activeColorSet->nColors()/m_activeColorSet->columnCount(), m_activeColorSet->nColors()%m_activeColorSet->columnCount());
- m_activeColorSet->add(newEntry);
- }
-}
-
-void KoEditColorSetWidget::removeColor()
-{
- Q_ASSERT(m_activeColorSet);
- for (quint32 i = 0; i < m_activeColorSet->nColors(); i++) {
- KoColorSetEntry c = m_activeColorSet->getColorGlobal(i);
- if (m_activePatch->color() == c.color()) {
- m_activeColorSet->removeAt(i);
- setActiveColorSet(widget.selector->currentIndex());
- break;
- }
- }
-}
-
-void KoEditColorSetWidget::open()
-{
- Q_ASSERT(m_activeColorSet);
- KoFileDialog dialog(this, KoFileDialog::OpenFile, "OpenColorSet");
- dialog.setDefaultDir(m_activeColorSet->filename());
- dialog.setMimeTypeFilters(QStringList() << "application/x-gimp-color-palette");
- QString fileName = dialog.filename();
- KoColorSet *colorSet = new KoColorSet(fileName);
- colorSet->load();
- m_colorSets.append(colorSet);
- widget.selector->addItem(colorSet->name());
- widget.selector->setCurrentIndex(widget.selector->count() - 1);
-}
-
-void KoEditColorSetWidget::save()
-{
- Q_ASSERT(m_activeColorSet);
- if (!m_activeColorSet->save())
- KMessageBox::error(0, i18n("Cannot write to palette file %1. Maybe it is read-only. ", m_activeColorSet->filename()), i18n("Palette"));
-}
-
-KoColorSet *KoEditColorSetWidget::activeColorSet()
-{
- m_activeColorSetRequested = true;
- return m_activeColorSet;
-}
-
-KoEditColorSetDialog::KoEditColorSetDialog(const QList<KoColorSet *> &palettes, const QString &activePalette, QWidget *parent)
- : KoDialog(parent)
-{
- ui = new KoEditColorSetWidget(palettes, activePalette, this);
- setMainWidget(ui);
- setCaption(i18n("Add/Remove Colors"));
- enableButton(KoDialog::Ok, ui->isEnabled());
-}
-
-KoEditColorSetDialog::~KoEditColorSetDialog()
-{
- delete ui;
-}
-
-KoColorSet *KoEditColorSetDialog::activeColorSet()
-{
- return ui->activeColorSet();
-}
diff --git a/libs/widgets/KoResourceItemDelegate.cpp b/libs/widgets/KoResourceItemDelegate.cpp
deleted file mode 100644
index c5cb317225..0000000000
--- a/libs/widgets/KoResourceItemDelegate.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoResourceItemDelegate.h"
-
-#include <resources/KoAbstractGradient.h>
-#include <resources/KoColorSet.h>
-#include <QPainter>
-
-KoResourceItemDelegate::KoResourceItemDelegate( QObject * parent )
- : QAbstractItemDelegate( parent ), m_checkerPainter( 4 )
-{
-}
-
-void KoResourceItemDelegate::paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const
-{
- if( ! index.isValid() )
- return;
-
- KoResource * resource = static_cast<KoResource*>( index.internalPointer() );
- if (!resource)
- return;
-
- painter->save();
-
- if (option.state & QStyle::State_Selected)
- painter->fillRect( option.rect, option.palette.highlight() );
-
- QRect innerRect = option.rect.adjusted( 2, 1, -2, -1 );
-
- KoAbstractGradient * gradient = dynamic_cast<KoAbstractGradient*>( resource );
- KoColorSet * palette = dynamic_cast<KoColorSet*>( resource );
- if (gradient) {
- QGradient * g = gradient->toQGradient();
-
- QLinearGradient paintGradient;
- paintGradient.setStops( g->stops() );
- paintGradient.setStart( innerRect.topLeft() );
- paintGradient.setFinalStop( innerRect.topRight() );
-
- m_checkerPainter.paint( *painter, innerRect );
- painter->fillRect( innerRect, QBrush( paintGradient ) );
-
- delete g;
- }
- else if (palette) {
- QImage thumbnail = index.data( Qt::DecorationRole ).value<QImage>();
- painter->setRenderHint(QPainter::SmoothPixmapTransform, thumbnail.width() > innerRect.width() || thumbnail.height() > innerRect.height());
- painter->drawImage(innerRect, thumbnail);
- }
- else {
- QImage thumbnail = index.data( Qt::DecorationRole ).value<QImage>();
-
- QSize imageSize = thumbnail.size();
-
- if(imageSize.height() > innerRect.height() || imageSize.width() > innerRect.width()) {
- qreal scaleW = static_cast<qreal>( innerRect.width() ) / static_cast<qreal>( imageSize.width() );
- qreal scaleH = static_cast<qreal>( innerRect.height() ) / static_cast<qreal>( imageSize.height() );
-
- qreal scale = qMin( scaleW, scaleH );
-
- int thumbW = static_cast<int>( imageSize.width() * scale );
- int thumbH = static_cast<int>( imageSize.height() * scale );
- thumbnail = thumbnail.scaled( thumbW, thumbH, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
- }
- painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
- if (thumbnail.hasAlphaChannel()) {
- painter->fillRect(innerRect, Qt::white); // no checkers, they are confusing with patterns.
- }
- painter->fillRect( innerRect, QBrush(thumbnail) );
- }
- painter->restore();
-}
-
-QSize KoResourceItemDelegate::sizeHint( const QStyleOptionViewItem & optionItem, const QModelIndex & ) const
-{
- return optionItem.decorationSize;
-}
diff --git a/libs/widgets/kis_palette_delegate.cpp b/libs/widgets/kis_palette_delegate.cpp
deleted file mode 100644
index b9c6e912df..0000000000
--- a/libs/widgets/kis_palette_delegate.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2016 Dmitry Kazakov <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "kis_palette_delegate.h"
-
-#include <QPen>
-#include <QPainter>
-
-#include <kis_global.h>
-#include "kis_debug.h"
-#include <KisPaletteModel.h>
-
-
-KisPaletteDelegate::KisPaletteDelegate(QObject *parent)
- : QAbstractItemDelegate(parent)
-{
-}
-
-KisPaletteDelegate::~KisPaletteDelegate()
-{
-}
-
-void KisPaletteDelegate::setCrossedKeyword(const QString &value)
-{
- m_crossedKeyword = value;
-}
-
-void KisPaletteDelegate::paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const
-{
- painter->save();
-
- if (! index.isValid())
- return;
-
- const bool isSelected = option.state & QStyle::State_Selected;
- const int minSize = qMin(option.rect.width(), option.rect.height());
- const int maxWidth = qBound(2, minSize / 6, 4);
- const int width = isSelected ? maxWidth : 1;
-
- if (qvariant_cast<bool>(index.data(KisPaletteModel::IsHeaderRole))) {
- QString name = qvariant_cast<QString>(index.data(Qt::DisplayRole));
- if (isSelected) {
- painter->fillRect(option.rect, option.palette.highlight());
- }
- QRect paintRect = kisGrowRect(option.rect, -width);
- painter->drawText(paintRect, name);
- } else {
- if (isSelected) {
- painter->fillRect(option.rect, option.palette.highlight());
- }
- QRect paintRect = kisGrowRect(option.rect, -width);
- QBrush brush = qvariant_cast<QBrush>(index.data(Qt::BackgroundRole));
- painter->fillRect(paintRect, brush);
- }
- painter->restore();
-
- QString name = qvariant_cast<QString>(index.data(Qt::DisplayRole));
- if (!m_crossedKeyword.isNull() && name.toLower().contains(m_crossedKeyword)) {
- QRect crossRect = kisGrowRect(option.rect, -maxWidth);
-
- painter->save();
- painter->setRenderHint(QPainter::Antialiasing, true);
- painter->setPen(QPen(Qt::white, 2.5));
- painter->drawLine(crossRect.topLeft(), crossRect.bottomRight());
- painter->setPen(QPen(Qt::red, 1.0));
- painter->drawLine(crossRect.topLeft(), crossRect.bottomRight());
- painter->restore();
- }
-}
-
-QSize KisPaletteDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex &) const
-{
- return option.decorationSize;
-}
diff --git a/plugins/paintops/hairy/gauss.cpp b/plugins/paintops/hairy/gauss.cpp
deleted file mode 100644
index 2e1602ac58..0000000000
--- a/plugins/paintops/hairy/gauss.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/**
- * SPDX-FileCopyrightText: 1982-1989 Donald H. House <[email protected]>
- * SPDX-FileCopyrightText: 1989 Robert Allen <[email protected]>
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-
-#include "gauss.h"
-#include <math.h>
-#include <stdlib.h>
-#include <QtGlobal>
-
-#ifdef Q_OS_WIN
-// quoting DRAND48(3) man-page:
-// These functions are declared obsolete by SVID 3,
-// which states that rand(3) should be used instead.
-#define srand48 srand
-#define drand48() (static_cast<double>(qrand()) / static_cast<double>(RAND_MAX))
-#endif
-
-double gauss::gaussian(double mean, double std, int seed)
-{
-
-#define itblmax 20 /* length - 1 of table describing F inverse */
-#define didu 40.0 /* delta table position / delta ind. variable */
- /* itblmax / 0.5 */
-
- /* interpolation table for F inverse */
- static double tbl[] = {0.00000E+00, 6.27500E-02, 1.25641E-01, 1.89000E-01,
- 2.53333E-01, 3.18684E-01, 3.85405E-01, 4.53889E-01,
- 5.24412E-01, 5.97647E-01, 6.74375E-01, 7.55333E-01,
- 8.41482E-01, 9.34615E-01, 1.03652E+00, 1.15048E+00,
- 1.28167E+00, 1.43933E+00, 1.64500E+00, 1.96000E+00,
- 3.87000E+00
- };
-
- static int first_time = 1;
-
- double u;
- double di;
- int index, minus;
- double delta, gaussian_random_value;
-
- if (first_time) {
- srand48(seed);
- first_time = 0;
- }
- /*
- compute uniform random number between 0.0 - 0.5, and a sign with
- probability 1/2 of being either + or -
- */
- u = drand48();
- if (u >= 0.5) {
- minus = 0;
- u = u - 0.5;
- }
- else {
- minus = 1;
- }
- /* interpolate gaussian random number using table */
-
- index = (int)(di = (didu * u));
- if (index == itblmax) {
- delta = tbl[index];
- }
- else {
- di -= index;
- delta = tbl[index] + (tbl[index + 1] - tbl[index]) * di;
- }
- gaussian_random_value = mean + std * (minus ? -delta : delta);
-
- return(gaussian_random_value);
-}
diff --git a/plugins/paintops/hairy/gauss.h b/plugins/paintops/hairy/gauss.h
deleted file mode 100644
index 9245512aa4..0000000000
--- a/plugins/paintops/hairy/gauss.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 1982 Donald H. House <[email protected]>
- * SPDX-FileCopyrightText: 1989 Robert Allen <[email protected]>
- *
- * SPDX-License-Identifier: GPL-2.0-or-later
- */
-#ifndef _GAUSS_H_
-#define _GAUSS_H_
-
-class gauss
-{
-public:
- /**
- * This function takes as parameters real valued mean and
- * standard-deviation, and an integer valued seed. It returns a
- * real number which may be interpreted as a sample of a normally
- * distributed (Gaussian) random variable with the specified mean
- * and standard deviation. After the first call to gauss, the seed
- * parameter is ignored.
- *
- * The computational technique used is to pass a uniformly
- * distributed random number through the inverse of the Normal
- * Distribution function.
- */
- static double gaussian(double, double, int);
-};
-
-#endif