[calligra] /: remove shiva plugin and dependency on opengtl stuff
Cyrille Berger
cberger at cberger.net
Sun Dec 1 18:05:11 UTC 2013
Git commit 7db029a1f8902873b5c6a76c2d72941290807c6a by Cyrille Berger.
Committed on 01/12/2013 at 15:48.
Pushed by berger into branch 'master'.
remove shiva plugin and dependency on opengtl stuff
CCMAIL:kimageshop at kde.org
closing related bugs as no more valids:
BUG:289776, 323364, 288722, 289191
D +0 -20 cmake/modules/FindOpenCTL.cmake
D +0 -19 cmake/modules/FindOpenShiva.cmake
D +0 -19 cmake/modules/FindQtShiva.cmake
M +0 -20 krita/CMakeLists.txt
M +0 -10 krita/plugins/extensions/CMakeLists.txt
D +0 -44 krita/plugins/extensions/shiva/CMakeLists.txt
D +0 -176 krita/plugins/extensions/shiva/PaintDeviceImage.cpp
D +0 -58 krita/plugins/extensions/shiva/PaintDeviceImage.h
D +0 -111 krita/plugins/extensions/shiva/QVariantValue.cpp
D +0 -28 krita/plugins/extensions/shiva/QVariantValue.h
D +0 -65 krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.cpp
D +0 -42 krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.h
D +0 -38 krita/plugins/extensions/shiva/UpdaterProgressReport.cpp
D +0 -37 krita/plugins/extensions/shiva/UpdaterProgressReport.h
D +0 -4 krita/plugins/extensions/shiva/collections/CMakeLists.txt
D +0 -33 krita/plugins/extensions/shiva/collections/filters/AntiBullify.shiva
D +0 -34 krita/plugins/extensions/shiva/collections/filters/Bullify.shiva
D +0 -2 krita/plugins/extensions/shiva/collections/filters/CMakeLists.txt
D +0 -48 krita/plugins/extensions/shiva/collections/filters/Caleidoscope.shiva
D +0 -30 krita/plugins/extensions/shiva/collections/filters/CentralAbsorbtion.shiva
D +0 -22 krita/plugins/extensions/shiva/collections/filters/Contraction.shiva
D +0 -463 krita/plugins/extensions/shiva/collections/filters/Droste.shiva
D +0 -30 krita/plugins/extensions/shiva/collections/filters/Expansion.shiva
D +0 -73 krita/plugins/extensions/shiva/collections/filters/Hypno.shiva
D +0 -58 krita/plugins/extensions/shiva/collections/filters/LensCorrection.shiva
D +0 -23 krita/plugins/extensions/shiva/collections/filters/MirrorImpose.shiva
D +0 -27 krita/plugins/extensions/shiva/collections/filters/Mosaic.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Planes.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Ray.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Ray2.shiva
D +0 -35 krita/plugins/extensions/shiva/collections/filters/Ripples.shiva
D +0 -44 krita/plugins/extensions/shiva/collections/filters/RotativeBlur.shiva
D +0 -47 krita/plugins/extensions/shiva/collections/filters/Roundify.shiva
D +0 -45 krita/plugins/extensions/shiva/collections/filters/Sea.shiva
D +0 -51 krita/plugins/extensions/shiva/collections/filters/Seamlesser.shiva
D +0 -48 krita/plugins/extensions/shiva/collections/filters/Sectorize.shiva
D +0 -34 krita/plugins/extensions/shiva/collections/filters/Slices.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Sphere.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Star.shiva
D +0 -115 krita/plugins/extensions/shiva/collections/filters/StereographicProjection.shiva
D +0 -70 krita/plugins/extensions/shiva/collections/filters/Tunnel.shiva
D +0 -69 krita/plugins/extensions/shiva/collections/filters/Tunnel2.shiva
D +0 -43 krita/plugins/extensions/shiva/collections/filters/ZigZag.shiva
D +0 -40 krita/plugins/extensions/shiva/collections/filters/oilify.shiva
D +0 -2 krita/plugins/extensions/shiva/collections/generators/CMakeLists.txt
D +0 -47 krita/plugins/extensions/shiva/collections/generators/CheckerBoard.shiva
D +0 -54 krita/plugins/extensions/shiva/collections/generators/ConcentricCircles.shiva
D +0 -68 krita/plugins/extensions/shiva/collections/generators/Disco.shiva
D +0 -809 krita/plugins/extensions/shiva/collections/generators/FractalExplorer.shiva
D +0 -80 krita/plugins/extensions/shiva/collections/generators/Metaball.shiva
D +0 -42 krita/plugins/extensions/shiva/collections/generators/Moire.shiva
D +0 -113 krita/plugins/extensions/shiva/collections/generators/PerlinNoise.shiva
D +0 -76 krita/plugins/extensions/shiva/collections/generators/Plasma.shiva
D +0 -29 krita/plugins/extensions/shiva/collections/generators/RadialGradient.shiva
D +0 -63 krita/plugins/extensions/shiva/collections/generators/Singleball.shiva
D +0 -80 krita/plugins/extensions/shiva/collections/generators/Something.shiva
D +0 -56 krita/plugins/extensions/shiva/collections/generators/SunRay.shiva
D +0 -92 krita/plugins/extensions/shiva/collections/generators/SuperNova.shiva
D +0 -63 krita/plugins/extensions/shiva/kritashivafilters.desktop
D +0 -63 krita/plugins/extensions/shiva/kritashivagenerators.desktop
D +0 -111 krita/plugins/extensions/shiva/shivafilter.cpp
D +0 -45 krita/plugins/extensions/shiva/shivafilter.h
D +0 -69 krita/plugins/extensions/shiva/shivafiltersplugin.cpp
D +0 -41 krita/plugins/extensions/shiva/shivafiltersplugin.h
D +0 -108 krita/plugins/extensions/shiva/shivagenerator.cpp
D +0 -49 krita/plugins/extensions/shiva/shivagenerator.h
D +0 -70 krita/plugins/extensions/shiva/shivageneratorsplugin.cpp
D +0 -40 krita/plugins/extensions/shiva/shivageneratorsplugin.h
http://commits.kde.org/calligra/7db029a1f8902873b5c6a76c2d72941290807c6a
diff --git a/cmake/modules/FindOpenCTL.cmake b/cmake/modules/FindOpenCTL.cmake
deleted file mode 100644
index c70cf57..0000000
--- a/cmake/modules/FindOpenCTL.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-
-INCLUDE(FindPkgConfig)
-
-pkg_check_modules(OPENCTL OpenCTL>=0.9.16)
-
-if (OPENCTL_FOUND)
- set(HAVE_OPENCTL TRUE)
- message(STATUS "OpenCTL Found Version: " ${OPENCTL_VERSION})
-
- if (NOT OpenCTL_FIND_QUIETLY )
- message(STATUS "Found OPENCTL: ${OPENCTL_LIBRARIES}")
- endif (NOT OpenCTL_FIND_QUIETLY)
-else ()
- if (NOT OpenCTL_FIND_QUIETLY)
- message(STATUS "OpenCTL was NOT found.")
- endif ()
- if (OpenCTL_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find OPENCTL")
- endif ()
-endif ()
diff --git a/cmake/modules/FindOpenShiva.cmake b/cmake/modules/FindOpenShiva.cmake
deleted file mode 100644
index 9a67ed4..0000000
--- a/cmake/modules/FindOpenShiva.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-
-INCLUDE(FindPkgConfig)
-
-pkg_check_modules(OPENSHIVA OpenShiva>=0.9.16)
-
-if (OPENSHIVA_FOUND)
- set(HAVE_OPENSHIVA TRUE)
- message(STATUS "OpenShiva >= 0.9.16 was found")
- if (NOT OPENSHIVA_FIND_QUIETLY)
- message(STATUS "Found OpenShiva: ${OPENSHIVA_LIBRARIES}")
- endif ()
-else ()
- if (NOT OPENSHIVA_FIND_QUIETLY)
- message(STATUS "OpenShiva was NOT found.")
- endif ()
- if (OPENSHIVA_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find OpenShiva")
- endif ()
-endif ()
diff --git a/cmake/modules/FindQtShiva.cmake b/cmake/modules/FindQtShiva.cmake
deleted file mode 100644
index e48ac29..0000000
--- a/cmake/modules/FindQtShiva.cmake
+++ /dev/null
@@ -1,19 +0,0 @@
-
-INCLUDE(FindPkgConfig)
-
-pkg_check_modules(QTSHIVA QtShiva>=0.9.2)
-
-if (QTSHIVA_FOUND)
- message(STATUS "QtShiva >= 0.9.2 was found")
- set(HAVE_QTSHIVA TRUE)
- if (NOT QTSHIVA_FIND_QUIETLY)
- message(STATUS "Found QtShiva: ${QTSHIVA_LIBRARIES}")
- endif ()
-else ()
- if (NOT QtShiva_FIND_QUIETLY)
- message(STATUS "QtShiva was NOT found.")
- endif ()
- if (QtShiva_FIND_REQUIRED)
- message(FATAL_ERROR "Could NOT find QtShiva")
- endif ()
-endif ()
diff --git a/krita/CMakeLists.txt b/krita/CMakeLists.txt
index 59fe160..11e5d18 100644
--- a/krita/CMakeLists.txt
+++ b/krita/CMakeLists.txt
@@ -139,26 +139,6 @@ endif (Q_WS_MAC)
target_link_libraries(kdeinit_krita kritaui)
target_link_libraries(krita kdeinit_krita)
-if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- find_package(OpenCTL)
- find_package(OpenShiva)
- find_package(QtShiva )
-
- if(NOT ${OPENCTL_VERSION} VERSION_GREATER 0.9.15.1 )
- # Workaround for the following issues:
- # http://bugs.kde.org/274675 http://bugs.kde.org/248051
- # http://redmine.opengtl.org/issues/72
- message(status "Found OpenGTL < 0.9.15.1, on a 64 bits system, krita will be forced linked to the libraries to make sure opengtl symbols are available")
- if(HAVE_OPENSHIVA AND HAVE_QTSHIVA)
- target_link_libraries(krita ${OPENSHIVA_LDFLAGS})
- endif()
-
- if(OPENCTL_FOUND AND OPENEXR_FOUND)
- target_link_libraries(krita ${OPENCTL_LDFLAGS})
- endif()
- endif()
-endif()
-
install(TARGETS krita ${INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS kdeinit_krita ${INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS krita.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
diff --git a/krita/plugins/extensions/CMakeLists.txt b/krita/plugins/extensions/CMakeLists.txt
index 863ee09..7dbc0e1 100644
--- a/krita/plugins/extensions/CMakeLists.txt
+++ b/krita/plugins/extensions/CMakeLists.txt
@@ -18,13 +18,3 @@ if (NOT WIN32)
add_subdirectory( gmic )
endif (NOT WIN32)
-find_package(OpenShiva)
-find_package(QtShiva )
-
-if(HAVE_OPENSHIVA AND HAVE_QTSHIVA)
- add_subdirectory(shiva)
-endif(HAVE_OPENSHIVA AND HAVE_QTSHIVA)
-
-macro_log_feature(HAVE_OPENSHIVA "OpenShiva" "OpenShiva interpreter for the Shiva Kernel Language (part of OpenGTL)" "http://www.opengtl.org" FALSE "" "Required for Shiva based Generators and Filters")
-macro_log_feature(HAVE_QTSHIVA "QtShiva" "Qt bindings for the OpenShiva interpreter (part of libQtGTL)" "http://www.opengtl.org" FALSE "" "Required for Shiva based Generators and Filters")
-
diff --git a/krita/plugins/extensions/shiva/CMakeLists.txt b/krita/plugins/extensions/shiva/CMakeLists.txt
deleted file mode 100644
index 5be8b89..0000000
--- a/krita/plugins/extensions/shiva/CMakeLists.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-add_subdirectory(collections)
-
-include_directories(${OPENSHIVA_INCLUDE_DIRS})
-
-set(kritashivalib_SRCS
- ShivaGeneratorConfigWidget.cpp
- PaintDeviceImage.cpp
- QVariantValue.cpp
- UpdaterProgressReport.cpp
-)
-
-########### shiva filters ###############
-
-set(kritashivafilters_PART_SRCS
- shivafiltersplugin.cpp
- shivafilter.cpp
- ${kritashivalib_SRCS}
- )
-
-kde4_add_plugin(kritashivafilters ${kritashivafilters_PART_SRCS})
-
-target_link_libraries(kritashivafilters kritaimage ${OPENSHIVA_LDFLAGS} ${QTSHIVA_LDFLAGS})
-
-install(TARGETS kritashivafilters DESTINATION ${PLUGIN_INSTALL_DIR})
-
-########### shiva filters ###############
-
-set(kritashivagenerators_PART_SRCS
- shivageneratorsplugin.cpp
- shivagenerator.cpp
- ${kritashivalib_SRCS}
- )
-
-kde4_add_plugin(kritashivagenerators ${kritashivagenerators_PART_SRCS})
-
-target_link_libraries(kritashivagenerators kritaimage ${OPENSHIVA_LDFLAGS} ${QTSHIVA_LDFLAGS})
-
-install(TARGETS kritashivagenerators DESTINATION ${PLUGIN_INSTALL_DIR})
-
-
-########### install files ###############
-
-install( FILES kritashivafilters.desktop DESTINATION ${SERVICES_INSTALL_DIR})
-install( FILES kritashivagenerators.desktop DESTINATION ${SERVICES_INSTALL_DIR})
diff --git a/krita/plugins/extensions/shiva/PaintDeviceImage.cpp b/krita/plugins/extensions/shiva/PaintDeviceImage.cpp
deleted file mode 100644
index b80a05a..0000000
--- a/krita/plugins/extensions/shiva/PaintDeviceImage.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "PaintDeviceImage.h"
-
-#include <KoColorSpace.h>
-#include <KoColorModelStandardIds.h>
-
-#include <kis_paint_device.h>
-
-#include <GTLCore/PixelDescription.h>
-#include <GTLCore/Type.h>
-#include <GTLCore/Region.h>
-#include <KoColorSpaceTraits.h>
-#include <kis_random_accessor_ng.h>
-
-GTLCore::PixelDescription csToPD(const KoColorSpace* cs)
-{
- std::vector<const GTLCore::Type*> types;
- foreach(KoChannelInfo* channel, cs->channels()) {
- switch (channel->channelValueType()) {
- case KoChannelInfo::UINT8:
- types.push_back(GTLCore::Type::UnsignedInteger8);
- break;
- case KoChannelInfo::INT8:
- types.push_back(GTLCore::Type::Integer8);
- break;
- case KoChannelInfo::UINT16:
- types.push_back(GTLCore::Type::UnsignedInteger16);
- break;
- case KoChannelInfo::INT16:
- types.push_back(GTLCore::Type::Integer16);
- break;
- case KoChannelInfo::UINT32:
- types.push_back(GTLCore::Type::UnsignedInteger32);
- break;
- case KoChannelInfo::FLOAT16:
- types.push_back(GTLCore::Type::Float16);
- break;
- case KoChannelInfo::FLOAT32:
- types.push_back(GTLCore::Type::Float32);
- break;
- case KoChannelInfo::FLOAT64:
- types.push_back(GTLCore::Type::Float64);
- break;
- default:
- errKrita << "Channeltype OTHER encountered";
- }
-
- }
- GTLCore::PixelDescription pd(types);
- if(cs->colorModelId() == RGBAColorModelID )
- {
- std::vector< std::size_t > positions;
- positions.push_back(KoBgrU16Traits::red_pos);
- positions.push_back(KoBgrU16Traits::green_pos);
- positions.push_back(KoBgrU16Traits::blue_pos);
- positions.push_back(KoBgrU16Traits::alpha_pos);
- pd.setChannelPositions(positions);
- }
- return pd;
-}
-
-ConstPaintDeviceImage::ConstPaintDeviceImage(KisPaintDeviceSP device) : GTLCore::AbstractImage(csToPD(device->colorSpace())), m_device(device)
-{
- m_accessor = device->createRandomConstAccessorNG(0, 0);
-}
-
-ConstPaintDeviceImage::~ConstPaintDeviceImage()
-{
-}
-
-char* ConstPaintDeviceImage::data(int _x, int _y)
-{
- Q_UNUSED(_x);
- Q_UNUSED(_y);
- qFatal("Accessing non const data in a ConstPaintDevice");
- return 0;
-}
-
-char* ConstPaintDeviceImage::rawData( int _x, int _y )
-{
- Q_UNUSED(_x);
- Q_UNUSED(_y);
- qFatal("Accessing non const data in a ConstPaintDevice");
- return 0;
-}
-
-const char* ConstPaintDeviceImage::data(int _x, int _y) const
-{
- m_accessor->moveTo(_x, _y);
- return (const char*)(m_accessor->oldRawData());
-}
-
-const char* ConstPaintDeviceImage::rawData(int _x, int _y) const
-{
- m_accessor->moveTo(_x, _y);
- return (const char*)(m_accessor->oldRawData());
-}
-
-GTLCore::RegionI ConstPaintDeviceImage::boundingBox() const
-{
- return GTLCore::RegionI(0,0,-1,-1);
-}
-
-GTLCore::AbstractImage::ConstIterator* ConstPaintDeviceImage::createIterator() const
-{
- return 0;
-}
-
-GTLCore::AbstractImage::Iterator* ConstPaintDeviceImage::createIterator()
-{
- return 0;
-}
-
-PaintDeviceImage::PaintDeviceImage(KisPaintDeviceSP device) : GTLCore::AbstractImage(csToPD(device->colorSpace())), m_device(device)
-{
- m_accessor = device->createRandomAccessorNG(0, 0);
-}
-
-PaintDeviceImage::~PaintDeviceImage()
-{
-}
-
-char* PaintDeviceImage::data(int _x, int _y)
-{
- m_accessor->moveTo(_x, _y);
- return (char*)(m_accessor->rawData());
-}
-
-char* PaintDeviceImage::rawData(int _x, int _y)
-{
- m_accessor->moveTo(_x, _y);
- return (char*)(m_accessor->rawData());
-}
-
-const char* PaintDeviceImage::data(int _x, int _y) const
-{
- m_accessor->moveTo(_x, _y);
- return (const char*)(m_accessor->oldRawData());
-}
-
-const char* PaintDeviceImage::rawData(int _x, int _y) const
-{
- m_accessor->moveTo(_x, _y);
- return (const char*)(m_accessor->oldRawData());
-}
-
-GTLCore::RegionI PaintDeviceImage::boundingBox() const
-{
- return GTLCore::RegionI(0,0,-1,-1);
-}
-
-GTLCore::AbstractImage::ConstIterator* PaintDeviceImage::createIterator() const
-{
- return 0;
-}
-
-GTLCore::AbstractImage::Iterator* PaintDeviceImage::createIterator()
-{
- return 0;
-}
diff --git a/krita/plugins/extensions/shiva/PaintDeviceImage.h b/krita/plugins/extensions/shiva/PaintDeviceImage.h
deleted file mode 100644
index e738dca..0000000
--- a/krita/plugins/extensions/shiva/PaintDeviceImage.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _PAINT_DEVICE_IMAGE_H_
-#define _PAINT_DEVICE_IMAGE_H_
-
-#include <GTLCore/AbstractImage.h>
-#include <kis_types.h>
-
-class ConstPaintDeviceImage : public GTLCore::AbstractImage
-{
-public:
- ConstPaintDeviceImage(KisPaintDeviceSP);
- virtual ~ConstPaintDeviceImage();
- virtual char* data(int _x, int _y);
- virtual char* rawData( int _x, int _y );
- virtual const char* data(int _x, int _y) const ;
- virtual const char* rawData( int _x, int _y ) const;
- virtual GTLCore::RegionI boundingBox() const;
- virtual ConstIterator* createIterator() const;
- virtual Iterator* createIterator();
-private:
- KisPaintDeviceSP m_device;
- mutable KisRandomConstAccessorSP m_accessor;
-};
-
-class PaintDeviceImage : public GTLCore::AbstractImage
-{
-public:
- PaintDeviceImage(KisPaintDeviceSP);
- virtual ~PaintDeviceImage();
- virtual char* data(int _x, int _y);
- virtual char* rawData( int _x, int _y );
- virtual const char* data(int _x, int _y) const ;
- virtual const char* rawData( int _x, int _y ) const;
- virtual GTLCore::RegionI boundingBox() const;
- virtual ConstIterator* createIterator() const;
- virtual Iterator* createIterator();
-private:
- KisPaintDeviceSP m_device;
- mutable KisRandomAccessorSP m_accessor;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/QVariantValue.cpp b/krita/plugins/extensions/shiva/QVariantValue.cpp
deleted file mode 100644
index de6c1a9..0000000
--- a/krita/plugins/extensions/shiva/QVariantValue.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "QVariantValue.h"
-
-#include <QColor>
-#include <GTLCore/Type.h>
-#include <GTLCore/TypesManager.h>
-
-#include "kis_debug.h"
-
-#include <GTLCore/Color.h>
-
-QVariant valueToQVariant(const GTLCore::Value& value)
-{
- switch (value.type()->dataType()) {
- default:
- case GTLCore::Type::UNDEFINED:
- return QVariant();
- case GTLCore::Type::BOOLEAN:
- return QVariant(value.asBoolean());
- case GTLCore::Type::INTEGER8:
- case GTLCore::Type::INTEGER16:
- case GTLCore::Type::INTEGER32:
- return QVariant(value.asInt32());
- case GTLCore::Type::UNSIGNED_INTEGER8:
- case GTLCore::Type::UNSIGNED_INTEGER16:
- case GTLCore::Type::UNSIGNED_INTEGER32:
- return QVariant(value.asUnsignedInt32());
- case GTLCore::Type::FLOAT16:
- case GTLCore::Type::FLOAT32:
- case GTLCore::Type::FLOAT64:
- return QVariant(value.asFloat32());
- case GTLCore::Type::ARRAY:
- case GTLCore::Type::VECTOR: {
- QList<QVariant> variant;
- foreach(const GTLCore::Value& val, *value.asArray()) {
- variant.push_back(valueToQVariant(val));
- }
- return QVariant(variant);
- }
- case GTLCore::Type::STRUCTURE:
- if (value.type() == GTLCore::Type::Color )
- {
- GTLCore::Color c = value.asColor();
- return QVariant(QColor(c.red() * 255, c.green() * 255, c.blue() * 255, c.alpha() * 255) );
- }
- }
- errKrita << "Unsupported type:" << value.type();
- qFatal("exiting on fatal error");
- return QVariant();
-}
-
-GTLCore::Value qvariantToValue(const QVariant& variant, const GTLCore::Type* _type)
-{
- switch (_type->dataType()) {
- case GTLCore::Type::BOOLEAN:
- return GTLCore::Value(variant.toBool());
- case GTLCore::Type::FLOAT16:
- case GTLCore::Type::FLOAT32:
- case GTLCore::Type::FLOAT64:
- return GTLCore::Value((float)variant.toDouble());
- case GTLCore::Type::INTEGER8:
- case GTLCore::Type::INTEGER16:
- case GTLCore::Type::INTEGER32:
- return GTLCore::Value(variant.toInt());
- case GTLCore::Type::UNSIGNED_INTEGER8:
- case GTLCore::Type::UNSIGNED_INTEGER16:
- case GTLCore::Type::UNSIGNED_INTEGER32:
- return GTLCore::Value(variant.toUInt());
- case GTLCore::Type::ARRAY:
- case GTLCore::Type::VECTOR: {
- std::vector<GTLCore::Value> values;
- foreach(const QVariant& var, variant.toList()) {
- values.push_back(qvariantToValue(var, _type->embeddedType()));
- }
- if( _type->dataType() == GTLCore::Type::VECTOR && values.size() != _type->vectorSize() )
- {
- dbgPlugins << "Invalid numbers of element for a vector, got: " << values.size() << " but expected: " << _type->vectorSize();
- return GTLCore::Value();
- }
- return GTLCore::Value(values, _type);
- }
- case GTLCore::Type::STRUCTURE: {
- if (_type == GTLCore::Type::Color) {
- QColor c = variant.value<QColor>();
- dbgPlugins << c << variant;
- return GTLCore::Value(GTLCore::Color(c.red() / 255.0, c.green() / 255.0, c.blue() / 255.0, c.alpha() / 255.0));
- }
- }
- default:
- case GTLCore::Type::UNDEFINED: {
- qFatal("Unsupported type: %i", variant.type());
- return GTLCore::Value();
- }
- }
-}
diff --git a/krita/plugins/extensions/shiva/QVariantValue.h b/krita/plugins/extensions/shiva/QVariantValue.h
deleted file mode 100644
index ae9c1a8..0000000
--- a/krita/plugins/extensions/shiva/QVariantValue.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _QVARIANTVALUE_H_
-#define _QVARIANTVALUE_H_
-
-#include <QVariant>
-#include <GTLCore/Value.h>
-#include <GTLCore/Metadata/ParameterEntry.h>
-
-QVariant valueToQVariant(const GTLCore::Value& value);
-GTLCore::Value qvariantToValue(const QVariant& variant, const GTLCore::Type* widgetType);
-
-#endif
diff --git a/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.cpp b/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.cpp
deleted file mode 100644
index a0d36ce..0000000
--- a/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "ShivaGeneratorConfigWidget.h"
-
-#include <QGridLayout>
-#include <OpenShiva/Source.h>
-#include <GTLCore/String.h>
-
-#include "filter/kis_filter_configuration.h"
-#include "QVariantValue.h"
-
-#include <GTLFragment/Metadata.h>
-
-
-ShivaGeneratorConfigWidget::ShivaGeneratorConfigWidget(const OpenShiva::Source* _source, QWidget* parent) : KisConfigWidget(parent), m_source(_source), m_widget(new QtShiva::SourceParametersWidget(this))
-{
- m_widget->setSource(m_source);
- QGridLayout* gridLayout = new QGridLayout(this);
- gridLayout->addWidget(m_widget, 0, 0, 1, 1);
-}
-
-ShivaGeneratorConfigWidget::~ShivaGeneratorConfigWidget()
-{
-}
-
-void ShivaGeneratorConfigWidget::setConfiguration(const KisPropertiesConfiguration* config)
-{
- QMap<QString, QVariant> map = config->getProperties();
- for (QMap<QString, QVariant>::iterator it = map.begin(); it != map.end(); ++it) {
- const GTLCore::Metadata::Entry* entry = m_source->metadata()->parameter(it.key().toLatin1().constData());
- if (entry && entry->asParameterEntry()) {
- GTLCore::Value val = qvariantToValue(it.value(), entry->asParameterEntry()->type());
- if (val.isValid()) {
- m_widget->setParameter(it.key().toLatin1().constData(), val);
- }
- }
- }
-}
-
-KisPropertiesConfiguration* ShivaGeneratorConfigWidget::configuration() const
-{
- KisFilterConfiguration* config = new KisFilterConfiguration(m_source->name().c_str(), 1);
-
- for (std::map<GTLCore::String, GTLCore::Value>::const_iterator it = m_widget->parameters().begin();
- it != m_widget->parameters().end(); ++it) {
- config->setProperty(it->first.c_str(), valueToQVariant(it->second));
- }
- return config;
-}
-
diff --git a/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.h b/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.h
deleted file mode 100644
index f668a74..0000000
--- a/krita/plugins/extensions/shiva/ShivaGeneratorConfigWidget.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _SHIVA_GENERATOR_CONFIG_WIDGET_H_
-#define _SHIVA_GENERATOR_CONFIG_WIDGET_H_
-
-#include <kis_config_widget.h>
-#include <QtShiva/SourceParametersWidget.h>
-
-namespace OpenShiva
-{
-class Source;
-}
-
-class ShivaGeneratorConfigWidget : public KisConfigWidget
-{
-public:
- ShivaGeneratorConfigWidget(const OpenShiva::Source* _source, QWidget* parent = 0);
- ~ShivaGeneratorConfigWidget();
-
- virtual void setConfiguration(const KisPropertiesConfiguration*);
- virtual KisPropertiesConfiguration* configuration() const;
-private:
- const OpenShiva::Source* m_source;
- QtShiva::SourceParametersWidget* m_widget;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/UpdaterProgressReport.cpp b/krita/plugins/extensions/shiva/UpdaterProgressReport.cpp
deleted file mode 100644
index d5a4aa3..0000000
--- a/krita/plugins/extensions/shiva/UpdaterProgressReport.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "UpdaterProgressReport.h"
-#include <KoUpdater.h>
-
-UpdaterProgressReport::UpdaterProgressReport(KoUpdater* updater) : m_updater(updater), m_row(0)
-{
-
-}
-
-void UpdaterProgressReport::nextRow()
-{
- m_updater->setValue(++m_row);
-}
-
-void UpdaterProgressReport::nextPixel()
-{
-}
-
-bool UpdaterProgressReport::interrupted() const
-{
- return m_updater->interrupted();
-}
diff --git a/krita/plugins/extensions/shiva/UpdaterProgressReport.h b/krita/plugins/extensions/shiva/UpdaterProgressReport.h
deleted file mode 100644
index 7e16e5f..0000000
--- a/krita/plugins/extensions/shiva/UpdaterProgressReport.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _UPDATER_PROGRESS_REPORT_H_
-#define _UPDATER_PROGRESS_REPORT_H_
-
-#include <GTLCore/ProgressReport.h>
-
-class KoUpdater;
-
-class UpdaterProgressReport : public GTLCore::ProgressReport
-{
-public:
- UpdaterProgressReport(KoUpdater*);
- virtual void nextRow();
- virtual void nextPixel();
- virtual bool interrupted() const;
-private:
- KoUpdater* m_updater;
- int m_row;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/collections/CMakeLists.txt b/krita/plugins/extensions/shiva/collections/CMakeLists.txt
deleted file mode 100644
index 6360102..0000000
--- a/krita/plugins/extensions/shiva/collections/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-set(SHIVA_KERNELS_INSTALL_DIR ${DATA_INSTALL_DIR}/krita/)
-
-add_subdirectory(filters)
-add_subdirectory(generators)
diff --git a/krita/plugins/extensions/shiva/collections/filters/AntiBullify.shiva b/krita/plugins/extensions/shiva/collections/filters/AntiBullify.shiva
deleted file mode 100644
index db8c5e8..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/AntiBullify.shiva
+++ /dev/null
@@ -1,33 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- lightLengthP: <
- label: "Zoom";
- type: float;
- minValue: 0.01;
- >;
- >;
->;
-kernel AntiBullify
-{
- dependent float2 center = { xcenter * IMAGE_WIDTH, ycenter * IMAGE_HEIGHT };
- dependent float lightLength = lightLengthP * 0.5 * (IMAGE_WIDTH + IMAGE_HEIGHT );
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float factor = length( vec ) / lightLength;
- factor = 1.0 / (factor * factor);
- result = img.sampleNearest( vec * factor + center );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Bullify.shiva b/krita/plugins/extensions/shiva/collections/filters/Bullify.shiva
deleted file mode 100644
index 79a8ab1..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Bullify.shiva
+++ /dev/null
@@ -1,34 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- lightLengthP: <
- label: "Zoom";
- type: float;
- minValue: 0.01;
- >;
- >;
->;
-kernel Bullify
-{
- dependent float2 center = { xcenter * IMAGE_WIDTH, ycenter * IMAGE_HEIGHT };
- dependent float lightLength = lightLengthP * 0.5 * (IMAGE_WIDTH + IMAGE_HEIGHT );
-
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float factor = length( vec ) / lightLength;
- factor *= factor;
- result = img.sampleNearest( vec * factor + center );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/CMakeLists.txt b/krita/plugins/extensions/shiva/collections/filters/CMakeLists.txt
deleted file mode 100644
index 92ee80c..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-file(GLOB _kernels *.shiva)
-install(FILES ${_kernels} DESTINATION ${SHIVA_KERNELS_INSTALL_DIR}/shiva/kernels )
diff --git a/krita/plugins/extensions/shiva/collections/filters/Caleidoscope.shiva b/krita/plugins/extensions/shiva/collections/filters/Caleidoscope.shiva
deleted file mode 100644
index ff4755e..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Caleidoscope.shiva
+++ /dev/null
@@ -1,48 +0,0 @@
-<
- parameters: <
- count: <
- label: "Count";
- type: int;
- minValue:1;
- maxValue:20;
- defaultValue:5;
- >;
- direction: <
- label: "Direction";
- type: float;
- minValue:0.0;
- maxValue:6.28;
- defaultValue:0.0.;
- >;
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- >;
->;
-kernel Caleidoscope
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- const float pi = 3.14159265358979323846;
- dependent float angle = pi / count;
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float vec_length = length( vec );
- float vec_angle = atan2(vec.y, vec.x) - direction;
- while( vec_angle < 0 ) { vec_angle = 6.28 + vec_angle; }
- float angle2 = mod(vec_angle, angle);
- float section = floor(vec_angle/angle);
- if (mod(section,2.0)>0.5) angle2 = angle-angle2;
-
- result = img.sampleNearest(center+ vec_length * float2(cos(angle2 += direction), sin(angle2)));
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/CentralAbsorbtion.shiva b/krita/plugins/extensions/shiva/collections/filters/CentralAbsorbtion.shiva
deleted file mode 100644
index e094de9..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/CentralAbsorbtion.shiva
+++ /dev/null
@@ -1,30 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- strength: <
- label: "Strength";
- type: float;
- defaultValue: 10.0;
- maxValue: 1000.0;
- >;
- >;
->;
-kernel CentralAbsorbtion
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- dependent float max = (IMAGE_WIDTH + IMAGE_HEIGHT) * 0.5;
- void evaluatePixel(input image img, output pixel result)
- {
- float2 vec = result.coord - center;
- vec /= length(vec);
- float2 ortho; ortho.x = vec.y; ortho.y = -vec.x;
- result = img.sampleNearest( result.coord + ortho * strength );
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Contraction.shiva b/krita/plugins/extensions/shiva/collections/filters/Contraction.shiva
deleted file mode 100644
index 64daa65..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Contraction.shiva
+++ /dev/null
@@ -1,22 +0,0 @@
-kernel Contraction
-{
- void evaluatePixel(image img, out pixel result)
- {
- pixel inp = img.sampleNearest( result.coord);
- result = inp;
- if( inp.opacity() > 0.0)
- {
- float minAlpha = 1.0;
- for(int y = -1; y <= 1; ++y)
- {
- for(int x= -1; x <= 1; ++x)
- {
- pixel s = img.sampleNearest(result.coord+float2(x,y));
- minAlpha = min(minAlpha, s.opacity());
- }
- }
- result.setOpacity(minAlpha);
- }
- }
-
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Droste.shiva b/krita/plugins/extensions/shiva/collections/filters/Droste.shiva
deleted file mode 100644
index 1f3d324..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Droste.shiva
+++ /dev/null
@@ -1,463 +0,0 @@
-<
- parameters: <
- Spiral: <
- innerRadius:
- <
- type: float;
- minValue:0.000001;
- maxValue:1.0;
- defaultValue:0.25;
- description: "The inner radius of the repeating annular";
- >;
-
- outerRadius:
- <
- type: float;
- minValue:0.000001;
- maxValue:1.0;
- defaultValue:1.0;
- description: "The outer radius of the repeating annular";
- >;
-
- periodicity:
- <
- type: float;
- minValue:-6.0;
- maxValue: 6.0;
- defaultValue:1.0;
- description: "The number of image the image is repeated on each level";
- >;
-
- strands:
- <
- type: float;
- minValue:-6.0;
- maxValue: 6.0;
- defaultValue:1.0;
- description: "The number of strands of the spiral";
- >;
-
- strandMirror:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Activate for smoother repeating when using more than one strand";
- >;
- >;
-
- Position: <
- zoom:
- <
- type: float;
- minValue:0.0;
- maxValue:30.0;
- defaultValue:0.0;
- description: "Overall image magnification";
- >;
-
- rotate: <
- type: float;
- minValue: -360.0;
- maxValue: 360.0;
- defaultValue: 0.0;
- description: "Overall image rotation";
- >;
- xcenter: <
- label: "Input Panning x";
- type: float;
- minValue:-1.0;
- defaultValue: 0.5;
- maxValue:1.0;
- >;
- ycenter: <
- label: "Input Panning y";
- type: float;
- minValue:-1.0;
- defaultValue: 0.5;
- maxValue:1.0;
- >;
- xcenterShift: <
- label: "Spiral Center x";
- type: float;
- minValue:-1.0;
- maxValue:1.0;
- defaultValue:0.0;
- >;
- ycenterShift: <
- label: "Spiral Center y";
- type: float;
- minValue:-1.0;
- maxValue:1.0;
- defaultValue:0.0;
- >;
- >;
- levels: <
- numberOfLevels:
- <
- type: int;
- minValue:1;
- maxValue:20;
- defaultValue:9;
- description: "The number of repeating levels of the spiral";
- >;
-
- startLevel:
- <
- type: int;
- minValue:1;
- maxValue:20;
- defaultValue:3;
- description: "The starting spiral level";
- >;
- >;
-
- enableTransparencyInside:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Enable for images with transparent middle areas (such as a picture frame).";
- >;
-
- enableTransparencyOutside:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Enable for images with transparent areas around the outside.";
- >;
-
- untwist:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Unroll the circular annular of the image.";
- >;
-
- setAutoPeriodicity:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Automatically set the ideal periodicity for the current radius settings.";
- >;
-
- enablePoles:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Show both poles";
- >;
-
- enableHyperDroste:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Enable hyper droste effect. Applies when enablePoles active.";
- >;
-
- tilePoles:
- <
- type: int;
- minValue:0;
- maxValue:1;
- defaultValue:0;
- description: "Enable for hyper droste option.";
- >;
-
- fractalPoints: <
- type: int;
- minValue:1;
- maxValue:10;
- defaultValue:1;
- description: "Used by hyper droste option.";
- >;
- >;
->;
-
-// float3 polarCoordinates
-// <
-// minValue: float3(-180, -100, -100);
-// maxValue: float3(180, 100, 100);
-// defaultValue: float3(90, 0, 0);
-// description: "Polar rotation, latitude and longitude";
-// >;
-
-kernel Droste
-{
- const float2 I = { 0.0, 1.0};
- const float3 polarCoordinates = { 90, 0, 0 };
- dependent float2 center = { xcenter * 1.0, ycenter * 1.0 };
- dependent float2 centerShift = { xcenterShift + 1.0, ycenterShift + 1.0 };
- dependent float r1, r2, p1, p2, alphaThreshold;
- dependent float2 _rotate, xBounds, yBounds, xyMiddle, minDimension, _zoom;
- dependent bool showPoles, hyperDroste, tileBasedOnTransparency, transparentPointsIn, twist;
-
- float2 complexMult(float2 a, float2 b)
- {
- return float2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x);
- }
- float complexMag( float2 z)
- {
- z *= z;
- return z[0] + z[1];
- }
- float2 complexReciprocal(float2 z)
- {
- return float2(z.x / complexMag(z), -z.y / complexMag(z));
- }
- float2 complexDivision(float2 a, float2 b)
- {
- return complexMult(a, complexReciprocal(b));
- }
- float complexArg(float2 z)
- {
- return atan2(z.y, z.x);
- }
- float2 complexLog(float2 z)
- {
- return float2(log(length(z)), complexArg(z));
- }
- float2 complexExp(float2 z)
- {
- return float2(exp(z.x) * cos(z.y), exp(z.x) * sin(z.y));
- }
- float sinh(float x)
- {
- return (exp(x) - exp(-x)) / 2.0;
- }
- float cosh(float x)
- {
- return (exp(x) + exp(-x)) / 2.0;
- }
- float2 complexSin(float2 z)
- {
- return float2(sin(z.x) * cosh(z.y), cos(z.x) * sinh(z.y));
- }
- float2 complexCos(float2 z)
- {
- return float2(cos(z.x) * cosh(z.y), -sin(z.x) * sinh(z.y));
- }
- float2 complexTan(float2 z)
- {
- return float2(sin(2.0 * z.x)/(cos(2.0 * z.x) + cosh(2.0 * z.y)), sinh(2.0 * z.y)/(cos(2.0 * z.x) + cosh(2.0 * z.y)));
- }
- float2 complexSinh(float2 z)
- {
- return float2(sinh(z.x) * cos(z.y), cosh(z.x) * sin(z.y));
- }
- float2 complexCosh(float2 z)
- {
- return float2(cosh(z.x) * cos(z.y), sinh(z.x) * sin(z.y));
- }
- float2 complexTanh(float2 z)
- {
- return float2(sinh(2.0 * z.x)/(cosh(2.0 * z.a) + cos(2.0 * z.y)), sin(2.0 * z.y)/(cosh(2.0 * z.x) + cos(2.0 * z.y)));
- }
- float2 polar(float r, float a)
- {
- return float2(cos(a) * r, sin(a) * r);
- }
- float2 power(float2 z, float p)
- {
- return polar(pow(length(z), float(p)), float(p) * complexArg(z));
- }
-
- void evaluateDependents()
- {
- // Set code variables
- r1 = innerRadius;
- r2 = outerRadius;
- p1 = periodicity;
- if (p1 == 0.0) p1 = 0.001; // Prevent divide by zero
- p2 = strands;
- transparentPointsIn = ( enableTransparencyOutside == 0 );
- tileBasedOnTransparency = (enableTransparencyInside == 1 or not transparentPointsIn);
- twist = (untwist == 0);
- alphaThreshold = 0.01;
-
- float mdF = min(IMAGE_WIDTH, IMAGE_HEIGHT) / 2.0;
- minDimension = float2(mdF, mdF);
-
- // Autoset periodicity
- if (setAutoPeriodicity == 1) {
- p1 = p2/2.0 * (1.0 + sqrt(1.0 - pow(log(r2/r1)/PI, 2.0)));
- }
-
- // Set rotation
- _rotate = float2((PI/180.0) * rotate, 0.0);
- // Set zoom
- _zoom = float2(exp(zoom) + innerRadius - 1.0, 0.0);
-
- // Scale viewport pixels to complex plane
- if (twist) {
- xBounds = float2(-r2, r2);
- yBounds = float2(-r2, r2);
- } else {
- xBounds = float2(-log(r2/r1), log(r2/r1));
- yBounds = float2(0.0, 2.1 * PI);
- }
-
- xyMiddle = float2(0.5 * (xBounds.x + xBounds.y), 0.5 * (yBounds.x + yBounds.y) );
- float2 xyRange = float2(xBounds.y - xBounds.x, yBounds.y - yBounds.x);
- xyRange.x = xyRange.y * (IMAGE_WIDTH / IMAGE_HEIGHT);
- xBounds = float2(xyMiddle.x - 0.5 * xyRange.x, xyMiddle.x + 0.5 * xyRange.x);
-
- // Polar options
- showPoles = (enablePoles == 1);
- hyperDroste = (enableHyperDroste == 1);
-
- }
- void evaluatePixel(image img, out pixel result)
- {
- float2 s = result.coord;
- float2 z; float2 ratio; float2 polar;
- float radius; float theta; float div;
- int iteration;
-
- float2 sbis = s / IMAGE_SIZE - center + 0.5;
- z = float2(( xBounds.x + (xBounds.y - xBounds.x) * sbis.x),
- ( yBounds.x + (yBounds.y - yBounds.x) * sbis.y));
- // Only allow for procedural zooming/scaling in the standard coordinates
- if (twist) {
- z = xyMiddle + complexMult( complexDivision((z - xyMiddle), _zoom), complexExp(complexMult(-I, _rotate)));
- }
-
- // Extra options
-
- polar = (float2(polarCoordinates.y, polarCoordinates.z) * IMAGE_WIDTH / s.x) / 100.0;
-
- if (showPoles) {
- theta = (PI/180.0) * polarCoordinates.x;
-
- div = (1.0 + pow(z.x, 2.0) + pow(z.y, 2.0) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * cos(theta)) - (2.0 * z.x * sin(theta))) / 2.0;
- z.x = z.x * cos(theta) + ((1.0 - pow(z.x, 2.0) - pow(z.y, 2.0)) * sin(theta) / 2.0);
- z = complexDivision(z, float2(div, 0.0));
- } else {
- if (hyperDroste) {
- z = complexSin(z);
- }
-
- if (tilePoles == 1) {
- z = power(z, fractalPoints);
- z = complexTan(complexMult(z, float2(2.0, 0.0)));
- }
- }
-
- z += polar;
- if (twist) {
- z = complexLog(complexDivision(z, float2(r1, 0.0)));
- }
-
- // Start Droste-effect code
- float2 alpha = float2(atan((p2/p1) * (log(r2/r1) / (2.0*PI))), 0.0);
- float2 f = float2(cos(alpha.x), 0.0);
- float2 beta = complexMult(f, complexExp(complexMult(alpha, I)));
-
- //The angle of rotation between adjacent annular levels
- float2 angle = float2(-2.0 * PI * p1, 0.0);
-
- if (p2 > 0.0) angle = -angle;
- if (strandMirror == 1) angle /= strands;
-
- z = complexDivision(complexMult(float2(p1,0), z), beta);
- z = complexMult(float2(r1,0), complexExp(z));
- // End Droste-effect code
-
- if (tileBasedOnTransparency && startLevel > 0) {
- if (!transparentPointsIn) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
- if ( transparentPointsIn) ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle,-I)));
- z = complexMult(z, power(ratio, startLevel));
- }
-
- // When tiling based on transparency, color is accumulated into the colorSoFar variable,
- // while alphaRemaining tells how much remains for lower layers to contribute (initially 1,
- // finally 0).
- float alphaRemaining = 1.0;
- float2 d = (z + centerShift) * minDimension ;
- pixel src = img.sampleNearest(d);
- float alphasrc = src.opacity();
- float4 colorSoFar = (src * (alphasrc * alphaRemaining));
- alphaRemaining *= (1.0 - alphasrc);
-
- // do we need to look inward from the current point, or outward?
- int sign = 0;
-
- if(tileBasedOnTransparency)
- {
- if(alphaRemaining > alphaThreshold)
- {
- if ( transparentPointsIn ) {
- sign=-1;
- } else {
- sign= 1;
- }
- }
- } else {
- radius = length( z );
- if (radius < r1) {
- sign = -1;
- } else if (radius > r2) {
- sign= 1;
- }
- }
- ratio = 1.0;
- if (sign < 0) ratio = complexMult(float2(r2/r1, 0.0), complexExp(complexMult(angle, I)));
- else ratio = complexMult(float2(r1/r2, 0.0), complexExp(complexMult(angle, -I)));
-
- iteration = startLevel;
- int maxIteration = numberOfLevels + startLevel - 1;
-
- // Iteratively move inward or outward, until
- // the point has radius r in [r1, r2), if tileBasedOnTransparency=false
- // or until alphaRemaining=0, if tileBasedOnTransparency=true
- // In the latter case, we accumulate color at each step
-
- while (sign != 0 && iteration < maxIteration) {
- z = complexMult(z, ratio);
- float2 d = (z + centerShift) * minDimension ;
- pixel src = img.sampleNearest(d);
- float alphasrc = src.opacity();
- colorSoFar += (src * (alphasrc * alphaRemaining));
- alphaRemaining *= ( 1 - alphasrc );
- radius = length( z );
- sign=0;
- if(tileBasedOnTransparency )
- {
- if(alphaRemaining > alphaThreshold)
- {
- if ( transparentPointsIn ) {
- sign=-1;
- } else {
- sign= 1;
- }
- }
- } else {
- radius = length( z );
- if (radius < r1) {
- sign = -1;
- } else if (radius > r2) {
- sign= 1;
- }
- }
- ++iteration;
- }
-
- result = colorSoFar;
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Expansion.shiva b/krita/plugins/extensions/shiva/collections/filters/Expansion.shiva
deleted file mode 100644
index e8a3fa8..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Expansion.shiva
+++ /dev/null
@@ -1,30 +0,0 @@
-kernel Expansion
-{
- void evaluatePixel(image img, out pixel result)
- {
- pixel inp = img.sampleNearest( result.coord);
- if( inp.opacity() < 1.0)
- {
- floatn res = 0;
- float weight = 0.0;
- for(int y = -1; y <= 1; ++y)
- {
- for(int x= -1; x <= 1; ++x)
- {
- pixel s = img.sampleNearest(result.coord+float2(x,y));
- weight += s.opacity();
- res += s.opacity() * s;
- }
- }
- if (weight > 0.0) {
- result = res * (1.0 - inp.opacity()) / weight + inp;
-// result = res / weight;
- } else {
- result = res;
- }
- } else {
- result = inp;
- }
- }
-
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Hypno.shiva b/krita/plugins/extensions/shiva/collections/filters/Hypno.shiva
deleted file mode 100644
index bf59779..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Hypno.shiva
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Hypno
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- // This is where the magic happens
-
- u += cos(a)/r;
- v += sin(a)/r;
- w += 1.0/pow(r,0.1);
-
- // End of the magic
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
\ No newline at end of file
diff --git a/krita/plugins/extensions/shiva/collections/filters/LensCorrection.shiva b/krita/plugins/extensions/shiva/collections/filters/LensCorrection.shiva
deleted file mode 100644
index 4fcdd24..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/LensCorrection.shiva
+++ /dev/null
@@ -1,58 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- correctionnearcenter: <
- label: "Correction near center";
- type: float;
- defaultValue: 0.0;
- maxValue: 100.0;
- >;
- correctionnearedges: <
- label: "Correction near edges";
- type: float;
- defaultValue: 0.0;
- maxValue: 100.0;
- >;
- brightness: <
- label: "Brightness";
- type: float;
- defaultValue: 0.0;
- maxValue: 100.0;
- >;
- >;
->;
-kernel LensCorrection
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- dependent float max = (IMAGE_WIDTH + IMAGE_HEIGHT) * 0.5;
- dependent float mult_sq;
- dependent float mult_qd;
- dependent float normallise_radius_sq;
- void evaluateDependents()
- {
- mult_sq = correctionnearcenter / 200.0;
- mult_qd = correctionnearedges / 200.0;
- normallise_radius_sq = 4.0 / ( IMAGE_WIDTH * IMAGE_WIDTH + IMAGE_HEIGHT * IMAGE_HEIGHT );
- }
- void evaluatePixel(input image img, output pixel result)
- {
- float2 vec = result.coord - center;
- float radius = (vec.x * vec.x + vec.y * vec.y) * normallise_radius_sq;
- radius = radius * mult_sq + radius * radius * mult_qd;
- float mag = radius;
- radius += 1.0;
-
- float2 src = center + radius * vec;
-
- float brighten = 1.0 + mag * brightness;
-
- result = brighten * img.sampleNearest( src );
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/MirrorImpose.shiva b/krita/plugins/extensions/shiva/collections/filters/MirrorImpose.shiva
deleted file mode 100644
index 49a05ed..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/MirrorImpose.shiva
+++ /dev/null
@@ -1,23 +0,0 @@
-kernel MirrorImpose
-{
- dependent float2 imsize = { IMAGE_WIDTH, IMAGE_HEIGHT };
- float4 mix(float4 a, float4 b, float c)
- {
- return a * c + b * (1 - c);
- }
- void evaluatePixel(image img, out pixel result)
- {
- float ax = result.coord.x / IMAGE_WIDTH;
- float ay = result.coord.y / IMAGE_HEIGHT;
- float x1 = max(0, ax - ay);
- float y1 = max(0, ay - ax);
- float x2 = min(1, ax + (1 - ay));
- float y2 = min(1, ay + (1 - ax));
- float weight = clamp((ax - x1) / (x2 - x1), 0, 1);
- result = mix(img.sampleNearest( result.coord ), img.sampleNearest( imsize - result.coord ), weight);
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Mosaic.shiva b/krita/plugins/extensions/shiva/collections/filters/Mosaic.shiva
deleted file mode 100644
index e4a6526..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Mosaic.shiva
+++ /dev/null
@@ -1,27 +0,0 @@
-<
- parameters: <
- cellsize: <
- label: "Size";
- type: float;
- minValue: 0.0001;
- maxValue: 100.0;
- defaultValue: 100;
- >;
- >;
->;
-kernel Mosaic
-{
- float2 fmod2( float2 f, float v )
- {
- return float2( mod(f.x,v), mod(f.y,v) );
- }
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = fmod2( result.coord, cellsize) / cellsize * IMAGE_SIZE;
- result = img.sampleNearest( vec );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Planes.shiva b/krita/plugins/extensions/shiva/collections/filters/Planes.shiva
deleted file mode 100644
index ca73aa2..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Planes.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Planes
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += 0.2/abs(pos.y);
- v += 0.2*pos.x/abs(pos.y);
- w += abs(pos.y * 2.0);
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Ray.shiva b/krita/plugins/extensions/shiva/collections/filters/Ray.shiva
deleted file mode 100644
index 8855783..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Ray.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Ray
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += r;
- v += r;
- w += 0.2 + 0.8*(1.2+ 0.6*sin(13.0*a))/r;
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Ray2.shiva b/krita/plugins/extensions/shiva/collections/filters/Ray2.shiva
deleted file mode 100644
index 22ff5fd..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Ray2.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Ray
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += a;
- v += a;
- w += 1.0/pow(r,0.5);
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Ripples.shiva b/krita/plugins/extensions/shiva/collections/filters/Ripples.shiva
deleted file mode 100644
index e6ae652..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Ripples.shiva
+++ /dev/null
@@ -1,35 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- ripplesLength: <
- label: "Ripples length";
- type: float;
- minValue: 0.01;
- maxValue: 1000.0;
- >;
- >;
->;
-kernel Ripples
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- const float waveslengthInv = 1.0 / 50.0;
-
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float vec_length = length( vec );
- float displacement = cos( vec_length * waveslengthInv ) * ripplesLength / vec_length;
- result = img.sampleNearest( vec * ( 1.0 + displacement ) + center );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/RotativeBlur.shiva b/krita/plugins/extensions/shiva/collections/filters/RotativeBlur.shiva
deleted file mode 100644
index 80f06c5..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/RotativeBlur.shiva
+++ /dev/null
@@ -1,44 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- maxlength: <
- label: "Maximum length";
- type: float;
- defaultValue: 10.0;
- maxValue: 1000.0;
- >;
- >;
->;
-kernel RotativeBlur
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- dependent float max = (IMAGE_WIDTH + IMAGE_HEIGHT) * 0.25;
- void evaluatePixel(input image img, output pixel result)
- {
- float2 vec = result.coord - center;
- float l = length(vec);
- vec /= l;
- float2 ortho; ortho.x = vec.y; ortho.y = -vec.x;
- result.data = 0.0;
- float d = maxlength * l / max;
- float p = 0;
- int count = 0;
- while( p < d )
- {
- result.data += img.sampleNearest( result.coord + p * ortho );
- count += 1;
- p += 1.0;
- }
- if(count > 0)
- {
- result.data /= count;
- }
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Roundify.shiva b/krita/plugins/extensions/shiva/collections/filters/Roundify.shiva
deleted file mode 100644
index cc11c9d..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Roundify.shiva
+++ /dev/null
@@ -1,47 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- rho: <
- label: "Rho";
- type: double;
- minValue: 0;
- defaultValue: 10;
- maxValue: 64;
- >;
- theta: <
- label: "Theta";
- type: float;
- minValue: 0;
- defaultValue: 10;
- maxValue: 64;
- >;
- >;
->;
-kernel Roundify
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float vec_length = length( vec );
- float angle = atan2(vec.y, vec.x);
-
- float mvt = vec_length * rho + abs(angle) * theta;
- float2 displacement;
- displacement[0] = mvt;
- displacement[1] = mvt;
-
- result = img.sampleNearest( result.coord + displacement );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Sea.shiva b/krita/plugins/extensions/shiva/collections/filters/Sea.shiva
deleted file mode 100644
index 3268491..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Sea.shiva
+++ /dev/null
@@ -1,45 +0,0 @@
-<
- parameters: <
- t: <
- label: "Time";
- type: float;
- >;
- amp1: <
- label: "Horizontal amplitude";
- type: float;
- minValue: 0;
- maxValue: 100;
- defaultValue: 5;
- >;
- amp2: <
- label: "Vertical amplitude";
- type: float;
- minValue: 0;
- maxValue: 100;
- defaultValue: 10;
- >;
- wv: <
- label: "Wave length";
- type: float;
- minValue: 0;
- maxValue: 100;
- defaultValue: 10;
- >;
- >;
->;
-kernel Sea
-{
- dependent float2 center = { IMAGE_WIDTH * 0.5, IMAGE_HEIGHT * 0.5 };
- const float PI2 = 2 * PI;
- dependent float q = t * PI2;
- void evaluatePixel(image img, out pixel result)
- {
- float s = sin(q + wv * IMAGE_HEIGHT / ( IMAGE_HEIGHT - result.coord.y + 0.1) );
- float2 displacement = float2( s * amp1, s * amp2);
- result = img.sampleNearest( result.coord + displacement );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Seamlesser.shiva b/krita/plugins/extensions/shiva/collections/filters/Seamlesser.shiva
deleted file mode 100644
index 16be0d3..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Seamlesser.shiva
+++ /dev/null
@@ -1,51 +0,0 @@
-<
- parameters: <
- cellWidth: <
- label: "Cell width";
- type: int;
- minValue: 1;
- maxValue: 50;
- defaultValue: 10;
- >;
- cellHeight: <
- label: "Cell height";
- type: int;
- minValue: 1;
- maxValue: 50;
- defaultValue: 10;
- >;
- >;
->;
-kernel Seamlesser
-{
- float4 mix(float4 a, float4 b, float c)
- {
- return a * c + b * (1 - c);
- }
- float max(float a, float b)
- {
- if( a < b) return b;
- return a;
- }
- float clamp(float a, float min, float max)
- {
- if( a < min ) return min;
- if( a > max ) return max;
- return a;
- }
- void evaluatePixel(image img, out pixel result)
- {
- float ax = result.coord.x / IMAGE_WIDTH;
- float ay = result.coord.y / IMAGE_HEIGHT;
- float x1 = max(0, ax - ay);
- float y1 = max(0, ay - ax);
- float x2 = min(1, ax + (1 - ay));
- float y2 = min(1, ay + (1 - ax));
- float weight = 0.5; //clamp(1 - (ax - x1) / (x2 - x1), 0, 1);
- result = mix(img.sampleNearest( result.coord ), img.sampleNearest( IMAGE_SIZE - result.coord ), weight);
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Sectorize.shiva b/krita/plugins/extensions/shiva/collections/filters/Sectorize.shiva
deleted file mode 100644
index fd43a0b..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Sectorize.shiva
+++ /dev/null
@@ -1,48 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- rho: <
- label: "Rho";
- type: int;
- minValue: 0;
- defaultValue: 10;
- maxValue: 64;
- >;
- theta: <
- label: "Theta";
- type: int;
- minValue: 0;
- defaultValue: 10;
- maxValue: 64;
- >;
- >;
->;
-kernel Sectorize
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- int vec_length = length( vec );
- int angle = atan2(vec.y, vec.x) * 512 / 3.14;
- if(angle < 0 ) angle = -angle;
-
- float mvt = vec_length % rho + angle % theta;
- float2 displacement;
- displacement[0] = mvt;
- displacement[1] = mvt;
-
- result = img.sampleNearest( result.coord + displacement );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Slices.shiva b/krita/plugins/extensions/shiva/collections/filters/Slices.shiva
deleted file mode 100644
index 4f570b3..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Slices.shiva
+++ /dev/null
@@ -1,34 +0,0 @@
-<
- parameters: <
- sliceWidth: <
- label: "Slice width";
- type: int;
- minValue: 1;
- defaultValue: 10;
- maxValue: 100;
- >;
- sliceHeight: <
- label: "Slice height";
- type: int;
- minValue: 1;
- defaultValue: 10;
- maxValue: 100;
- >;
- >;
->;
-kernel Slices
-{
- void evaluatePixel(image img, out pixel result)
- {
- float x = result.coord.x;
- float y = result.coord.y;
- float2 displacement;
- displacement[0] = 5 * sign( cos( y / sliceWidth ) );
- displacement[1] = 5 * sign( sin( x / sliceHeight ) );
- result = img.sampleNearest( result.coord + displacement );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Sphere.shiva b/krita/plugins/extensions/shiva/collections/filters/Sphere.shiva
deleted file mode 100644
index f618f4a..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Sphere.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Sphere
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += pos.x*(3.0-sqrt(4.0-5.0*r*r))/(r*r+1.0);
- v += pos.y*(3.0-sqrt(4.0-5.0*r*r))/(r*r+1.0);
- w += 1.7*(pos.x+pos.y+r*r-(pos.x+pos.y-1.0)*sqrt(4.0-5.0*r*r)/3.0)/(r*r+1.0);
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Star.shiva b/krita/plugins/extensions/shiva/collections/filters/Star.shiva
deleted file mode 100644
index c105613..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Star.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Tunnel2
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += 7.0*a/pi;
- v += sin(7.0*r) + 0.7*cos(11.0*a);
- w += 0.7+0.7*(sin(7.0*r)+ 0.7*cos(11.0*a));
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/StereographicProjection.shiva b/krita/plugins/extensions/shiva/collections/filters/StereographicProjection.shiva
deleted file mode 100644
index 6ccdc74..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/StereographicProjection.shiva
+++ /dev/null
@@ -1,115 +0,0 @@
-// Inspired from http://www.gimptalk.com/forum/topic/Mathmap-Codes-17481-2.html
-<
- parameters: <
- xcenter: <
- label: "X center";
- type: float;
- minValue: 0;
- maxValue: 1;
- defaultValue: 0.5;
- >;
- ycenter: <
- label: "Y center";
- type: float;
- minValue: 0;
- maxValue: 1;
- defaultValue: 0.5;
- >;
- zoom: <
- label: "Zoom";
- type: float;
- minValue: 0;
- maxValue: 5;
- defaultValue: 1;
- >;
- scale: <
- label: "Scale";
- type: float;
- minValue: 0;
- maxValue: 5;
- defaultValue: 1;
- >;
- radius: <
- label: "Radius";
- type: float;
- minValue: 0;
- maxValue: 100;
- defaultValue: 70;
- >;
- turn: <
- label: "Turn";
- type: float;
- minValue: 0;
- maxValue: 1;
- defaultValue: 1;
- >;
- warp: <
- label: "Warp";
- type: float;
- minValue: 0;
- maxValue: 3.14159265;
- defaultValue: 2.3;
- >;
- background: <
- label: "Background";
- type: color;
- defaultValue: {0.5,0.5,0.5,1.0};
- >;
- >;
->;
-kernel StereographicProjection
-{
- dependent float2 center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- dependent float2 xy0 = { center.x - IMAGE_WIDTH, -center.y + IMAGE_HEIGHT };
- dependent float2 xy_replication = {IMAGE_WIDTH * 0.5, IMAGE_HEIGHT * 0.5};
- const float PI2 = 2 * PI;
- void evaluatePixel(image img, out pixel result)
- {
-// filter StereoNdeG (image in, float turn: 0-1 (0.00), float zoom: 0-5
-// (1.00), float sc: 0-4 (1), float warp: 0-3.141592, color back)
-//
-// // // zeta=-sin(warp)*1+cos(warp);
-// // // rho=sc*r;
-// // radius=Y*zoom;
-// // if r>radius then
-// // back;
-// // else
-// // maxpi=2*atan(sc);
-// // colat=2*atan(rho/radius);
-// // long=(a+2*pi*turn)%(2*pi);
-// ny=((Y)*(2*colat/maxpi)-(Y));
-// nx=(X-1)*long/pi-X;
-// in(xy:[nx,ny*zeta]);
-// end
-// end
- // Comput polar coordinate
- float2 pos = result.coord - center;
- float r = length( pos );
- float theta = atan2( pos.y, pos.x );
- // Compute radius
- float radius = xy_replication.y * zoom;
- float zeta = -sin( warp ) + cos( warp );
- if( r > radius / abs(zeta) )
-// if( r > 0.5 * radius )
- {
- result = background;
- } else {
- // Spectral radius
- float rho = scale * r;
- // Damping
- float maxpi = 2.0 * atan( float(scale) );
- float colat = 2.0 * atan( rho / radius );
- float meridian = mod(theta + PI2 * turn, PI2);
- // Adjust coordinates
- float ny = ( xy_replication.y ) * ( 2.0 * colat / maxpi ) - ( xy_replication.y );
- float nx = ( xy_replication.x - 1.0 )* meridian / PI - ( xy_replication.x );
- float2 pos = center + float2(nx, ny * zeta );
- result = img.sampleNearest( pos );
- }
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
-
diff --git a/krita/plugins/extensions/shiva/collections/filters/Tunnel.shiva b/krita/plugins/extensions/shiva/collections/filters/Tunnel.shiva
deleted file mode 100644
index 5b9f073..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Tunnel.shiva
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Tunnel
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float pi = 3.141592653589793;
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += 1.0/r;
- v += 3.0*a/pi;
- w += r*2.0;
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/Tunnel2.shiva b/krita/plugins/extensions/shiva/collections/filters/Tunnel2.shiva
deleted file mode 100644
index 26052e4..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/Tunnel2.shiva
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- offset: <
- type: float2;
- >;
- >;
->;
-kernel Tunnel2
-{
- dependent float2 center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
-
- void evaluatePixel(image src, output pixel dst)
- {
- float2 pos = (dst.coord - center_p) / IMAGE_SIZE;
-
- float a = atan2(pos.y,pos.x);
- float r = sqrt(pow(pos.x,2.0)+pow(pos.y,2.0));
-
- float u = 0.0;
- float v = 0.0;
- float w = 0.0;
-
- u += offset.x;
- v += offset.y;
-
- u += 1.0/(r+0.5+0.5*sin(5.0*a));
- v += a*3.0/PI;
- w += 0.6*(r+0.5+0.5*sin(5.0*a));
-
- u *= IMAGE_WIDTH;
- v *= IMAGE_HEIGHT;
-
- if (u < 0.0) u += IMAGE_WIDTH * ceil(-u / IMAGE_WIDTH);
- if (v < 0.0) v += IMAGE_HEIGHT * ceil(-v / IMAGE_HEIGHT);
- if (u > IMAGE_WIDTH) u -= IMAGE_WIDTH * floor(u / IMAGE_WIDTH);
- if (v > IMAGE_HEIGHT) v -= IMAGE_HEIGHT * floor(v / IMAGE_HEIGHT);
-
- dst = w * src.sampleNearest(float2(u, v));
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/ZigZag.shiva b/krita/plugins/extensions/shiva/collections/filters/ZigZag.shiva
deleted file mode 100644
index 7ced6f4..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/ZigZag.shiva
+++ /dev/null
@@ -1,43 +0,0 @@
-<
- parameters: <
- cellWidth: <
- label: "Cell width";
- type: int;
- minValue: 1;
- maxValue: 50;
- defaultValue: 10;
- >;
- cellHeight: <
- label: "Cell height";
- type: int;
- minValue: 1;
- maxValue: 50;
- defaultValue: 10;
- >;
- >;
->;
-kernel ZigZag
-{
- dependent float2 center = { IMAGE_WIDTH * 0.5, IMAGE_HEIGHT * 0.5 };
- void evaluatePixel(image img, out pixel result)
- {
- float2 vec = result.coord - center;
- float dx = vec.x;
- if(dx < 0 ) dx = -dx;
- float dy = vec.y;
- if(dy < 0 ) dy = -dy;
-
- float2 displacement;
- int iy = dy * result.coord.y;
- int ix = dx * result.coord.x;
- displacement[0] = iy % cellWidth;
- displacement[1] = ix % cellHeight;
-// R=src(x+((abs(y-Y/2))*y%val(0,0,X/2)),y+((abs(x-X/2))*x%val(1,0,Y/2)),z)
-
- result = img.sampleNearest( result.coord + displacement );
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/filters/oilify.shiva b/krita/plugins/extensions/shiva/collections/filters/oilify.shiva
deleted file mode 100644
index 62b0430..0000000
--- a/krita/plugins/extensions/shiva/collections/filters/oilify.shiva
+++ /dev/null
@@ -1,40 +0,0 @@
-kernel Oilify
-{
- int intensity( float4 px )
- {
- int v = (0.5 * px[1] + 0.3 * px[2] + 0.2 * px[0]) * 255;
- if( v < 0 ) return 0;
- if( v > 255) return 255;
- return v;
- }
- void evaluatePixel(image4 img, out pixel4 result)
- {
- int xc = result.coord.x;
- int yc = result.coord.y;
- int histogram[256];
- for(int i = 0; i < 255; ++i)
- {
- histogram[i] = 0;
- }
- float4 max_px;
- int max = 0;
- for( int y = yc - 4; y < yc + 4; ++y)
- {
- for( int x = xc - 4; x < xc + 4; ++x)
- {
- float4 px = img.sampleNearest( float2(x,y ) );
- int hv = ++histogram[ intensity( px ) ];
- if( hv > max )
- {
- max_px = px;
- max = hv;
- }
- }
- }
- result = max_px;
- }
- region changed(region changed_input_region, int input_index, region input_DOD[])
- {
- return changed_input_region;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/CMakeLists.txt b/krita/plugins/extensions/shiva/collections/generators/CMakeLists.txt
deleted file mode 100644
index 92ee80c..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-file(GLOB _kernels *.shiva)
-install(FILES ${_kernels} DESTINATION ${SHIVA_KERNELS_INSTALL_DIR}/shiva/kernels )
diff --git a/krita/plugins/extensions/shiva/collections/generators/CheckerBoard.shiva b/krita/plugins/extensions/shiva/collections/generators/CheckerBoard.shiva
deleted file mode 100644
index a4885e1..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/CheckerBoard.shiva
+++ /dev/null
@@ -1,47 +0,0 @@
-<
- parameters: <
- hcount: <
- label: "Horizontal";
- type: int;
- defaultValue: 10;
- >;
- vcount: <
- label: "Vertical";
- type: int;
- defaultValue: 10;
- >;
- color1: <
- label: "Color 1";
- type: color;
- defaultValue: { 0.0, 0.0, 0.0, 1.0 };
- >;
- color2: <
- label: "Color 2";
- type: color;
- defaultValue: { 1.0, 1.0, 1.0, 1.0 };
- >;
- >;
->;
-kernel CheckerBoard
-{
- dependent int hsize;
- dependent int vsize;
- void evaluateDependents()
- {
- hsize = IMAGE_WIDTH / hcount;
- vsize = IMAGE_HEIGHT / vcount;
- }
- void evaluatePixel(out pixel4 result)
- {
- int ix = int(result.coord.x) / hsize & 1;
- int iy = int(result.coord.y) / vsize & 1;
- color r;
- if( ( ix == 1 and iy == 1 ) or ( ix == 0 and iy == 0 ) )
- {
- r = color1;
- } else {
- r = color2;
- }
- result = r;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/ConcentricCircles.shiva b/krita/plugins/extensions/shiva/collections/generators/ConcentricCircles.shiva
deleted file mode 100644
index 64827be..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/ConcentricCircles.shiva
+++ /dev/null
@@ -1,54 +0,0 @@
-<
- parameters: <
- radius: <
- label: "Radius";
- type: int;
- defaultValue: 3;
- >;
- color1: <
- label: "Color 1";
- type: color;
- defaultValue: { 0.0, 0.0, 0.0, 1.0 };
- >;
- color2: <
- label: "Color 2";
- type: color;
- defaultValue: { 1.0, 1.0, 1.0, 1.0 };
- >;
- >;
->;
-kernel ConcentricCircles
-{
- dependent float2 center;
- void evaluateDependents()
- {
- center = IMAGE_SIZE * 0.5;
- }
- void evaluatePixel(out pixel4 result)
- {
- float lf = length(result.coord - center);
- int l = lf;
-
- color r;
- if( (l / radius & 1) == 1 )
- {
- r = color1;
- } else {
-
- if( ( ((l-1)/radius) & 1) == 1 )
- {
- float c = l - lf;
- if(c < 0) c = 1+c;
- r = mix(color2, color1, c);
- } else if((((l+1)/radius) & 1 ) == 1)
- {
- float c = l - lf;
- if(c < 0) c = -c;
- r = mix(color2, color1, c);
- } else {
- r = color2;
- }
- }
- result = r;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Disco.shiva b/krita/plugins/extensions/shiva/collections/generators/Disco.shiva
deleted file mode 100644
index 07c95fb..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Disco.shiva
+++ /dev/null
@@ -1,68 +0,0 @@
-<
- parameters: <
- t: <
- label: "Time";
- type: float;
- >;
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- zoom: <
- label: "Zoom";
- type: float;
- minValue: 0.0;
- maxValue: 10000.0;
- defaultValue: 1000.0;
- >;
- Wavelength: <
- rl: <
- label: "Red";
- type: int;
- minValue: 1;
- maxValue: 100;
- defaultValue: 10;
- >;
- gl: <
- label: "Green";
- type: int;
- minValue: 1;
- maxValue: 100;
- defaultValue: 14;
- >;
- bl: <
- label: "Blue";
- type: int;
- minValue: 1;
- maxValue: 100;
- defaultValue: 20;
- >;
- >;
- >;
->;
-kernel Disco
-{
- dependent float2 center;
- const float PI2 = 2 * 3.14159265;
- dependent float q;
- void evaluateDependents()
- {
- center = float2(IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter);
- q = t * PI2;
- }
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float angle = atan2( vec.x, vec.y);
- float r = length(vec);
- float rz=r*zoom;
-
- result = float4( abs( sin( rz / rl + q ) + sin( angle * rl + q ) ),
- abs( sin( rz / gl + q ) + sin( angle * gl + q ) ),
- abs( sin( rz / bl + q ) + sin( angle * bl + q ) ), 2 ) * 0.5;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/FractalExplorer.shiva b/krita/plugins/extensions/shiva/collections/generators/FractalExplorer.shiva
deleted file mode 100644
index 40052d0..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/FractalExplorer.shiva
+++ /dev/null
@@ -1,809 +0,0 @@
-/**
- * FractalExplorer.pbk
- * Last update: 18 July 2009
- *
- * Changelog:
- * 1.0 - Initial release
- * 1.0.1 - Fixed an issue with anti-aliasing on a white background
- * 1.0.2 - Added the iterationColorBlend option to blend higher iterations into the
- * background colour to add a feeling of depth.
- * - Added a rotate option.
- * - Separated out the alpha channel into a separate cfontrol for After Effects
- * compatibility.
- *
- *
- * Copyright (c) 2009 Tom Beddard
- * http://www.subblue.com
- *
- * Port to shiva:
- * Copyright (c) 2009 Cyrille Berger
- *
- * For more Flash and PixelBender based generative graphics experiments see:
- * http://www.subblue.com/blog
- *
- * Licensed under the MIT License:
- * http://www.opensource.org/licenses/mit-license.php
- *
- *
- *
- * What is this?
- * =======================================
- * This filter enables you to explore and render Mandelbrot and Julia sets of multiple powers
- * in real-time at high resolutions. It can be used in the free Adobe PixelBender Toolkit,
- * via the PixelBender plugin for Photoshop CS4 and as a filter in AfterEffects CS4, where you
- * can also animate all the parameters too!
- *
- * PixelBender download and installation instructions are available at:
- * http://labs.adobe.com/technologies/pixelbender/
- *
- * A PDF user guide for this filter and any updates are available at:
- * http://www.subblue.com/projects/fractal_explorer
- *
- *
- *
- * Quick start
- * =======================================
- * The filter defaults to a specific form of a Julia set discovered by Earl Glynn, which was
- * featured in the introduction section of Clifford Picker's book 'Computers and the Imagination'.
- *
- * 1) Change the size sliders to match the pixel size of your current document
- * 2) Zoom out to see the entire fractal
- * 3) Change the power and mu parameters to explore different shapes.
- * These parameters come from the basic equation: z' = z^power + mu
- * Since mu are complex numbers the two sliders correspond to the real and
- * imaginary components, e.g. c = a + bi
- * 4) Check the mandelbrot option to switch from Julia mode to Mandelbrot mode.
- * In the Mandelbrot mode the mu slides don't change anything anything as mu is defined
- * explicitly by the pixel coordinates.
- * 5) The Mandelbrot center preset has three defined areas of interest in the Mandelbrot set.
- * Set this back to 0 to enable the manual controls.
- *
- *
- * Help
- * =======================================
- * I recommend you download the full PDF user guide that has lots of example images explaining
- * the parameters:
- * http://www.subblue.com/projects/fractal_explorer
- *
- * antialiasing:
- * Crude oversampling. The number of samples^2 per pixel, so 1, 4 or 9.
- * Only increase this value once you are ready for the final rendering.
- *
- * bailout:
- * This sets the limit for the fractal calculation to stop at. This can make most difference
- * with some of the bailoutStyle and colorMode settings.
- *
- * bailoutStyle:
- * This changes between different methods of calculating the bailout condition to stop
- * the calculation. The bailout, colorScale and colorCycle controls are useful to tweak when
- * changing the bailoutStyle.
- *
- * color 1 & 2:
- * Inside and outside colours. The 3 slider components correspond to red, gree, blue.
- *
- * colorBackground:
- * The background colour, RGB.
- *
- * colorAlpha:
- * The three channel control sets the alpha value for color1, color2 and colorBackground. The
- * control is separate from the colour controls for After Effects compatibility.
- *
- * colorCycle:
- * The number of times the colour gradient will repeat across the range of the fractal.
- *
- * colorCycleMirror:
- * This will reflect the colour gradient so that it cycles smoothly.
- *
- * colorCycleOffset
- * Change the start point for the gradient colouring.
- *
- * colorMode:
- * There are 6 different colouring modes that can be used to greatly change the appearance
- * of the fractal.
- *
- * colorScale:
- * Controls the strength of the colour mapping from color1 to color2.
- *
- * hsbColor:
- * This changes the colour sliders to be hue, saturation and brightness mode instead of RGB.
- *
- * iterations:
- * This sets the number of iterations for each pixel before bailout. Increase this to get
- * more detail into the edges of the fractal.
- *
- * iterationsOffset:
- * This will ignore results that bailout less than this value. It can be useful to reveal
- * details when using negative powers.
- *
- * iterationColorBlend:
- * This blends the background colour as a ratio of the current iteration count. It can give the
- * impression of depth as the higher iteration count features will be deeper into the fractal.
- *
- * power:
- * This is the power that the fractal equation is raised to:
- * z' = z^power + mu
- * The standard Julia and Mandelbrot sets have an exponent of 2.0
- *
- * powerFineTune:
- * For fine tweaking. The most symmetrical results will be achieved with whole number exponents.
- *
- * mandelbrot:
- * Switch from the default Julia mode to the standard Mode.
- * In Julia mode the mu value is used as the starting point for every pixel whereas in Mandelbrot
- * mode mu is derived from the pixel coordinates, so the mu sliders won't do anything here.
- *
- * mu & muFineTune:
- * These parameter sliders define the real and imaginary parts of the value mu in:
- * z' = z^power + mu
- * Changing these will give the biggest variety of images. When you hit on something interesting
- * use the muFineTune sliders to tweak it more accurately.
- *
- * rotate:
- * Rotate the fractal plane around the origin.
- *
- * size:
- * Change this to match the pixel size of your document (as PixelBender doesn't know anything
- * about the size of the input image)
- *
- * withE:
- * Adds e^z to the fractal equation.
- * z' = z^power + e^z + mu
- *
- * withPowerZ:
- * Adds z^z to the fractal equation.
- * z' = z^power + z^z + mu
- *
- * withSine:
- * Adds sin(z) to the fractal equation.
- * z' = z^power + sin(z) + mu
- *
- * As loops aren't supported with Hydra code it curently isn't possible to export this
- * for use in Flash.
- *
- */
-
-
-<
- version: 0;
- info: <
- namespace : "com.subblue.filters";
- vendor : "Tom Beddard";
- description : "Fractal explorer";
- displayname: "Fractal Explorer";
- category: "Pixel Bender";
- license: "MIT";
- >;
- parameters: <
- antialiasing:
- <
- type: int;
- minValue:1;
- maxValue:3;
- defaultValue:1;
- description: "Super sampling quality. Number of samples squared per pixel.";
- >;
- mandelbrot:
- <
- type: bool;
- defaultValue:false;
- description: "Use the standard Mandelbrot equation.";
- >;
- withPowerZ:
- <
- type: bool;
- defaultValue: false;
- description: "Include z^z in the fractal equation";
- >;
- withSine:
- <
- type: bool;
- defaultValue: false;
- description: "Include sin(z) in the fractal equation";
- >;
- withE:
- <
- type: bool;
- defaultValue: false;
- description: "Include e(z) in the fractal equation";
- >;
- power:
- <
- type: float;
- minValue: -12.0;
- maxValue: 12.0;
- defaultValue: 3.0;
- description: "Raise z to the power e in the fractal formula: z' = z^e + mu";
- >;
- powerFineTune:
- <
- type: float;
- minValue:-0.1;
- maxValue:0.1;
- defaultValue:0.0;
- description: "Fine tune the exponent.";
- >;
- mu:
- <
- type: float2;
- minValue: {-1.0, -1.0};
- maxValue: {1.0, 1.0};
- defaultValue: {0.42, 0.0};
- description: "The complex parameter of the fractal formula: z' = z^e + mu";
- >;
- muFineTune:
- <
- type: float2;
- minValue: {-0.01, -0.01};
- maxValue: {0.01, 0.01};
- defaultValue: {0.0, 0.0};
- description: "Fine tune mu.";
- >;
-
- Bailout: <
- bailoutStyle:
- <
- type: int;
- minValue:0;
- maxValue:3;
- defaultValue:0;
- label: "Bailout style";
- description: "Changes the style of the bailout effect.";
- >;
- bailout:
- <
- type: float;
- minValue:2.0;
- maxValue:150.0;
- defaultValue:4.0;
- description: "Bailout threshold.";
- >;
-
- iterations:
- <
- type: int;
- minValue:1;
- maxValue:300;
- defaultValue:70;
- description: "The maximum number of iterations for each pixel before bailout. Use to increase detail at the fractal edges.";
- >;
-
- iterationsOffset:
- <
- type: int;
- minValue:0;
- maxValue:150;
- defaultValue:0;
- description: "Offset the start of the iteration count";
- >;
- >;
- Colors: <
- colorMode:
- <
- type: int;
- minValue:0;
- maxValue:5;
- defaultValue:0;
- label: "Colouring mode";
- description: "Different colouring modes";
- >;
- hsbColor:
- <
- type: bool;
- defaultValue: false;
- description: "Use hue, saturation, brightness colouring.";
- >;
- color1:
- <
- type: color;
- defaultValue: {1.0, 1.0, 1.0, 1.0};
- description: "The outer colour.";
- >;
-
- color2:
- <
- type: color;
- defaultValue: {0.0, 0.28, 0.46, 1.0};
- description: "The inner colour.";
- >;
-
- colorBackground:
- <
- type: color;
- defaultValue: { 0.0, 0.0, 0.0, 1.0 };
- description: "The background colour.";
- >;
-
- colorCycle:
- <
- type: float;
- minValue: 1.0;
- maxValue: 10.0;
- defaultValue: 1.0;
- description: "The number of times the colour gradient repeats.";
- >;
-
- colorCycleOffset:
- <
- type: float;
- minValue: 1.0;
- minValue:0.0;
- maxValue:1.0;
- defaultValue:0.0;
- description: "Shift the colour mapping.";
- >;
-
- colorCycleMirror:
- <
- type: bool;
- defaultValue:true;
- description: "Reflect the colour gradient or use abrupt steps.";
- >;
-
- colorScale:
- <
- type: float;
- minValue:1.0;
- maxValue:20.0;
- defaultValue:3.0;
- description: "Determines the mapping scale of the colour.";
- >;
-
- iterationColorBlend:
- <
- type: float;
- minValue:0.0;
- maxValue:1.0;
- defaultValue:0.0;
- description: "Add the illusion of depth by blending subsequent iterations into the background.";
- >;
- >;
- rotate:
- <
- type: float;
- minValue:-180.0;
- maxValue:180.0;
- defaultValue:0.0;
- description: "Rotate the fractal.";
- >;
-
- renderedSize:
- <
- type: float2;
- minValue:{100, 100};
- maxValue:{4096, 4096};
- defaultValue:{640, 480};
- description: "The size of the rendered fractal.";
- >;
-
- >;
->;
-
-kernel FractalExplorer
-
-// #define BAILOUT 4.0
-// #define LOG2 float(log(2.0))
-//
-// // Complex math operations
-// // - only some of these are used by this filter, but they are handy to have around :)
-// #define I float2(0.0, 1.0)
-// #define complexMag(z) float(pow(length(z), 2.0))
-// #define complexReciprocal(z) float2(z.x / complexMag(z), -z.y / complexMag(z))
-// #define complexDivision(a,b) complexMult(a, complexReciprocal(b))
-// #define sinh(x) float((exp(x) - exp(-x)) / 2.0)
-// #define cosh(x) float((exp(x) + exp(-x)) / 2.0)
-// #define complexTan(z) float2(sin(2.0 * z.x)/(cos(2.0 * z.x) + cosh(2.0 * z.y)), sinh(2.0 * z.y)/(cos(2.0 * z.x) + cosh(2.0 * z.y)))
-// #define complexSinh(z) float2(sinh(z.x) * cos(z.y), cosh(z.x) * sin(z.y))
-// #define complexCosh(z) float2(cosh(z.x) * cos(z.y), sinh(z.x) * sin(z.y))
-// #define complexTanh(z) float2(sinh(2.0 * z.x)/(cosh(2.0 * z.a) + cos(2.0 * z.y)), sin(2.0 * z.y)/(cosh(2.0 * z.x) + cos(2.0 * z.y)))
-//
-// // x^y = exp(y * log(x))
-
-{
- float2 complexMult(float2 a, float2 b)
- {
- return float2(a.x*b.x - a.y*b.y, a.x*b.y + a.y*b.x);
- }
- float2 complexSin(float2 z)
- {
- return float2(sin(z.x) * cosh(z.y), cos(z.x) * sinh(z.y));
- }
- float2 complexCos(float2 z)
- {
- return float2(cos(z.x) * cosh(z.y), -sin(z.x) * sinh(z.y));
- }
- float2 complexExp(float2 z)
- {
- return float2(exp(z.x) * cos(z.y), exp(z.x) * sin(z.y));
- }
- float complexArg(float2 z)
- {
- return atan2(z.y, z.x);
- }
- float2 complexLog(float2 z)
- {
- return float2(log(length(z)), complexArg(z));
- }
- float2 polar(float r, float a)
- {
- return float2(cos(a) * r, sin(a) * r);
- }
-
- float2 complexPower(float2 z, float p)
- {
- return polar(pow(length(z), float(p)), float(p) * complexArg(z));
- }
-
- float2 complexPower2(float2 z, float2 p)
- {
- return complexExp(complexMult(p, complexLog(z)));
- }
-
- float radians(float v)
- {
- return v / 180.0 * 3.14;
- }
-
- region generated()
- {
- region reg = {0, 0, renderedSize.x, renderedSize.y};
- return reg;
- }
-
-
- // RGB to HSV
- // http://www.easyrgb.com/index.php?X=MATH&H=20#text20
- float3 rgb2hsv(float4 color)
- {
- float rgb_min = min(color.r, min(color.g, color.b));
- float rgb_max = max(color.r, max(color.g, color.b));
- float rgb_delta = rgb_max - rgb_min;
-
- float v = rgb_max;
- float h;
- float s;
-
- if (rgb_delta == 0.0) {
- // Grey
- h = 0.0;
- s = 0.0;
- } else {
- // Colour
- s = rgb_delta / rgb_max;
- float r_delta = (((rgb_max - color.r) / 6.0) + (rgb_delta / 2.0)) / rgb_delta;
- float g_delta = (((rgb_max - color.g) / 6.0) + (rgb_delta / 2.0)) / rgb_delta;
- float b_delta = (((rgb_max - color.b) / 6.0) + (rgb_delta / 2.0)) / rgb_delta;
-
- if (color.r == rgb_max) {
- h = b_delta - g_delta;
- } else if (color.g == rgb_max) {
- h = 1.0/3.0 + r_delta - b_delta;
- } else if (color.b == rgb_max) {
- h = 2.0/3.0 + g_delta - r_delta;
- }
-
- if (h < 0.0) h += 1.0;
- if (h > 1.0) h -= 1.0;
- }
-
- return float3(h, s, v);
- }
-
-
- float4 hsv2rgb(float3 hsv)
- {
- float h; float s; float v; float r; float g; float b; float j; float p; float q; float t;
- int i;
- float4 col;
-
- h = hsv.x;
- s = hsv.y;
- v = hsv.z;
- if (h == 1.0) h = 0.0;
-
- if (v == 0.0) {
- // No brightness so return black
- col = float4(0.0, 0.0, 0.0, 1.0);
-
- } else if (s == 0.0) {
- // No saturation so return grey
- col = float4(v, v, v, 1.0);
-
- } else {
- // RGB color
- h *= 6.0;
- i = int(h);
- j = h - float(i);
- p = v * (1.0 - s);
- q = v * (1.0 - (s * j));
- t = v * (1.0 - (s * (1.0 - j)));
-
- if (i == 0) {
- r = v;
- g = t;
- b = p;
- } else if (i == 1) {
- r = q;
- g = v;
- b = p;
- } else if (i == 2) {
- r = p;
- g = v;
- b = t;
- } else if (i == 3) {
- r = p;
- g = q;
- b = v;
- } else if (i == 4) {
- r = t;
- g = p;
- b = v;
- } else if (i == 5) {
- r = v;
- g = p;
- b = q;
- }
- col = float4(r, g, b, 1.0);
- }
-
- return col;
- }
-
- float2 multiply( float2 matrix[2], float2 v)
- {
- float2 t = matrix[0] * v;
- float2 t2 = matrix[1] * v;
- return float2( t.x + t.y, t2.x + t2.y);
- }
-
- // Calculations common to all pixels
- dependent float x1, x2, y1, zoomFactor, spanX, spanY, sampleStep, sampleContribution;
- dependent float exponent_power, log2Bailout, logPower;
- dependent float2 scale;
- dependent bool mandelbrotMode;
- dependent int minIterations;
- dependent float2 rotation[2];
-
- void evaluateDependents()
- {
- if( iterationsOffset >= iterations)
- {
- minIterations = iterations - 1;
- } else {
- minIterations = iterationsOffset;
- }
-
- // Use a center preset to find some interesting parts of the Mandelbrot set
- exponent_power = power + powerFineTune;
- if (exponent_power == 0.0) exponent_power = 0.1;
- mandelbrotMode = mandelbrot;
-
- // Set min and max limits for x and y in the complex plane
- zoomFactor = exp(0.1);
- x1 = 0.0 - (2.0 / zoomFactor);
- x2 = (2.0 / zoomFactor);
-
- spanX = x2 - x1;
- spanY = spanX * (float(renderedSize.y) / float(renderedSize.x));
- y1 = - spanY / 2.0;
-
- if (rotate != 0.0) {
- float rc = cos(radians(rotate));
- float rs = sin(radians(rotate));
- rotation[0] = float2(rc, rs);
- rotation[1] = float2(-rs, rc);
- float2 xy = multiply(rotation, float2(x1, y1) );
- x1 = xy.x;
- y1 = xy.y;
- }
-
- scale = float2(spanX / float(renderedSize.x), spanY / float(renderedSize.y));
-
- // Precalcuations for specific colouring modes
- if (colorMode < 2) {
- log2Bailout = log(2.0 * log(bailout));
- logPower = log(abs(exponent_power));
- }
-
- // Super sampling
- sampleStep = 1.0 / float(antialiasing);
- sampleContribution = 1.0 / pow(float(antialiasing), 2.0);
- }
-
-
- bool bailoutCondition(float2 z)
- {
- bool bailing;
-
- if (bailoutStyle == 3) {
- bailing = (pow(z.x, 2.0) - pow(z.y, 2.0)) >= bailout;
- } else if (bailoutStyle == 4) {
- bailing = (z.x * z.x - z.y * z.x) >= bailout;
- } else if (bailoutStyle == 5) {
- bailing = (z.y * z.y - z.y * z.x) >= bailout;
- } else if (bailoutStyle == 2) {
- bailing = (pow(z.y, 2.0) - pow(z.x, 2.0)) >= bailout;
- } else if (bailoutStyle == 1) {
- bailing = (abs(z.x) > bailout || abs(z.y) > bailout);
- } else {
- bailing = (pow(z.x, 2.0) + pow(z.y, 2.0)) >= bailout;
- }
- return bailing;
- }
-
-
- float4 colorMapping(float n, float2 z)
- {
- float4 col;
- float4 c1;
- float4 c2;
- float v = abs(1.0 - (n - float(iterationsOffset)) / float(iterations - iterationsOffset));
- float v0 = v;
-
- if (hsbColor && colorMode > 0) {
- c1 = hsv2rgb(float3(color1.red, color1.green, color1.blue));
- c2 = hsv2rgb(float3(color2.red, color2.green, color2.blue));
- } else {
- c1 = float4(color1.red, color1.green, color1.blue, color1.opacity);
- c2 = float4(color2.red, color2.green, color2.blue, color2.opacity);
- }
-
- if (colorMode == 3) {
- if( atan2(z.y, z.x) > 0.0 )
- {
- col = c1;
- } else {
- col = c2;
- }
- } else if (colorMode == 4) {
- if( mod(n, 2.0) == 0.0 )
- {
- col = c1;
- } else {
- col = c2;
- }
- } else if (colorMode == 5) {
- if(abs(z.x) < bailout / 2.0 || abs(z.y) < bailout / 2.0)
- {
- col = c1;
- } else {
- col = c2;
- }
- } else {
- if (colorMode != 2) {
- // Smooth colouring
- // From: http://en.wikipedia.org/wiki/Mandelbrot_set#Continuous_.28smooth.29_coloring
- float vp = (log2Bailout - log(log(abs(length(z))))) / logPower;
- float v1 = abs(1.0 - (n + 1.0 - float(iterationsOffset)) / float(iterations - iterationsOffset));
-
- if (colorMode == 1) {
- if (n == 0.0) {
- v = v - (v - v1) * abs(vp);
- } else {
- v = v1 - (v1 - v) * abs(vp);
- }
- } else {
- v = v + (v1 - v) * abs(vp);
- }
-
- if (v >= 0.0) {
- // Do nothing
- } else {
- // Fix invalid value
- if (v1 >= 0.0) {
- v = v1;
- } else if (v0 >= 0.0) {
- v = v0;
- } else {
- v = 0.0;
- }
- }
- }
-
- if (colorMode == 2 && n == 0.0) v = 1.0;
- if (colorScale > 1.0) v = pow(v, colorScale);
- if (colorCycle > 1.0) v *= colorCycle;
- v += colorCycleOffset;
-
- if (colorCycleMirror) {
- bool even = mod(v, 2.0) < 1.0;
- if (even) {
- v = 1.0 - mod(v, 1.0);
- } else {
- v = mod(v, 1.0);
- }
- } else {
- v = 1.0 - mod(v, 1.0);
- }
-
- if (hsbColor) {
- col = hsv2rgb(mix(float3(c1.x, c1.y, c1.z), float3(c2.x, c2.y, c2.z), v));
- } else {
- col = mix(c1, c2, v);
- }
- }
- return col;
- }
-
-
- /**
- * Standard formula
- * z' = z^e + mu
- *
- * Julia: mu = a + bi which is the same for all points
- * Mandelbrot: e = 2.0, mu = x + yi where x and y are derived from the pixel coordinates
- * Glynn: e = 1.5, mu = -0.2 + 0i
- */
- float4 renderPoint(float2 p)
- {
- float4 col_o = float4(colorBackground.red, colorBackground.green, colorBackground.blue, colorBackground.opacity);
- float4 col = col_o;
- float2 z0;
- float2 z;
-
- if (rotate != 0.0) {
- z = float2(x1, y1) + multiply(rotation, p * scale );
- } else {
- z = float2(x1, y1) + p * scale;
- }
-
- float2 c;
- if( mandelbrotMode)
- {
- c = z;
- } else {
- c = (mu + muFineTune);
- }
- float e = exponent_power;
- float blend = 1.0;
- int n = 0;
-
- bool run = true;
-
- while (n < iterations and run) {
- z0 = complexPower(z, e);
- if (withPowerZ) z0 += complexPower2(z, z);
- if (withSine) z0 += complexSin(z);
- if (withE) z0 += complexExp(z);
- z = z0 + c;
-
- if (n >= minIterations && bailoutCondition(z)) {
- // Set the pixel colour based on the number of iterations it takes to reach the bailout threshold
- col = colorMapping(float(n), z);
- run = false;
- }
-
- n += 1;
- }
-
- // Fill inner
- //if (n == iterations) {
- // color = (1.0 - length(z)) * color1;
- //}
-
- // Prevent edge case of invalid color value
- col = mix(col_o, col, col.a);
-
- if (iterationColorBlend > 0.0) blend = clamp(1.0 - (float(n - minIterations) / float(iterations - minIterations)) * iterationColorBlend, 0.0, 1.0);
- col = mix(col_o, col, col.a * blend);
-
- return col;
- }
-
-
- void
- evaluatePixel(output pixel4 dst)
- {
- float4 c = float4(0.0, 0.0, 0.0, 0.0);
-
- if (antialiasing > 1) {
- // Average detailSuperSample^2 points per pixel
- for (float i = 0.0; i < 1.0; i += sampleStep)
- for (float j = 0.0; j < 1.0; j += sampleStep)
- c += sampleContribution * renderPoint(float2(dst.coord.x + i, dst.coord.y + j));
- } else {
- c = renderPoint(dst.coord);
- }
-
- dst = c;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Metaball.shiva b/krita/plugins/extensions/shiva/collections/generators/Metaball.shiva
deleted file mode 100644
index 197fa54..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Metaball.shiva
+++ /dev/null
@@ -1,80 +0,0 @@
-<
- parameters: <
- metaballs: <
- label: "Number of metaballs";
- type: int;
- >;
- radius: <
- label: "Radius";
- type:float;
- defaultValue: 0.05;
- >;
- ringradius: <
- label: "Ring radius";
- type:float;
- defaultValue: 0.03;
- >;
- outsidecolor: <
- label: "Outside color";
- type: color;
- defaultValue: { 0.0, 0.0, 0.0, 1.0 };
- >;
- metaballcolor: <
- label: "Metaball color";
- type: color;
- defaultValue: { 0.0, 1.0, 0.0, 1.0 };
- >;
- seed: <
- type: int;
- defaultValue: 42;
- >;
- >;
->;
-kernel Metaball
-{
- dependent float2 centers[ 0 ];
- dependent float pxradius, pxringradius;
- void evaluateDependents()
- {
- float2 cs[metaballs];
- centers = cs;
- int image_size = min(IMAGE_WIDTH, IMAGE_HEIGHT);
- pxradius = radius * image_size;
- pxringradius = ringradius * image_size;
- const float RAND_MAX = 2147483647;
- unsigned int seed_ = seed;
- for(int i = 0; i < metaballs; ++i)
- {
- centers[i].x = rand(seed_) / RAND_MAX * IMAGE_WIDTH;
- centers[i].y = rand(seed_) / RAND_MAX * IMAGE_HEIGHT;
- }
- }
- void evaluatePixel(out pixel4 result)
- {
- result = outsidecolor;
- float maxv = 1.1;
- for(int i = 0; i < metaballs; ++i)
- {
- float2 vec = result.coord - centers[i];
- float angle = atan2( vec.x, vec.y);
- float r = length(vec);
- if(r < pxradius )
- {
- result = outsidecolor;
- i = metaballs;
- } else if( r < (pxradius + pxringradius)) {
- float v = (r - pxradius) / pxringradius;
- if(v < maxv)
- {
- result = mix(metaballcolor, outsidecolor, v );
- maxv = v;
- }
- }
- }
- }
- region generated()
- {
- region reg = { 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT};
- return reg;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Moire.shiva b/krita/plugins/extensions/shiva/collections/generators/Moire.shiva
deleted file mode 100644
index 198d57e..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Moire.shiva
+++ /dev/null
@@ -1,42 +0,0 @@
-<
- parameters: <
- t: <
- label: "Time";
- type: float;
- >;
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- >;
->;
-kernel Moire
-{
- const float PI2 = 2 * 3.14159265358979323846;
- dependent float2 center;
- dependent float q;
- void evaluateDependents()
- {
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- q = t * PI2;
- }
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float angle = atan2( vec.x, vec.y);
- float r = length(vec);
-
- result = float4(sin( r * 0.25 + q) + sin(15 * angle +q),
- sin( r / 3.5 + q) + sin(17 * angle + q),
- sin(r / 3+q) + sin(19*angle + q), 2.0 ) * 0.5;
- }
- region generated()
- {
- region reg = { 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT};
- return reg;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/PerlinNoise.shiva b/krita/plugins/extensions/shiva/collections/generators/PerlinNoise.shiva
deleted file mode 100644
index 0e33560..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/PerlinNoise.shiva
+++ /dev/null
@@ -1,113 +0,0 @@
-<
- parameters: <
- amount: <
- label: "Amount";
- type: float;
- >;
- offset: <
- label: "Offset";
- type: float;
- >;
- factor: <
- label: "Factor";
- type: float;
- defaultValue: 1.0;
- maxValue: 10.0;
- >;
- xscale: <
- label: "Horizontal scale";
- type: float;
- defaultValue: 4.0;
- maxValue: 100.0;
- >;
- yscale: <
- label: "Vertical scale";
- type: float;
- defaultValue: 4.0;
- maxValue: 100.0;
- >;
- octaves: <
- label: "Octaves";
- type: int;
- defaultValue: 2;
- maxValue:10;
- >;
- >;
->;
-kernel PerlinNoise
-{
- const int RAND_MAX = 2147483647;
-
- dependent float grad_x[64];
- dependent float grad_y[64];
- dependent int permutation[64];
-
- float fade(float t)
- {
- return ((2.0*abs(t)-3.0)*(t)*(t)+1.0);
- }
-
- // Pregenerate grad_x, grad_y and permuation
- void evaluateDependents()
- {
- // Init permutations
- for(int i = 0; i < 64; ++i)
- {
- permutation[i] = i;
- }
- unsigned int seed = 1252;
- for (int i = 0; i < 1000; ++i) {
- int j = rand(seed) % 64;
- int k = rand(seed) % 64;
- int t = permutation[j];
- permutation[j] = permutation[k];
- permutation[k] = t;
- }
- // Initialize the gradient table
- for(int i = 0; i < 64; ++i)
- {
- grad_x[i] = rand(seed) / float(RAND_MAX) - 0.5;
- grad_y[i] = rand(seed) / float(RAND_MAX) - 0.5;
- float norm = 1.0 / sqrt(grad_x[i] * grad_x[i] + grad_y[i] * grad_y[i]);
- grad_x[i] *= norm;
- grad_y[i] *= norm;
- }
- }
-
- void evaluatePixel(out pixel4 result)
- {
- float total = 0.0;
- int frequency = 1;
- float x = (result.coord.x ) / IMAGE_WIDTH;
- float y = (result.coord.y ) / IMAGE_HEIGHT;
- x *= xscale;
- y *= yscale;
- for(int oct = 0; oct < octaves; ++oct)
- {
- float xs = x * frequency;
- float ys = y * frequency;
- int xs_frac = int(xs);
- int ys_frac = int(ys);
- float intermtotal = 0.0;
- for(int i = 0; i < 2; ++i)
- {
- for(int j = 0; j < 2; ++j)
- {
- int n = permutation[(xs_frac + i + permutation[(ys_frac + j) % 64]) % 64];
- float vx = xs - xs_frac - i;
- float vy = ys - ys_frac - j;
- intermtotal += fade(vx) * fade(vy) * (grad_x[n] * vx + grad_y[n] * vy );
- }
- }
-
- total += intermtotal / frequency;
- frequency *= 2;
- }
- total += offset;
- total *= factor;
- if( total > 1.0) total = 1.0;
- if( total < 0) total = 0;
- result = float4(total,total,total,1.0);
- }
-
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Plasma.shiva b/krita/plugins/extensions/shiva/collections/generators/Plasma.shiva
deleted file mode 100644
index f7cd893..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Plasma.shiva
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Copyright (c) 2009 Ricardo Cabello
- * Copyright (c) 2010 Cyrille Berger
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software 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 the Software.
- *
- * 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 THE
- * AUTHORS OR COPYRIGHT HOLDERS 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 THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
-
-<
- parameters: <
- center: <
- type: float2;
- minValue: {0,0};
- maxValue: {1,1};
- defaultValue: {0.5, 0.5};
- >;
- distort: <
- type: float;
- minValue: 0;
- maxValue: 0.1;
- defaultValue: 0.0;
- >;
- offset: <
- type: float2;
- minValue: {-100,-100};
- maxValue: {100,100};
- defaultValue: {0,0};
- >;
-
- color_offset: <
- type: color;
- defaultValue: {0.0,0.0,0.0,1.0};
- >;
- wave: <
- type: float2;
- minValue: {0,0};
- maxValue: {0.1,0.1};
- defaultValue: {0.05,0.05};
- >;
- >;
->;
-
-kernel PlasmaEffect
-{
- dependent float2 center_p;
- void evaluateDependents()
- {
- center_p = { IMAGE_WIDTH * center.x, IMAGE_HEIGHT * center.y };
- }
- void evaluatePixel(output pixel4 dst)
- {
- float2 pos = dst.coord;
-
- float2 dist = pos - center_p;
- float distance = sqrt((dist.x * dist.x) + (dist.y * dist.y)) * distort;
-
- float color = cos((offset.x + pos.x) * wave.x) + sin((offset.y + pos.y) * wave.y) + sin(distance) + cos(distance);
-
- dst = float4(color + color_offset.red, color + color_offset.green, color + color_offset.blue, color_offset.opacity);
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/RadialGradient.shiva b/krita/plugins/extensions/shiva/collections/generators/RadialGradient.shiva
deleted file mode 100644
index 7122281..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/RadialGradient.shiva
+++ /dev/null
@@ -1,29 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- >;
->;
-kernel RadialGradient
-{
- dependent float2 center;
- const float PI = 3.14159265;
- void evaluateDependents()
- {
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- }
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float angle = atan2( vec.x, vec.y);
- float coef = angle / PI;
- if( coef < 0.0 ) coef = - coef;
- result = float4(coef, coef, coef, 1.0);
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Singleball.shiva b/krita/plugins/extensions/shiva/collections/generators/Singleball.shiva
deleted file mode 100644
index 7981aa9..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Singleball.shiva
+++ /dev/null
@@ -1,63 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- radius: <
- label: "Radius";
- type:float;
- defaultValue: 0.1;
- >;
- ringradius: <
- label: "Ring radius";
- type:float;
- defaultValue: 0.05;
- >;
- outsidecolor: <
- label: "Outside color";
- type: color;
- defaultValue: { 0.0, 0.0, 0.0, 1.0 };
- >;
- ballcolor: <
- label: "Ball color";
- type: color;
- defaultValue: { 0.0, 1.0, 0.0, 1.0 };
- >;
-
- >;
->;
-kernel Singleball
-{
- dependent float2 center;
- dependent float pxradius, pxringradius;
- void evaluateDependents()
- {
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- int image_size = min(IMAGE_WIDTH, IMAGE_HEIGHT);
- pxradius = radius * image_size;
- pxringradius = ringradius * image_size;
- }
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float angle = atan2( vec.x, vec.y);
- float r = length(vec);
- if(r < pxradius or r > (pxradius + pxringradius))
- {
- result = outsidecolor;
- } else {
- float v = (r - pxradius) / pxringradius;
- result = mix(ballcolor, outsidecolor, v);
- }
- }
- region generated()
- {
- region reg = { 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT};
- return reg;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/Something.shiva b/krita/plugins/extensions/shiva/collections/generators/Something.shiva
deleted file mode 100644
index f58b98b..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/Something.shiva
+++ /dev/null
@@ -1,80 +0,0 @@
-<
- parameters: <
- colors: <
- color1: <
- label: "Object";
- type: color;
- defaultValue: { 0.2, 0.01, 0.08 };
- >;
- colorcenter: <
- label: "Background";
- type: color;
- defaultValue: { 1.0, 1.0, 1.0 };
- >;
- >;
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- phase: <
- label: "Phase";
- type: float;
- defaultValue: 6.0;
- maxValue: 32.0;
- >;
- radiusp: <
- label: "Radius";
- type: float;
- defaultValue: 0.8;
- >;
- >;
->;
-kernel Something
-{
- dependent float2 center;
- const float PI = 3.14159265;
- dependent float radius;
- void evaluateDependents()
- {
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- radius = 0.2 * (IMAGE_WIDTH + IMAGE_HEIGHT) * radiusp;
- }
-
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float vec_length = length( vec );
- float angle = atan2( vec.x, vec.y);
- float coef = (cos( angle * phase) + cos( angle * 0.5 * phase ) + cos( angle * 0.1 * phase ) + cos( angle * 0.01 * phase )) * 0.25;
-// float coef = (cos( angle * phase) * cos( angle * 0.5 * phase ) * cos( angle * 0.1 * phase ) * cos( angle * 0.01 * phase ));
- if( coef < 0.0 ) coef = - coef;
- coef = 1.0 - coef;
- float adjRadius = radius * ( 0.5 + 1.0 * coef );
- if( vec_length < adjRadius )
- {
- if( vec_length < adjRadius )
- {
- coef = pow((radius - vec_length) / adjRadius , 1.0 ) * ( 1.0 - coef) + coef;
- }
- result = mix(color1, colorcenter, coef);
-
- for( int i = 0; i < 3; ++i)
- {
- if(result[i] < 0) result[i] = 0.0;
- else if(result[i] > 1) result[i] = 1.0;
- }
- result[3] = 1.0;
- } else {
- result = colorcenter;
- }
- }
- region generated()
- {
- region reg = { 0, 0, IMAGE_WIDTH, IMAGE_HEIGHT};
- return reg;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/SunRay.shiva b/krita/plugins/extensions/shiva/collections/generators/SunRay.shiva
deleted file mode 100644
index 9a2b816..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/SunRay.shiva
+++ /dev/null
@@ -1,56 +0,0 @@
-<
- parameters: <
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- fluctuation: <
- label: "Fluctuation";
- type: float;
- >;
- phase: <
- label: "Phase";
- type:float;
- minValue: 0.1;
- maxValue: 100.0;
- defaultValue: 30.0;
- >;
- colorrgb: <
- label: "Color";
- type: color;
- defaultValue: { 0.3, 0.05, 0.01 };
- >;
- >;
->;
-
-kernel SunRay
-{
- dependent float2 center;
- dependent float4 colorv;
-
- void evaluateDependents()
- {
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- colorv = { colorrgb.red, colorrgb.green, colorrgb.blue, 1.0 };
- }
-
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float angle = atan2( vec.x, vec.y);
- float coef = cos(angle * phase);
- if( coef < 0.0 ) coef = - coef;
- result = colorv + fluctuation * coef;
-
- for( int i = 0; i < 3; ++i)
- {
- if(result[i] < 0) result[i] = 0.0;
- else if(result[i] > 1) result[i] = 1.0;
- }
- result[3] = 1.0;
- }
-}
diff --git a/krita/plugins/extensions/shiva/collections/generators/SuperNova.shiva b/krita/plugins/extensions/shiva/collections/generators/SuperNova.shiva
deleted file mode 100644
index b78741c..0000000
--- a/krita/plugins/extensions/shiva/collections/generators/SuperNova.shiva
+++ /dev/null
@@ -1,92 +0,0 @@
-
-<
- parameters: <
- colors: <
- color1: <
- type: color;
- defaultValue: { 0.1, 0.1, 0.2, 1.0 };
- >;
- color2: <
- type: color;
- defaultValue: { 0.2, 0.2, 0.4, 1.0 };
- >;
- colorCenter: <
- type: color;
- defaultValue: { 0.9, 0.9, 1.0, 1.0 };
- >;
- >;
- xcenter: <
- label: "Center x";
- type: float;
- >;
- ycenter: <
- label: "Center y";
- type: float;
- >;
- phase: <
- label: "Phase";
- type: float;
- minValue: 0.1;
- defaultValue: 30.0;
- maxValue: 100.0;
- >;
- radiusp: <
- label: "Inner Radius";
- type: float;
- defaultValue: 0.01;
- >;
- color2radiusp: <
- label: "Outter Radius";
- type: float;
- defaultValue: 0.02;
- >;
- >;
->;
-
-kernel SuperNova
-{
- dependent float wh;
- dependent float2 center;
- dependent float radius;
- dependent float color2radius;
-
- void evaluateDependents()
- {
- wh = 0.25 * (IMAGE_WIDTH + IMAGE_HEIGHT);
- center = { IMAGE_WIDTH * xcenter, IMAGE_HEIGHT * ycenter };
- radius = radiusp * wh;
- color2radius = color2radiusp * wh;
- }
-
- void evaluatePixel(out pixel4 result)
- {
- float2 vec = result.coord - center;
- float vec_length = length( vec );
- float angle = atan2( vec.x, vec.y);
- float coef = 0.9 * (cos( angle * phase) * cos( angle * 0.5 * phase ) * cos( angle * 0.1 * phase ) * cos( angle * 0.01 * phase )) + 0.1;
- if( coef < 0.0 ) coef = - coef;
- float adjRadius = radius * ( 1.0 + 2.0 * coef ); //( 0.5 + 0.5 * cos(angle) );
- if( vec_length > adjRadius )
- {
- if( vec_length < adjRadius )
- {
- coef = pow((radius - vec_length) / adjRadius , 1.0 ) * ( 1.0 - coef) + coef;
- }
- float coef2 = 1.0;
- if( vec_length < color2radius * radius )
- {
- coef2 = (vec_length - radius) / ( (color2radius - 1.0) * radius );
- }
- result = mix( mix(color2, color1, coef2), colorCenter, coef);
-
- for( int i = 0; i < 3; ++i)
- {
- if(result[i] < 0) result[i] = 0.0;
- else if(result[i] > 1) result[i] = 1.0;
- }
- result[3] = 1.0;
- } else {
- result = colorCenter;
- }
- }
-}
diff --git a/krita/plugins/extensions/shiva/kritashivafilters.desktop b/krita/plugins/extensions/shiva/kritashivafilters.desktop
deleted file mode 100644
index 5d3c612..0000000
--- a/krita/plugins/extensions/shiva/kritashivafilters.desktop
+++ /dev/null
@@ -1,63 +0,0 @@
-[Desktop Entry]
-Name=Shiva Kernel Language Support For Filters
-Name[bs]=Podrška Shiva Kernel jezika za Filtere
-Name[ca]=Compatibilitat del llenguatge del nucli Shiva per a filtres
-Name[ca at valencia]=Compatibilitat del llenguatge del nucli Shiva per a filtres
-Name[da]=Sprogunderstøttelse af Shiva-kerne til filtre
-Name[de]=Shiva-Kernel-Sprachunterstützung für Filter
-Name[el]=Υποστήριξη της γλώσσας πυρήνα Shiva για φίλτρα
-Name[en_GB]=Shiva Kernel Language Support For Filters
-Name[es]=Implementación del lenguaje del núcleo Shiva para los filtros
-Name[et]=Shiva kernelikeele toetus filtrites
-Name[fr]=Prise en charge du noyau de langage Shiva pour les filtres
-Name[gl]=Capacidade para o núcleo Shiva de interpretación de linguaxes para filtros
-Name[hu]=Shiva rendszermag nyelvi támogatás a szűrőkhöz
-Name[it]=Supporto per il linguaggio Shiva Kernel per filtri
-Name[ja]=フィルタのための Shiva Kernel 言語サポート
-Name[kk]=Shiva өзек тілін сүзгілер үшн қолдауы
-Name[nb]=Shiva-kjernespråkstøtte for fltre
-Name[nds]=Shiva-Karn-Spraakünnerstütten för Filtern
-Name[nl]=Ondersteuning van Shiva-kerneltaal voor filters
-Name[pl]=Obsługa języka Shiva Kernel Language dla filtrów
-Name[pt]=Suporte à Linguagem do 'Kernel' Shiva para os Filtros
-Name[pt_BR]=Suporte à linguagem do kernel Shiva para filtros
-Name[ru]=Поддержка в ядре языка Shiva для фильтров
-Name[sk]=Jazyková podpora pre filtre Shiva Kernel
-Name[sv]=Shiva språkstöd i kärnan för filter
-Name[uk]=Підтримка мови ядра Shiva для фільтрів
-Name[wa]=Sopoirt di lingaedje do nawea Shiva po les passetes
-Name[x-test]=xxShiva Kernel Language Support For Filtersxx
-Name[zh_TW]=過濾器使用之 Shiva 核心語言支援
-Comment=Shiva Kernel Language Support For Filters
-Comment[bs]=Podrška Shiva Kernel jezika za Filtere
-Comment[ca]=Compatibilitat del llenguatge del nucli Shiva per a filtres
-Comment[ca at valencia]=Compatibilitat del llenguatge del nucli Shiva per a filtres
-Comment[da]=Sprogunderstøttelse af Shiva-kerne til filtre
-Comment[de]=Shiva-Kernel-Sprachunterstützung für Filter
-Comment[el]=Υποστήριξη της γλώσσας πυρήνα Shiva για φίλτρα
-Comment[en_GB]=Shiva Kernel Language Support For Filters
-Comment[es]=Implementación del lenguaje del núcleo Shiva para los filtros
-Comment[et]=Shiva kernelikeele toetus filtrites
-Comment[fr]=Prise en charge du noyau de langage Shiva pour les filtres
-Comment[gl]=Capacidade para o núcleo Shiva de interpretación de linguaxes para filtros.
-Comment[hu]=Shiva rendszermag nyelvi támogatás a szűrőkhöz
-Comment[it]=Supporto per il linguaggio Shiva Kernel per filtri
-Comment[ja]=フィルタのための Shiva Kernel 言語サポート
-Comment[kk]=Shiva өзек тілін сүзгілер үшн қолдауы
-Comment[nb]=Shiva-kjernespråkstøtte for fltre
-Comment[nds]=Shiva-Karn-Spraakünnerstütten för Filtern
-Comment[nl]=Ondersteuning van Shiva-kerneltaal voort filters
-Comment[pl]=Obsługa języka Shiva Kernel Language dla filtrów
-Comment[pt]=Suporte à Linguagem do 'Kernel' Shiva para os Filtros
-Comment[pt_BR]=Suporte à linguagem do kernel Shiva para filtros
-Comment[ru]=Поддержка в ядре языка Shiva для фильтров
-Comment[sk]=Jazyková podpora pre filtre Shiva Kernel
-Comment[sv]=Shiva språkstöd i kärnan för filter
-Comment[uk]=Підтримка мови ядра Shiva для фільтрів
-Comment[wa]=Sopoirt di lingaedje do nawea Shiva po les passetes
-Comment[x-test]=xxShiva Kernel Language Support For Filtersxx
-Comment[zh_TW]=過濾器使用之 Shiva 核心語言支援
-X-KDE-ServiceTypes=Krita/Filter
-Type=Service
-X-KDE-Library=kritashivafilters
-X-Krita-Version=28
diff --git a/krita/plugins/extensions/shiva/kritashivagenerators.desktop b/krita/plugins/extensions/shiva/kritashivagenerators.desktop
deleted file mode 100644
index c261da0..0000000
--- a/krita/plugins/extensions/shiva/kritashivagenerators.desktop
+++ /dev/null
@@ -1,63 +0,0 @@
-[Desktop Entry]
-Name=Shiva Kernel Language Support For Generators
-Name[bs]=Podrška Shiva Kernel jezika za Generatore
-Name[ca]=Compatibilitat del llenguatge del nucli Shiva per a generadors
-Name[ca at valencia]=Compatibilitat del llenguatge del nucli Shiva per a generadors
-Name[da]=Sprogunderstøttelse af Shiva-kerne til generatorer
-Name[de]=Shiva-Kernel-Sprachunterstützung für Generatoren
-Name[el]=Υποστήριξη της γλώσσας πυρήνα Shiva για γεννήτριες
-Name[en_GB]=Shiva Kernel Language Support For Generators
-Name[es]=Implementación del lenguaje del núcleo Shiva para los generadores
-Name[et]=Shiva kernelikeele toetus genereerijates
-Name[fr]=Prise en charge du noyau de langage Shiva pour les générateurs
-Name[gl]=Capacidade para o núcleo Shiva de interpretación de linguaxes para xeradores
-Name[hu]=Shiva rendszermag nyelvi támogatás az előállítókhoz
-Name[it]=Supporto per il linguaggio Shiva Kernel per generatori
-Name[ja]=ジェネレータのための Shiva Kernel 言語サポート
-Name[kk]=Shiva өзек тілін генераторлар үшн қолдауы
-Name[nb]=Shiva-kjernespråkstøtte for generatorer
-Name[nds]=Shiva-Karn-Spraakünnerstütten för Opstellers
-Name[nl]=Ondersteuning van Shiva-kerneltaal voor generatoren
-Name[pl]=Obsługa języka Shiva Kernel Language dla generatorów
-Name[pt]=Suporte à Linguagem do 'Kernel' Shiva para os Geradores
-Name[pt_BR]=Suporte à linguagem do kernel Shiva para geradores
-Name[ru]=Поддержка в ядре языка Shiva для генераторов
-Name[sk]=Jazyková podpora pre generátory Shiva Kernel
-Name[sv]=Shiva språkstöd i kärnan för generering
-Name[uk]=Підтримка мови ядра Shiva для породжувачів
-Name[wa]=Sopoirt di lingaedje do nawea Shiva po les ahiveus
-Name[x-test]=xxShiva Kernel Language Support For Generatorsxx
-Name[zh_TW]=產生器使用之 Shiva 核心語言支援
-Comment=Shiva Kernel Language Support For Generators
-Comment[bs]=Podrška Shiva Kernel jezika za Generatore
-Comment[ca]=Compatibilitat del llenguatge del nucli Shiva per a generadors
-Comment[ca at valencia]=Compatibilitat del llenguatge del nucli Shiva per a generadors
-Comment[da]=Sprogunderstøttelse af Shiva-kerne til generatorer
-Comment[de]=Shiva-Kernel-Sprachunterstützung für Generatoren
-Comment[el]=Υποστήριξη της γλώσσας πυρήνα Shiva για φίλτρα
-Comment[en_GB]=Shiva Kernel Language Support For Generators
-Comment[es]=Implementación del lenguaje del núcleo Shiva para los generadores
-Comment[et]=Shiva kernelikeele toetus genereerijates
-Comment[fr]=Prise en charge du noyau de langage Shiva pour les générateurs
-Comment[gl]=Capacidade para o núcleo Shiva de interpretación de linguaxes para xeradores.
-Comment[hu]=Shiva rendszermag nyelvi támogatás az előállítókhoz
-Comment[it]=Supporto per il linguaggio Shiva Kernel per generatori
-Comment[ja]=ジェネレータのための Shiva Kernel 言語サポート
-Comment[kk]=Shiva өзек тілін генераторлар үшн қолдауы
-Comment[nb]=Shiva-kjernespråkstøtte for generatorer
-Comment[nds]=Shiva-Karn-Spraakünnerstütten för Opstellers
-Comment[nl]=Ondersteuning van Shiva-kerneltaal voor generators
-Comment[pl]=Obsługa języka Shiva Kernel Language dla generatorów
-Comment[pt]=Suporte à Linguagem do 'Kernel' Shiva para os Geradores
-Comment[pt_BR]=Suporte à linguagem do kernel Shiva para geradores
-Comment[ru]=Поддержка в ядре языка Shiva для генераторов
-Comment[sk]=Jazyková podpora pre generátory Shiva Kernel
-Comment[sv]=Shiva språkstöd i kärnan för generering
-Comment[uk]=Підтримка мови ядра Shiva для породжувачів
-Comment[wa]=Sopoirt di lingaedje do nawea Shiva po les ahiveus
-Comment[x-test]=xxShiva Kernel Language Support For Generatorsxx
-Comment[zh_TW]=產生器使用之 Shiva 核心語言支援
-X-KDE-ServiceTypes=Krita/Generator
-Type=Service
-X-KDE-Library=kritashivagenerators
-X-Krita-Version=28
diff --git a/krita/plugins/extensions/shiva/shivafilter.cpp b/krita/plugins/extensions/shiva/shivafilter.cpp
deleted file mode 100644
index 7fc3930..0000000
--- a/krita/plugins/extensions/shiva/shivafilter.cpp
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "shivafilter.h"
-
-#include <QMutex>
-
-#include <KoUpdater.h>
-
-#include <kis_paint_device.h>
-#include <filter/kis_filter_configuration.h>
-#include <kis_processing_information.h>
-#include <ShivaGeneratorConfigWidget.h>
-#include "PaintDeviceImage.h"
-#include "QVariantValue.h"
-#include <OpenShiva/Kernel.h>
-#include <OpenShiva/Source.h>
-#include <GTLFragment/Metadata.h>
-#include <GTLCore/Region.h>
-
-#include "UpdaterProgressReport.h"
-#include <kis_gtl_lock.h>
-
-extern QMutex* shivaMutex;
-
-ShivaFilter::ShivaFilter(OpenShiva::Source* kernel) : KisFilter(KoID(kernel->name().c_str(), kernel->name().c_str()), categoryOther(), kernel->name().c_str()), m_source(kernel)
-{
- setColorSpaceIndependence(FULLY_INDEPENDENT);
- setSupportsPainting(false);
- setSupportsIncrementalPainting(false);
-}
-
-ShivaFilter::~ShivaFilter()
-{
-}
-
-KisConfigWidget* ShivaFilter::createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const
-{
- Q_UNUSED(dev);
- return new ShivaGeneratorConfigWidget(m_source, parent);
-}
-
-void ShivaFilter::processImpl(KisPaintDeviceSP dev,
- const QRect& size,
- const KisFilterConfiguration* config,
- KoUpdater* progressUpdater
- ) const
-{
- Q_UNUSED(progressUpdater);
- QPoint dstTopLeft = size.topLeft();
-
- UpdaterProgressReport* report = 0;
- if (progressUpdater) {
- progressUpdater->setRange(0, size.height());
- report = new UpdaterProgressReport(progressUpdater);
- }
-
- Q_ASSERT(!dev.isNull());
-// Q_ASSERT(config);
- // TODO support for selection
- OpenShiva::Kernel kernel;
- kernel.setSource(*m_source);
- if (config) {
- QMap<QString, QVariant> map = config->getProperties();
- for (QMap<QString, QVariant>::iterator it = map.begin(); it != map.end(); ++it) {
- dbgPlugins << it.key() << " " << it.value();
- const GTLCore::Metadata::Entry* entry = kernel.metadata()->parameter(it.key().toLatin1().constData());
- if (entry && entry->asParameterEntry()) {
- GTLCore::Value val = qvariantToValue(it.value(), entry->asParameterEntry()->type());
- if(val.isValid())
- {
- kernel.setParameter(it.key().toLatin1().constData(), val);
- }
- }
- }
- }
-
- kernel.setParameter(OpenShiva::Kernel::IMAGE_WIDTH, float(dev->defaultBounds()->bounds().width()));
- kernel.setParameter(OpenShiva::Kernel::IMAGE_HEIGHT, float(dev->defaultBounds()->bounds().height()));
-
- KisGtlLocker gtlLocker;
- {
- dbgPlugins << "Compile: " << m_source->name().c_str();
- QMutexLocker l(shivaMutex);
- kernel.compile();
- }
- if (kernel.isCompiled()) {
- ConstPaintDeviceImage pdisrc(dev);
- PaintDeviceImage pdi(dev);
- std::list< const GTLCore::AbstractImage* > inputs;
- GTLCore::RegionI region(dstTopLeft.x(), dstTopLeft.y() , size.width(), size.height());
- inputs.push_back(&pdisrc);
- dbgPlugins << "Run: " << m_source->name().c_str() << " " << dstTopLeft << " " << size;
- kernel.evaluatePixels(region, inputs, &pdi, report );
-
- }
-}
diff --git a/krita/plugins/extensions/shiva/shivafilter.h b/krita/plugins/extensions/shiva/shivafilter.h
deleted file mode 100644
index 4fb5499..0000000
--- a/krita/plugins/extensions/shiva/shivafilter.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _SHIVA_FILTER_H_
-#define _SHIVA_FILTER_H_
-
-#include "filter/kis_filter.h"
-
-namespace OpenShiva
-{
-class Source;
-};
-
-class ShivaFilter : public KisFilter
-{
-public:
- ShivaFilter(OpenShiva::Source* source);
- virtual ~ShivaFilter();
-
- virtual void processImpl(KisPaintDeviceSP dev,
- const QRect& size,
- const KisFilterConfiguration* config,
- KoUpdater* progressUpdater
- ) const;
-
- KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
-private:
- OpenShiva::Source* m_source;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/shivafiltersplugin.cpp b/krita/plugins/extensions/shiva/shivafiltersplugin.cpp
deleted file mode 100644
index ab2de0c..0000000
--- a/krita/plugins/extensions/shiva/shivafiltersplugin.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "shivafiltersplugin.h"
-
-#include <QMutex>
-
-#include <kis_debug.h>
-#include <kpluginfactory.h>
-#include <kstandarddirs.h>
-
-#include <filter/kis_filter_registry.h>
-
-#include <GTLCore/String.h>
-#include <OpenShiva/SourcesCollection.h>
-
-#include "shivafilter.h"
-
-#include <GTLCore/CompilationMessages.h>
-
-QMutex* shivaMutex;
-
-K_PLUGIN_FACTORY(ShivaPluginFactory, registerPlugin<ShivaPlugin>();)
-K_EXPORT_PLUGIN(ShivaPluginFactory("krita"))
-
-ShivaPlugin::ShivaPlugin(QObject *parent, const QVariantList &)
- : QObject(parent)
-{
- m_sourceCollection = new OpenShiva::SourcesCollection();
-
- QStringList kernelModulesDirs = KGlobal::mainComponent().dirs()->findDirs("data", "krita/shiva/kernels/");
- dbgPlugins << kernelModulesDirs;
- foreach(const QString & dir, kernelModulesDirs) {
- dbgPlugins << "Append : " << dir << " to the list of CTL modules";
- m_sourceCollection->addDirectory(dir.toLatin1().constData());
- }
- {
- KisFilterRegistry * manager = KisFilterRegistry::instance();
- Q_ASSERT(manager);
- std::list< OpenShiva::Source > kernels = m_sourceCollection->sources(OpenShiva::Source::FilterKernel);
- dbgPlugins << "Collection has " << kernels.size() << " filters";
- foreach(OpenShiva::Source kernel, kernels) {
- dbgPlugins << kernel.metadataCompilationMessages().toString().c_str() ;
- if (kernel.outputImageType() == OpenShiva::Source::Image && kernel.inputImageType(0) == OpenShiva::Source::Image) {
- manager->add(new ShivaFilter(new OpenShiva::Source(kernel)));
- }
- }
- }
- shivaMutex = new QMutex;
-}
-
-ShivaPlugin::~ShivaPlugin()
-{
-// delete m_sourceCollection; // The plugin object get deleted right after creation, m_sourceCollection be staticly deleted
-}
diff --git a/krita/plugins/extensions/shiva/shivafiltersplugin.h b/krita/plugins/extensions/shiva/shivafiltersplugin.h
deleted file mode 100644
index 91e01ff..0000000
--- a/krita/plugins/extensions/shiva/shivafiltersplugin.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _SHIVA_FILTERS_PLUGIN_H_
-#define _SHIVA_FILTERS_PLUGIN_H_
-
-#include <QObject>
-#include <QVariant>
-
-class KisConfigWidget;
-
-namespace OpenShiva
-{
-class SourcesCollection;
-}
-
-class ShivaPlugin : public QObject
-{
- Q_OBJECT
-public:
- ShivaPlugin(QObject* parent, const QVariantList&);
- virtual ~ShivaPlugin();
-private:
- OpenShiva::SourcesCollection* m_sourceCollection;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/shivagenerator.cpp b/krita/plugins/extensions/shiva/shivagenerator.cpp
deleted file mode 100644
index 87764b4..0000000
--- a/krita/plugins/extensions/shiva/shivagenerator.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "shivagenerator.h"
-
-#include <QMutex>
-
-#include <KoUpdater.h>
-
-#include <kis_paint_device.h>
-#include <filter/kis_filter_configuration.h>
-#include <kis_processing_information.h>
-
-#include <GTLCore/Region.h>
-#include <OpenShiva/Kernel.h>
-
-#include <ShivaGeneratorConfigWidget.h>
-#include <OpenShiva/Source.h>
-
-#include <GTLFragment/Metadata.h>
-
-#include "PaintDeviceImage.h"
-#include "QVariantValue.h"
-#include "UpdaterProgressReport.h"
-
-#include "GTLCore/CompilationMessages.h"
-#include <kis_gtl_lock.h>
-
-extern QMutex* shivaMutex;
-
-ShivaGenerator::ShivaGenerator(OpenShiva::Source* kernel) : KisGenerator(KoID(kernel->name().c_str(), kernel->name().c_str()), KoID("basic"), kernel->name().c_str()), m_source(kernel)
-{
- setColorSpaceIndependence(FULLY_INDEPENDENT);
- setSupportsPainting(true);
- setSupportsIncrementalPainting(false);
-}
-
-KisConfigWidget * ShivaGenerator::createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const
-{
- Q_UNUSED(dev);
- return new ShivaGeneratorConfigWidget(m_source, parent);
-}
-
-void ShivaGenerator::generate(KisProcessingInformation dstInfo,
- const QSize& size,
- const KisFilterConfiguration* config,
- KoUpdater* progressUpdater) const
-{
- Q_UNUSED(progressUpdater);
- KisPaintDeviceSP dst = dstInfo.paintDevice();
- QPoint dstTopLeft = dstInfo.topLeft();
-
- UpdaterProgressReport* report = 0;
- if (progressUpdater) {
- progressUpdater->setRange(0, size.height());
- report = new UpdaterProgressReport(progressUpdater);
- }
-
- Q_ASSERT(!dst.isNull());
-// Q_ASSERT(config);
- // TODO implement the generating of pixel
- OpenShiva::Kernel kernel;
- kernel.setSource(*m_source);
-
- if (config) {
- QMap<QString, QVariant> map = config->getProperties();
- for (QMap<QString, QVariant>::iterator it = map.begin(); it != map.end(); ++it) {
- const GTLCore::Metadata::Entry* entry = kernel.metadata()->parameter(it.key().toLatin1().constData());
- if (entry && entry->asParameterEntry()) {
- GTLCore::Value val = qvariantToValue(it.value(), entry->asParameterEntry()->type());
- if(val.isValid())
- {
- kernel.setParameter(it.key().toLatin1().constData(), val);
- }
- }
- }
- }
- kernel.setParameter(OpenShiva::Kernel::IMAGE_WIDTH, float(dstInfo.paintDevice()->defaultBounds()->bounds().width()));
- kernel.setParameter(OpenShiva::Kernel::IMAGE_HEIGHT, float(dstInfo.paintDevice()->defaultBounds()->bounds().height()));
- KisGtlLocker gtlLocker;
- {
- QMutexLocker l(shivaMutex);
- kernel.compile();
- }
- if (kernel.isCompiled()) {
- PaintDeviceImage pdi(dst);
- std::list< const GTLCore::AbstractImage* > inputs;
- GTLCore::RegionI region(dstTopLeft.x(), dstTopLeft.y() , size.width(), size.height());
- kernel.evaluatePixels(region, inputs, &pdi, report );
- }
- else {
- dbgPlugins << "Error: " << kernel.compilationMessages().toString().c_str();
- }
-}
diff --git a/krita/plugins/extensions/shiva/shivagenerator.h b/krita/plugins/extensions/shiva/shivagenerator.h
deleted file mode 100644
index 585a14f..0000000
--- a/krita/plugins/extensions/shiva/shivagenerator.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _SHIVAGENERATOR_H_
-#define _SHIVAGENERATOR_H_
-
-#include "generator/kis_generator.h"
-
-class KisConfigWidget;
-
-namespace OpenShiva
-{
-class Source;
-};
-
-class ShivaGenerator : public KisGenerator
-{
-public:
-
- ShivaGenerator(OpenShiva::Source* source);
-
- using KisGenerator::generate;
-
- void generate(KisProcessingInformation dst,
- const QSize& size,
- const KisFilterConfiguration* config,
- KoUpdater* progressUpdater
- ) const;
- KisConfigWidget * createConfigurationWidget(QWidget* parent, const KisPaintDeviceSP dev) const;
-
-private:
- OpenShiva::Source* m_source;
-};
-
-#endif
diff --git a/krita/plugins/extensions/shiva/shivageneratorsplugin.cpp b/krita/plugins/extensions/shiva/shivageneratorsplugin.cpp
deleted file mode 100644
index 6c492b2..0000000
--- a/krita/plugins/extensions/shiva/shivageneratorsplugin.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (c) 2008-2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 "shivageneratorsplugin.h"
-
-#include <QMutex>
-
-#include <kis_debug.h>
-#include <kpluginfactory.h>
-#include <kstandarddirs.h>
-
-#include <generator/kis_generator_registry.h>
-
-#include <GTLCore/String.h>
-#include <OpenShiva/SourcesCollection.h>
-
-#include "shivagenerator.h"
-
-#include <GTLCore/CompilationMessages.h>
-
-QMutex* shivaMutex;
-
-K_PLUGIN_FACTORY(ShivaPluginFactory, registerPlugin<ShivaPlugin>();)
-K_EXPORT_PLUGIN(ShivaPluginFactory("krita"))
-
-ShivaPlugin::ShivaPlugin(QObject *parent, const QVariantList &)
- : QObject(parent)
-{
- m_sourceCollection = new OpenShiva::SourcesCollection();
-
- QStringList kernelModulesDirs = KGlobal::mainComponent().dirs()->findDirs("data", "krita/shiva/kernels/");
- dbgPlugins << kernelModulesDirs;
- foreach(const QString & dir, kernelModulesDirs) {
- dbgPlugins << "Append : " << dir << " to the list of CTL modules";
- m_sourceCollection->addDirectory(dir.toLatin1().constData());
- }
- {
- KisGeneratorRegistry * manager = KisGeneratorRegistry::instance();
- Q_ASSERT(manager);
- std::list< OpenShiva::Source > kernels = m_sourceCollection->sources(OpenShiva::Source::GeneratorKernel);
-
- dbgPlugins << "Collection has " << kernels.size() << " generators";
- foreach(OpenShiva::Source kernel, kernels) {
- dbgPlugins << kernel.metadataCompilationMessages().toString().c_str();
- if (kernel.outputImageType() == OpenShiva::Source::Image || kernel.outputImageType() == OpenShiva::Source::Image4) {
- manager->add(new ShivaGenerator(new OpenShiva::Source(kernel)));
- }
- }
- }
- shivaMutex = new QMutex;
-}
-
-ShivaPlugin::~ShivaPlugin()
-{
-// delete m_sourceCollection; // The plugin object get deleted right after creation, m_sourceCollection be staticly deleted
-}
diff --git a/krita/plugins/extensions/shiva/shivageneratorsplugin.h b/krita/plugins/extensions/shiva/shivageneratorsplugin.h
deleted file mode 100644
index bf41cc9..0000000
--- a/krita/plugins/extensions/shiva/shivageneratorsplugin.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 2009 Cyrille Berger <cberger at cberger.net>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * 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 Lesser 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 _SHIVA_GENERATORS_PLUGIN_H_
-#define _SHIVA_GENERATORS_PLUGIN_H_
-
-#include <QObject>
-#include <QVariant>
-
-class KisConfigWidget;
-
-namespace OpenShiva
-{
-class SourcesCollection;
-}
-
-class ShivaPlugin : public QObject
-{
-public:
- ShivaPlugin(QObject* parent, const QVariantList&);
- virtual ~ShivaPlugin();
-private:
- OpenShiva::SourcesCollection* m_sourceCollection;
-};
-
-#endif
More information about the kimageshop
mailing list