├── .gitignore ├── resources.rc ├── tests ├── test.png └── test_alpha.png ├── resources ├── logo.ico ├── logo.png └── stylesheets │ └── theme_dark.qss ├── Linux_Wrapper_Script ├── NormalmapGenerator └── README.txt ├── screenshots ├── tabs │ └── tabs_combined.jpg └── KLD_jpg │ ├── KLD_enabled_crop_converted.jpg │ ├── KLD_disabled_crop_converted.jpg │ ├── KLD_enabled_render_converted.jpg │ └── KLD_disabled_render_converted.jpg ├── qt_license ├── ThirdPartySoftware_Listing.txt ├── LGPL_EXCEPTION.txt ├── LICENSE.FDL ├── LICENSE.LGPL └── LICENSE.GPL ├── stylesheets.qrc ├── src_gui ├── clickablelabel.h ├── listwidget.h ├── listwidget.cpp ├── queuemanager.cpp ├── queueitem.cpp ├── queueitem.h ├── queuemanager.h ├── graphicsscene.h ├── graphicsscene.cpp ├── aboutdialog.h ├── graphicsview.h ├── graphicsview.cpp ├── aboutdialog.cpp └── mainwindow.h ├── xcompile.sh ├── main.cpp ├── README.md ├── src_generators ├── boxblur.h ├── specularmapgenerator.h ├── ssaogenerator.h ├── gaussianblur.h ├── intensitymap.h ├── normalmapgenerator.h ├── boxblur.cpp ├── specularmapgenerator.cpp ├── gaussianblur.cpp ├── ssaogenerator.cpp ├── intensitymap.cpp └── normalmapgenerator.cpp ├── NormalmapGenerator.pro └── LICENSE.txt /.gitignore: -------------------------------------------------------------------------------- 1 | release/* 2 | 3 | -------------------------------------------------------------------------------- /resources.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "resources/logo.ico" -------------------------------------------------------------------------------- /tests/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/tests/test.png -------------------------------------------------------------------------------- /resources/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/resources/logo.ico -------------------------------------------------------------------------------- /resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/resources/logo.png -------------------------------------------------------------------------------- /tests/test_alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/tests/test_alpha.png -------------------------------------------------------------------------------- /Linux_Wrapper_Script/NormalmapGenerator: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | export LD_LIBRARY_PATH=. 3 | ./NormalmapGenerator.bin "$@" 4 | -------------------------------------------------------------------------------- /screenshots/tabs/tabs_combined.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/screenshots/tabs/tabs_combined.jpg -------------------------------------------------------------------------------- /Linux_Wrapper_Script/README.txt: -------------------------------------------------------------------------------- 1 | To start the application, open a terminal, navigate to this directory and type ./NormalmapGenerator 2 | -------------------------------------------------------------------------------- /qt_license/ThirdPartySoftware_Listing.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/qt_license/ThirdPartySoftware_Listing.txt -------------------------------------------------------------------------------- /screenshots/KLD_jpg/KLD_enabled_crop_converted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/screenshots/KLD_jpg/KLD_enabled_crop_converted.jpg -------------------------------------------------------------------------------- /stylesheets.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/stylesheets/theme_dark.qss 4 | 5 | 6 | -------------------------------------------------------------------------------- /screenshots/KLD_jpg/KLD_disabled_crop_converted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/screenshots/KLD_jpg/KLD_disabled_crop_converted.jpg -------------------------------------------------------------------------------- /screenshots/KLD_jpg/KLD_enabled_render_converted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/screenshots/KLD_jpg/KLD_enabled_render_converted.jpg -------------------------------------------------------------------------------- /screenshots/KLD_jpg/KLD_disabled_render_converted.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Theverat/NormalmapGenerator/HEAD/screenshots/KLD_jpg/KLD_disabled_render_converted.jpg -------------------------------------------------------------------------------- /src_gui/clickablelabel.h: -------------------------------------------------------------------------------- 1 | #ifndef CLICKABLELABEL_H 2 | #define CLICKABLELABEL_H 3 | 4 | #include 5 | 6 | class ClickableLabel : public QLabel 7 | { 8 | Q_OBJECT 9 | public: 10 | ClickableLabel(QWidget* parent = 0) : QLabel(parent) {} 11 | ClickableLabel(const QString& text = "", QWidget* parent = 0) : QLabel(parent) { 12 | setText(text); 13 | } 14 | ~ClickableLabel() {} 15 | 16 | signals: 17 | void clicked(); 18 | 19 | protected: 20 | void mousePressEvent(QMouseEvent *) { 21 | emit clicked(); 22 | } 23 | }; 24 | 25 | #endif // CLICKABLELABEL_H 26 | -------------------------------------------------------------------------------- /src_gui/listwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef LISTWIDGET_H 2 | #define LISTWIDGET_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | class ListWidget : public QListWidget 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit ListWidget(QWidget *parent = 0); 17 | void dragEnterEvent(QDragEnterEvent* event); 18 | void dragMoveEvent(QDragMoveEvent* event); 19 | void dropEvent(QDropEvent *event); 20 | 21 | signals: 22 | void singleImageDropped(QUrl url); 23 | void multipleImagesDropped(QList urls); 24 | 25 | public slots: 26 | 27 | }; 28 | 29 | #endif // LISTWIDGET_H 30 | -------------------------------------------------------------------------------- /src_gui/listwidget.cpp: -------------------------------------------------------------------------------- 1 | #include "listwidget.h" 2 | 3 | #include 4 | 5 | ListWidget::ListWidget(QWidget *parent) : 6 | QListWidget(parent) 7 | { 8 | } 9 | 10 | void ListWidget::dragEnterEvent(QDragEnterEvent* event) { 11 | event->accept(); 12 | } 13 | 14 | void ListWidget::dragMoveEvent(QDragMoveEvent* event) { 15 | event->accept(); 16 | } 17 | 18 | void ListWidget::dropEvent(QDropEvent *event) { 19 | event->accept(); 20 | 21 | if(event->mimeData()->hasUrls()) { 22 | QList urls = event->mimeData()->urls(); 23 | if(urls.size() == 1) { 24 | emit singleImageDropped(urls.at(0)); 25 | } 26 | else { 27 | emit multipleImagesDropped(urls); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /qt_license/LGPL_EXCEPTION.txt: -------------------------------------------------------------------------------- 1 | Digia Qt LGPL Exception version 1.1 2 | 3 | As an additional permission to the GNU Lesser General Public License version 4 | 2.1, the object code form of a "work that uses the Library" may incorporate 5 | material from a header file that is part of the Library. You may distribute 6 | such object code under terms of your choice, provided that: 7 | (i) the header files of the Library have not been modified; and 8 | (ii) the incorporated material is limited to numerical parameters, data 9 | structure layouts, accessors, macros, inline functions and 10 | templates; and 11 | (iii) you comply with the terms of Section 6 of the GNU Lesser General 12 | Public License version 2.1. 13 | 14 | Moreover, you may apply this exception to a modified version of the Library, 15 | provided that such modification does not involve copying material from the 16 | Library into the modified Library's header files unless such material is 17 | limited to (i) numerical parameters; (ii) data structure layouts; 18 | (iii) accessors; and (iv) small macros, templates and inline functions of 19 | five lines or less in length. 20 | 21 | Furthermore, you are not required to apply this additional permission to a 22 | modified version of the Library. 23 | -------------------------------------------------------------------------------- /xcompile.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Cross-compiling script - generates Win 32bit static binaries 3 | # See https://stackoverflow.com/questions/10934683/how-do-i-configure-qt-for-cross-compilation-from-linux-to-windows-target/13211922#13211922 4 | # I built mxe with "make MXE_TARGETS=x86_64-w64-mingw32.static qt5" 5 | 6 | # Get project name from current folder name 7 | # Has to match with the name of the compiled binaries! 8 | # Set it manually otherwise 9 | PROJECTNAME=${PWD##*/} 10 | 11 | MXE_ROOT="../mxe" 12 | 13 | export PATH=$MXE_ROOT/usr/bin:$PATH 14 | 15 | case "$1" in 16 | release) 17 | echo "Creating RELEASE build" 18 | make clean 19 | 20 | # Create 64 bit build and package it 21 | $MXE_ROOT/usr/bin/x86_64-w64-mingw32.static-qmake-qt5 22 | make -j 8 23 | 24 | cd release 25 | rm ${PROJECTNAME}_win64.zip 26 | zip ${PROJECTNAME}_win64 ${PROJECTNAME}.exe 27 | cd .. 28 | 29 | # Cleanup 30 | make clean 31 | 32 | # Create 32 bit build and package it 33 | $MXE_ROOT/usr/bin/i686-w64-mingw32.static-qmake-qt5 34 | make -j 8 35 | 36 | cd release 37 | rm ${PROJECTNAME}_win32.zip 38 | zip ${PROJECTNAME}_win32 ${PROJECTNAME}.exe 39 | cd .. 40 | 41 | make clean 42 | echo "RELEASE build done." 43 | ;; 44 | *) 45 | echo "Creating DEBUG build" 46 | $MXE_ROOT/usr/bin/x86_64-w64-mingw32.static-qmake-qt5 47 | make -j 8 48 | echo "DEBUG build done." 49 | esac 50 | 51 | 52 | -------------------------------------------------------------------------------- /src_gui/queuemanager.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "queuemanager.h" 23 | 24 | QueueManager::QueueManager(QListWidget *queue) : queue(queue) 25 | { 26 | } 27 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "src_gui/mainwindow.h" 23 | #include 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | QApplication a(argc, argv); 28 | MainWindow w; 29 | w.show(); 30 | 31 | return a.exec(); 32 | } 33 | -------------------------------------------------------------------------------- /src_gui/queueitem.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "queueitem.h" 23 | 24 | QueueItem::QueueItem(QUrl imageUrl, const QString &text, QListWidget *view, int type) 25 | : QListWidgetItem(text, view, type) 26 | { 27 | this->imageUrl = imageUrl; 28 | } 29 | 30 | QUrl QueueItem::getUrl() { 31 | return imageUrl; 32 | } 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### Advertisement 2 | 3 | If you are a Blender user, this addon I created might be interesting for you: 4 | 5 | [![Node Preview Addon](https://www.dropbox.com/s/2nd9jbe89k6bbs4/banner_normalmapgen_github3.png?raw=1)](https://blendermarket.com/products/node-preview) 6 | 7 | 8 | # NormalmapGenerator 9 | 10 | This is a program to generate normal-, spec- and displacementmaps from image textures in one go. It supports stack processing and a few other nice features, but has some rough edges and is still in development. 11 | 12 | ## [Download](https://github.com/Theverat/NormalmapGenerator/releases) 13 | 14 | See the [releases section](https://github.com/Theverat/NormalmapGenerator/releases). 15 | Usually there are Windows (32 bit) and Linux (64 bit) binaries available on each release. 16 | 17 | ## Screenshot 18 | 19 | ![screenshot](screenshots/tabs/tabs_combined.jpg) 20 | 21 | ## Features 22 | 23 | - Fully multithreaded with OpenMP, will use all available CPU cores 24 | - Keep Large Detail (see below for details) 25 | - Fast and easy way to create normal, spec and displacementmaps 26 | 27 | ### Keep Large Detail 28 | 29 | One of the things I hate about classic normalmap generators is how they handle large image textures: usually the normalmap is unusable due to fine detail and the whole information about "large detail" (the overall curvature) is lost. 30 | 31 | This is a large texture generated the classic way: 32 | ![kld_disabled](screenshots/KLD_jpg/KLD_disabled_crop_converted.jpg) 33 | 34 | When used in a rendering, it will look like this: 35 | ![kld_disabled_render](screenshots/KLD_jpg/KLD_disabled_render_converted.jpg) 36 | 37 | What the feature I called "Keep Large Detail" does is that it blends a downscaled version of the image over the original image, thus retaining the overall curvature information while still showing fine detail: 38 | ![kld_enabled](screenshots/KLD_jpg/KLD_enabled_crop_converted.jpg) 39 | 40 | Rendered, it looks much better: 41 | ![kld_enabled_render](screenshots/KLD_jpg/KLD_enabled_render_converted.jpg) 42 | 43 | -------------------------------------------------------------------------------- /src_generators/boxblur.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef BOXBLUR_H 23 | #define BOXBLUR_H 24 | 25 | #include "intensitymap.h" 26 | 27 | class BoxBlur 28 | { 29 | public: 30 | BoxBlur(); 31 | IntensityMap calculate(IntensityMap input, int radius, bool tileable); 32 | 33 | private: 34 | int handleEdges(int iterator, int max, bool tileable); 35 | }; 36 | 37 | #endif // BOXBLUR_H 38 | -------------------------------------------------------------------------------- /src_gui/queueitem.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef QUEUEITEM_H 23 | #define QUEUEITEM_H 24 | 25 | #include 26 | #include 27 | 28 | class QueueItem : public QListWidgetItem 29 | { 30 | public: 31 | QueueItem(QUrl imageUrl, const QString &text, QListWidget *view, int type); 32 | QUrl getUrl(); 33 | 34 | private: 35 | QUrl imageUrl; 36 | 37 | }; 38 | 39 | #endif // QUEUEITEM_H 40 | -------------------------------------------------------------------------------- /src_gui/queuemanager.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef QUEUEMANAGER_H 23 | #define QUEUEMANAGER_H 24 | 25 | #include 26 | #include 27 | 28 | // TODO 29 | 30 | class QueueManager 31 | { 32 | public: 33 | QueueManager(QListWidget *queue); 34 | void processQueue(QDir exportPath); 35 | 36 | public slots: 37 | void stopProcessingQueue(); 38 | 39 | private: 40 | QListWidget *queue; 41 | }; 42 | 43 | #endif // QUEUEMANAGER_H 44 | -------------------------------------------------------------------------------- /src_gui/graphicsscene.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef MYQGRAPHICSSCENE_H 23 | #define MYQGRAPHICSSCENE_H 24 | 25 | #include 26 | 27 | class GraphicsScene : public QGraphicsScene 28 | { 29 | public: 30 | GraphicsScene(QObject *parent = 0); 31 | GraphicsScene(const QRectF &sceneRect, QObject *parent = 0); 32 | GraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent = 0); 33 | }; 34 | 35 | #endif // MYQGRAPHICSSCENE_H 36 | -------------------------------------------------------------------------------- /src_gui/graphicsscene.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "graphicsscene.h" 23 | #include 24 | 25 | GraphicsScene::GraphicsScene(QObject *parent) 26 | : QGraphicsScene(parent) 27 | { 28 | } 29 | 30 | GraphicsScene::GraphicsScene(const QRectF &sceneRect, QObject *parent) 31 | : QGraphicsScene(sceneRect, parent) 32 | { 33 | } 34 | 35 | GraphicsScene::GraphicsScene(qreal x, qreal y, qreal width, qreal height, QObject *parent) 36 | : QGraphicsScene(x, y, width, height, parent) 37 | { 38 | } 39 | -------------------------------------------------------------------------------- /src_generators/specularmapgenerator.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef SPECULARMAPGENERATOR_H 23 | #define SPECULARMAPGENERATOR_H 24 | 25 | #include "intensitymap.h" 26 | 27 | class SpecularmapGenerator 28 | { 29 | public: 30 | SpecularmapGenerator(IntensityMap::Mode mode, double redMultiplier, double greenMultiplier, double blueMultiplier, double alphaMultiplier); 31 | QImage calculateSpecmap(const QImage& input, double scale, double contrast); 32 | 33 | private: 34 | double redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier; 35 | IntensityMap::Mode mode; 36 | }; 37 | 38 | #endif // SPECULARMAPGENERATOR_H 39 | -------------------------------------------------------------------------------- /src_gui/aboutdialog.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef ABOUTDIALOG_H 23 | #define ABOUTDIALOG_H 24 | 25 | #include 26 | #include "mainwindow.h" 27 | 28 | namespace Ui { 29 | class AboutDialog; 30 | } 31 | 32 | class AboutDialog : public QDialog 33 | { 34 | Q_OBJECT 35 | 36 | public: 37 | explicit AboutDialog(QWidget *parent = 0, MainWindow *mainwindow = 0); 38 | ~AboutDialog(); 39 | 40 | private: 41 | MainWindow *mainwindow; 42 | Ui::AboutDialog *ui; 43 | 44 | private slots: 45 | void openSourcecodeLink(); 46 | void openLatestVersionLink(); 47 | void showMainColorDialog(); 48 | void showTextColorDialog(); 49 | void showGraphicsViewColorDialog(); 50 | }; 51 | 52 | #endif // ABOUTDIALOG_H 53 | -------------------------------------------------------------------------------- /src_generators/ssaogenerator.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef SSAOGENERATOR_H 23 | #define SSAOGENERATOR_H 24 | 25 | #include "intensitymap.h" 26 | #include 27 | 28 | //code is based on http://john-chapman-graphics.blogspot.de/2013/01/ssao-tutorial.html 29 | class SsaoGenerator 30 | { 31 | public: 32 | SsaoGenerator(); 33 | QImage calculateSsaomap(QImage normalmap, QImage depthmap, float radius, unsigned int kernelSamples, unsigned int noiseSize); 34 | 35 | private: 36 | std::vector generateKernel(unsigned int size); 37 | std::vector generateNoise(unsigned int size); 38 | 39 | double random(double min, double max); 40 | float lerp(float v0, float v1, float t); 41 | }; 42 | 43 | #endif // SSAOGENERATOR_H 44 | -------------------------------------------------------------------------------- /src_gui/graphicsview.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef GRAPHICSVIEW_H 23 | #define GRAPHICSVIEW_H 24 | 25 | #include 26 | #include 27 | 28 | class GraphicsView : public QGraphicsView 29 | { 30 | Q_OBJECT 31 | 32 | public: 33 | GraphicsView(QGraphicsScene *scene, QWidget *parent = 0); 34 | GraphicsView(QWidget *parent = 0); 35 | void dragEnterEvent(QDragEnterEvent* event); 36 | void dragMoveEvent(QDragMoveEvent* event); 37 | void dropEvent(QDropEvent* event); 38 | void mouseReleaseEvent(QMouseEvent* event); 39 | void wheelEvent(QWheelEvent *event); 40 | 41 | signals: 42 | void singleImageDropped(QUrl url); 43 | void multipleImagesDropped(QList urls); 44 | void rightClick(); 45 | void middleClick(); 46 | void zoomIn(); 47 | void zoomOut(); 48 | }; 49 | 50 | #endif // GRAPHICSVIEW_H 51 | -------------------------------------------------------------------------------- /src_generators/gaussianblur.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef GAUSSIANBLUR_H 23 | #define GAUSSIANBLUR_H 24 | 25 | #include "intensitymap.h" 26 | 27 | class GaussianBlur 28 | { 29 | public: 30 | GaussianBlur(); 31 | IntensityMap calculate(IntensityMap& input, double radius, bool tileable); 32 | 33 | private: 34 | std::vector boxesForGauss(double sigma, int n); 35 | void gaussBlur(IntensityMap &input, IntensityMap &result, double radius, bool tileable); 36 | void boxBlur(IntensityMap &input, IntensityMap &result, double radius, bool tileable); 37 | void boxBlurH(IntensityMap &input, IntensityMap &result, double radius, bool tileable); 38 | void boxBlurT(IntensityMap &input, IntensityMap &result, double radius, bool tileable); 39 | int handleEdges(int iterator, int max, bool tileable) const; 40 | }; 41 | 42 | #endif // GAUSSIANBLUR_H 43 | -------------------------------------------------------------------------------- /src_generators/intensitymap.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef INTENSITYMAP_H 23 | #define INTENSITYMAP_H 24 | 25 | #include 26 | 27 | class IntensityMap 28 | { 29 | public: 30 | enum Mode { 31 | AVERAGE, 32 | MAX 33 | }; 34 | 35 | IntensityMap(); 36 | IntensityMap(int width, int height); 37 | IntensityMap(const QImage &rgbImage, Mode mode, double redMultiplier = 1.0, double greenMultiplier = 1.0, 38 | double blueMultiplier = 1.0, double alphaMultiplier = 0.0); 39 | double at(int x, int y) const; 40 | double at(int pos) const; 41 | void setValue(int x, int y, double value); 42 | void setValue(int pos, double value); 43 | size_t getWidth() const; 44 | size_t getHeight() const; 45 | void invert(); 46 | QImage convertToQImage() const; 47 | 48 | private: 49 | std::vector< std::vector > map; 50 | }; 51 | 52 | #endif // INTENSITYMAP_H 53 | -------------------------------------------------------------------------------- /resources/stylesheets/theme_dark.qss: -------------------------------------------------------------------------------- 1 | 2 | /* Color codenames that will be replaced with actual colors by MainWindow::setUiColors() 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | */ 11 | 12 | /* global colors */ 13 | QWidget { 14 | background-color: ; 15 | color: ; 16 | } 17 | 18 | /**************************************************/ 19 | 20 | QGraphicsView { 21 | background-color: ; 22 | } 23 | 24 | /**************************************************/ 25 | 26 | QComboBox { 27 | padding: 1px 0px 1px 3px; /*This makes text color work*/ 28 | } 29 | 30 | /**************************************************/ 31 | 32 | QPushButton { 33 | background-color: ; 34 | border-radius: 4px; 35 | padding: 4px; 36 | } 37 | 38 | QPushButton:hover { 39 | background-color: ; 40 | } 41 | 42 | QPushButton:disabled { 43 | background-color: ; 44 | } 45 | 46 | QPushButton:pressed { 47 | background-color: ; 48 | } 49 | 50 | /**************************************************/ 51 | 52 | QDoubleSpinBox { 53 | background-color: ; 54 | border: 1px solid none; 55 | } 56 | 57 | QDoubleSpinBox::up-arrow { 58 | } 59 | 60 | QDoubleSpinBox::down-arrow { 61 | } 62 | 63 | /**************************************************/ 64 | 65 | QSpinBox { 66 | background-color: ; 67 | border: 1px solid none; 68 | } 69 | 70 | QSpinBox::up-arrow { 71 | } 72 | 73 | QSpinBox::down-arrow { 74 | } 75 | 76 | /**************************************************/ 77 | 78 | 79 | QTabWidget::pane { 80 | border-top-left-radius: 4px; 81 | border-top-right-radius: 4px; 82 | 83 | border-top: 2px solid ; 84 | border-left: 2px solid ; 85 | border-right: 2px solid ; 86 | border-bottom: 2px solid ; 87 | } 88 | 89 | 90 | QTabBar::tab { 91 | background-color: ; 92 | 93 | border: 2px solid ; 94 | border-bottom: 1 px solid none; 95 | border-top-left-radius: 4px; 96 | border-top-right-radius: 4px; 97 | min-width: 8ex; 98 | padding: 2px; 99 | } 100 | 101 | QTabBar::tab:hover { 102 | background-color: ; 103 | } 104 | 105 | QTabBar::tab:selected { 106 | color: ; 107 | background-color: ; 108 | 109 | border-color: ; 110 | /*border-bottom-color: ;*/ 111 | } 112 | 113 | QTabBar::tab:!selected { 114 | margin-top: 6px; /* make non-selected tabs look smaller */ 115 | } 116 | /**************************************************/ 117 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /src_generators/normalmapgenerator.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef SOBEL_H 23 | #define SOBEL_H 24 | 25 | #include 26 | #include "intensitymap.h" 27 | 28 | class NormalmapGenerator 29 | { 30 | public: 31 | enum Kernel { 32 | SOBEL, 33 | PREWITT 34 | }; 35 | 36 | NormalmapGenerator(IntensityMap::Mode mode, double redMultiplier, double greenMultiplier, 37 | double blueMultiplier, double alphaMultiplier); 38 | QImage calculateNormalmap(const QImage& input, Kernel kernel, double strength = 2.0, bool invert = false, 39 | bool tileable = true, bool keepLargeDetail = true, 40 | int largeDetailScale = 25, double largeDetailHeight = 1.0); 41 | const IntensityMap& getIntensityMap() const; 42 | 43 | private: 44 | IntensityMap intensity; 45 | bool tileable; 46 | double redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier; 47 | IntensityMap::Mode mode; 48 | 49 | int handleEdges(int iterator, int maxValue) const; 50 | int mapComponent(double value) const; 51 | QVector3D sobel(const double convolution_kernel[3][3], double strengthInv) const; 52 | QVector3D prewitt(const double convolution_kernel[3][3], double strengthInv) const; 53 | int blendSoftLight(int color1, int color2) const; 54 | }; 55 | 56 | #endif // SOBEL_H 57 | -------------------------------------------------------------------------------- /NormalmapGenerator.pro: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Copyright (C) 2015 by Simon Wendsche # 3 | # # 4 | # This file is part of NormalmapGenerator. # 5 | # # 6 | # NormalmapGenerator is free software; you can redistribute it and/or modify # 7 | # it under the terms of the GNU General Public License as published by # 8 | # the Free Software Foundation; either version 3 of the License, or # 9 | # (at your option) any later version. # 10 | # # 11 | # NormalmapGenerator is distributed in the hope that it will be useful, # 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 14 | # GNU General Public License for more details. # 15 | # # 16 | # You should have received a copy of the GNU General Public License # 17 | # along with this program. If not, see . # 18 | # # 19 | # Sourcecode: https://github.com/Theverat/NormalmapGenerator # 20 | ################################################################################ 21 | 22 | QT += core gui 23 | 24 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 25 | 26 | TARGET = NormalmapGenerator 27 | TEMPLATE = app 28 | 29 | QMAKE_CXXFLAGS += -fopenmp -std=c++11 30 | LIBS += -fopenmp 31 | 32 | SOURCES += main.cpp\ 33 | src_gui/mainwindow.cpp \ 34 | src_generators/intensitymap.cpp \ 35 | src_generators/normalmapgenerator.cpp \ 36 | src_generators/specularmapgenerator.cpp \ 37 | src_gui/graphicsscene.cpp \ 38 | src_gui/graphicsview.cpp \ 39 | src_gui/queueitem.cpp \ 40 | src_gui/queuemanager.cpp \ 41 | src_generators/gaussianblur.cpp \ 42 | src_generators/boxblur.cpp \ 43 | src_generators/ssaogenerator.cpp \ 44 | src_gui/aboutdialog.cpp \ 45 | src_gui/listwidget.cpp 46 | 47 | HEADERS += src_gui/mainwindow.h \ 48 | src_generators/intensitymap.h \ 49 | src_generators/normalmapgenerator.h \ 50 | src_generators/specularmapgenerator.h \ 51 | src_gui/graphicsscene.h \ 52 | src_gui/graphicsview.h \ 53 | src_gui/queueitem.h \ 54 | src_gui/queuemanager.h \ 55 | src_generators/gaussianblur.h \ 56 | src_generators/boxblur.h \ 57 | src_generators/ssaogenerator.h \ 58 | src_gui/aboutdialog.h \ 59 | src_gui/listwidget.h \ 60 | src_gui/clickablelabel.h 61 | 62 | FORMS += src_gui/mainwindow.ui \ 63 | src_gui/aboutdialog.ui 64 | 65 | win32:RC_FILE = resources.rc 66 | 67 | RESOURCES += \ 68 | stylesheets.qrc 69 | 70 | target.path = /usr/local/bin 71 | INSTALLS += target 72 | -------------------------------------------------------------------------------- /src_gui/graphicsview.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "graphicsview.h" 23 | #include 24 | #include 25 | #include 26 | 27 | GraphicsView::GraphicsView(QGraphicsScene *scene, QWidget *parent) : QGraphicsView(scene, parent) 28 | { 29 | } 30 | 31 | GraphicsView::GraphicsView(QWidget *parent) : QGraphicsView(parent) 32 | { 33 | } 34 | 35 | void GraphicsView::dragEnterEvent(QDragEnterEvent* event) { 36 | QGraphicsView::dragEnterEvent(event); 37 | } 38 | 39 | void GraphicsView::dragMoveEvent(QDragMoveEvent* event) { 40 | QGraphicsView::dragMoveEvent(event); 41 | } 42 | 43 | void GraphicsView::dropEvent(QDropEvent* event) { 44 | QGraphicsView::dropEvent(event); 45 | 46 | if(event->mimeData()->hasUrls()) { 47 | QList urls = event->mimeData()->urls(); 48 | if(urls.size() == 1) { 49 | emit singleImageDropped(urls.at(0)); 50 | } 51 | else { 52 | emit multipleImagesDropped(urls); 53 | } 54 | } 55 | } 56 | 57 | void GraphicsView::mouseReleaseEvent(QMouseEvent *event) { 58 | QGraphicsView::mouseReleaseEvent(event); 59 | 60 | if(event->button() == Qt::RightButton) { 61 | //rightclick -> reset image scale to 1:1 62 | emit rightClick(); 63 | } 64 | else if(event->button() == Qt::MiddleButton) { 65 | //middle click -> fit image to view 66 | emit middleClick(); 67 | } 68 | } 69 | 70 | void GraphicsView::wheelEvent(QWheelEvent *event) { 71 | if(event->delta() > 0) { 72 | emit zoomIn(); 73 | } 74 | else { 75 | emit zoomOut(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src_generators/boxblur.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "boxblur.h" 23 | 24 | #include 25 | 26 | BoxBlur::BoxBlur() 27 | { 28 | } 29 | 30 | IntensityMap BoxBlur::calculate(IntensityMap input, int radius, bool tileable) { 31 | IntensityMap result = IntensityMap(input.getWidth(), input.getHeight()); 32 | 33 | int kernelPixelAmount = (2 * radius + 1) * (2 * radius + 1); 34 | 35 | #pragma omp parallel for // OpenMP 36 | for(size_t y = 0; y < input.getHeight(); y++) { 37 | for(size_t x = 0; x < input.getWidth(); x++) { 38 | float sum = 0.0; 39 | 40 | //blur kernel loops 41 | for(int i = -radius; i < radius; i++) { 42 | for(int k = -radius; k < radius; k++) { 43 | int posY = handleEdges(y + i, input.getHeight(), tileable); 44 | int posX = handleEdges(x + k, input.getWidth(), tileable); 45 | 46 | sum += input.at(posX, posY); 47 | } 48 | } 49 | 50 | //normalize sum 51 | sum /= kernelPixelAmount; 52 | 53 | result.setValue(x, y, sum); 54 | } 55 | } 56 | 57 | return result; 58 | } 59 | 60 | int BoxBlur::handleEdges(int iterator, int max, bool tileable) { 61 | if(iterator < 0) { 62 | if(tileable) { 63 | int corrected = max + iterator; 64 | //failsafe, e.g. if filter size is larger than image size 65 | return handleEdges(corrected, max, false); 66 | } 67 | else { 68 | return 0; 69 | } 70 | } 71 | 72 | if(iterator >= max) { 73 | if(tileable) { 74 | int corrected = iterator - max; 75 | //failsafe, e.g. if filter size is larger than image size 76 | return handleEdges(corrected, max, false); 77 | } 78 | else { 79 | return max - 1; 80 | } 81 | } 82 | 83 | return iterator; 84 | } 85 | -------------------------------------------------------------------------------- /src_gui/aboutdialog.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "aboutdialog.h" 23 | #include "ui_aboutdialog.h" 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | 30 | AboutDialog::AboutDialog(QWidget *parent, MainWindow *mainwindow) : 31 | QDialog(parent), 32 | mainwindow(mainwindow), 33 | ui(new Ui::AboutDialog) 34 | { 35 | ui->setupUi(this); 36 | 37 | connect(ui->pushButton_sourcecode, SIGNAL(clicked()), this, SLOT(openSourcecodeLink())); 38 | connect(ui->pushButton_latestVersion, SIGNAL(clicked()), this, SLOT(openLatestVersionLink())); 39 | 40 | connect(ui->radioButton_useCustomColors, SIGNAL(toggled(bool)), mainwindow, SLOT(setUseCustomUiColors(bool))); 41 | connect(ui->pushButton_mainColor, SIGNAL(clicked()), this, SLOT(showMainColorDialog())); 42 | connect(ui->pushButton_textColor, SIGNAL(clicked()), this, SLOT(showTextColorDialog())); 43 | connect(ui->pushButton_graphicsViewColor, SIGNAL(clicked()), this, SLOT(showGraphicsViewColorDialog())); 44 | connect(ui->pushButton_resetColorsToDefault, SIGNAL(clicked()), mainwindow, SLOT(resetUiColors())); 45 | 46 | ui->radioButton_useCustomColors->setChecked(mainwindow->getUseCustomUiColors()); 47 | } 48 | 49 | AboutDialog::~AboutDialog() 50 | { 51 | delete ui; 52 | } 53 | 54 | void AboutDialog::openSourcecodeLink() { 55 | QDesktopServices::openUrl(QUrl("https://github.com/Theverat/NormalmapGenerator")); 56 | } 57 | 58 | void AboutDialog::openLatestVersionLink() { 59 | QDesktopServices::openUrl(QUrl("https://github.com/Theverat/NormalmapGenerator/releases")); 60 | } 61 | 62 | void AboutDialog::showMainColorDialog() { 63 | QColorDialog *colorDialog = new QColorDialog(mainwindow->getUiColorMain(), this); 64 | connect(colorDialog, SIGNAL(currentColorChanged(QColor)), mainwindow, SLOT(setUiColorMain(QColor))); 65 | colorDialog->show(); 66 | } 67 | 68 | void AboutDialog::showTextColorDialog() { 69 | QColorDialog *colorDialog = new QColorDialog(mainwindow->getUiColorText(), this); 70 | connect(colorDialog, SIGNAL(currentColorChanged(QColor)), mainwindow, SLOT(setUiColorText(QColor))); 71 | colorDialog->show(); 72 | } 73 | 74 | void AboutDialog::showGraphicsViewColorDialog() { 75 | QColorDialog *colorDialog = new QColorDialog(mainwindow->getUiColorGraphicsView(), this); 76 | connect(colorDialog, SIGNAL(currentColorChanged(QColor)), mainwindow, SLOT(setUiColorGraphicsView(QColor))); 77 | colorDialog->show(); 78 | } 79 | -------------------------------------------------------------------------------- /src_generators/specularmapgenerator.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "specularmapgenerator.h" 23 | #include 24 | 25 | SpecularmapGenerator::SpecularmapGenerator(IntensityMap::Mode mode, double redMultiplier, double greenMultiplier, double blueMultiplier, double alphaMultiplier) 26 | { 27 | this->mode = mode; 28 | this->redMultiplier = redMultiplier; 29 | this->greenMultiplier = greenMultiplier; 30 | this->blueMultiplier = blueMultiplier; 31 | this->alphaMultiplier = alphaMultiplier; 32 | } 33 | 34 | QImage SpecularmapGenerator::calculateSpecmap(const QImage &input, double scale, double contrast) { 35 | QImage result(input.width(), input.height(), QImage::Format_ARGB32); 36 | 37 | //generate contrast lookup table 38 | unsigned short contrastLookup[256]; 39 | double newValue = 0; 40 | 41 | for(int i = 0; i < 256; i++) { 42 | newValue = (double)i; 43 | newValue /= 255.0; 44 | newValue -= 0.5; 45 | newValue *= contrast; 46 | newValue += 0.5; 47 | newValue *= 255; 48 | 49 | if(newValue < 0) 50 | newValue = 0; 51 | if(newValue > 255) 52 | newValue = 255; 53 | 54 | contrastLookup[i] = (unsigned short)newValue; 55 | } 56 | 57 | // This is outside of the loop because the multipliers are the same for every pixel 58 | double multiplierSum = ((redMultiplier != 0.0) + (greenMultiplier != 0.0) + 59 | (blueMultiplier != 0.0) + (alphaMultiplier != 0.0)); 60 | if(multiplierSum == 0.0) 61 | multiplierSum = 1.0; 62 | 63 | #pragma omp parallel for // OpenMP 64 | //for every row of the image 65 | for(int y = 0; y < result.height(); y++) { 66 | QRgb *scanline = (QRgb*) result.scanLine(y); 67 | 68 | //for every column of the image 69 | for(int x = 0; x < result.width(); x++) { 70 | double intensity = 0.0; 71 | 72 | const QColor pxColor = QColor(input.pixel(x, y)); 73 | 74 | const double r = pxColor.redF() * redMultiplier; 75 | const double g = pxColor.greenF() * greenMultiplier; 76 | const double b = pxColor.blueF() * blueMultiplier; 77 | const double a = pxColor.alphaF() * alphaMultiplier; 78 | 79 | if(mode == IntensityMap::AVERAGE) { 80 | //take the average out of all selected channels 81 | intensity = (r + g + b + a) / multiplierSum; 82 | } 83 | else if(mode == IntensityMap::MAX) { 84 | //take the maximum out of all selected channels 85 | const double tempMaxRG = std::max(r, g); 86 | const double tempMaxBA = std::max(b, a); 87 | intensity = std::max(tempMaxRG, tempMaxBA); 88 | } 89 | 90 | //apply scale (brightness) 91 | intensity *= scale; 92 | 93 | //clamp 94 | if(intensity > 1.0) 95 | intensity = 1.0; 96 | 97 | //convert intensity to the 0-255 range 98 | int c = (int)(255.0 * intensity); 99 | 100 | //apply contrast 101 | c = (int)contrastLookup[c]; 102 | 103 | //write color into image pixel 104 | scanline[x] = qRgba(c, c, c, pxColor.alpha()); 105 | } 106 | } 107 | 108 | return result; 109 | } 110 | -------------------------------------------------------------------------------- /src_gui/mainwindow.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #ifndef MAINWINDOW_H 23 | #define MAINWINDOW_H 24 | 25 | #include 26 | #include 27 | #include "queueitem.h" 28 | #include "src_generators/intensitymap.h" 29 | 30 | namespace Ui { 31 | class MainWindow; 32 | } 33 | 34 | class MainWindow : public QMainWindow 35 | { 36 | Q_OBJECT 37 | 38 | public: 39 | enum Channel { 40 | RED, 41 | GREEN, 42 | BLUE, 43 | ALPHA 44 | }; 45 | 46 | explicit MainWindow(QWidget *parent = 0); 47 | void closeEvent(QCloseEvent* event); 48 | ~MainWindow(); 49 | bool getUseCustomUiColors(); 50 | QColor getUiColorMain(); 51 | QColor getUiColorText(); 52 | QColor getUiColorGraphicsView(); 53 | 54 | public slots: 55 | void setUseCustomUiColors(bool value); 56 | void setUiColorMain(QColor value); 57 | void setUiColorText(QColor value); 58 | void setUiColorGraphicsView(QColor value); 59 | void resetUiColors(); 60 | 61 | private: 62 | Ui::MainWindow *ui; 63 | QImage input; 64 | QImage channelIntensity; 65 | QImage normalmap; 66 | QImage specmap; 67 | QImage displacementmap; 68 | QImage ssaomap; 69 | QImage normalmapRawIntensity; 70 | QUrl loadedImagePath; 71 | QUrl exportPath; 72 | int lastCalctime_normal; 73 | int lastCalctime_specular; 74 | int lastCalctime_displace; 75 | int lastCalctime_ssao; 76 | bool stopQueue; 77 | QStringList supportedImageformats; 78 | bool useCustomUiColors; 79 | QColor uiColorMainDefault; 80 | QColor uiColorTextDefault; 81 | QColor uiColorGraphicsViewDefault; 82 | QColor uiColorMain; 83 | QColor uiColorText; 84 | QColor uiColorGraphicsView; 85 | 86 | bool setExportPath(QUrl path); 87 | void calcNormal(); 88 | void calcSpec(); 89 | void calcDisplace(); 90 | void calcSsao(); 91 | QString generateElapsedTimeMsg(int calcTimeMs, QString mapType); 92 | void connectSignalSlots(); 93 | void hideAdvancedSettings(); 94 | void displayCalcTime(int calcTime_ms, QString mapType, int duration_ms); 95 | void enableAutoupdate(bool on); 96 | void addImageToQueue(QUrl url); 97 | void addImageToQueue(QList urls); 98 | void saveQueueProcessed(QUrl folderPath); 99 | void save(QUrl url); 100 | bool load(QUrl url); 101 | void loadAllFromDir(QUrl url); 102 | int calcPercentage(int value, int percentage); 103 | void setUiColors(); 104 | void writeSettings(); 105 | void readSettings(); 106 | 107 | private slots: 108 | void loadUserFilePath(); 109 | void loadSingleDropped(QUrl url); 110 | void loadMultipleDropped(QList urls); 111 | void calcNormalAndPreview(); 112 | void calcSpecAndPreview(); 113 | void calcDisplaceAndPreview(); 114 | void calcSsaoAndPreview(); 115 | void processQueue(); 116 | void stopProcessingQueue(); 117 | void saveUserFilePath(); 118 | void preview(); 119 | void preview(int tab); 120 | void switchToTab1(); 121 | void switchToTab2(); 122 | void switchToTab3(); 123 | void switchToTab4(); 124 | void zoomIn(); 125 | void zoomOut(); 126 | void resetZoom(); 127 | void fitInView(); 128 | void autoUpdate(); 129 | void displayChannelIntensity(); 130 | void openExportFolder(); 131 | void removeImagesFromQueue(); 132 | void changeOutputPathQueueDialog(); 133 | void editOutputPathQueue(); 134 | void queueItemDoubleClicked(QListWidgetItem *item); 135 | void normalmapSizeChanged(); 136 | void showAboutDialog(); 137 | }; 138 | 139 | #endif // MAINWINDOW_H 140 | -------------------------------------------------------------------------------- /src_generators/gaussianblur.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "gaussianblur.h" 23 | #include 24 | #include 25 | 26 | GaussianBlur::GaussianBlur() 27 | { 28 | } 29 | 30 | IntensityMap GaussianBlur::calculate(IntensityMap &input, double radius, bool tileable) { 31 | IntensityMap result = IntensityMap(input.getWidth(), input.getHeight()); 32 | 33 | gaussBlur(input, result, radius, tileable); 34 | 35 | return result; 36 | } 37 | 38 | // Gaussian blur implementation adapted from http://blog.ivank.net/fastest-gaussian-blur.html 39 | // "Algorithm 3" was used because I could not adapt "Algorithm 4" to be tileable 40 | 41 | void GaussianBlur::gaussBlur(IntensityMap &input, IntensityMap &result, double radius, bool tileable) { 42 | std::vector boxes = boxesForGauss(radius, 3); 43 | 44 | boxBlur(input, result, ((boxes.at(0) - 1) / 2), tileable); 45 | boxBlur(result, input, ((boxes.at(1) - 1) / 2), tileable); 46 | boxBlur(input, result, ((boxes.at(2) - 1) / 2), tileable); 47 | } 48 | 49 | std::vector GaussianBlur::boxesForGauss(double sigma, int n) { 50 | double wIdeal = sqrt((12 * sigma * sigma / n) + 1); 51 | int wl = floor(wIdeal); 52 | 53 | if(wl % 2 == 0) 54 | wl--; 55 | 56 | const int wu = wl + 2; 57 | 58 | const double mIdeal = (12 * sigma * sigma - n * wl * wl - 4 * n * wl - 3 * n) / (-4 * wl - 4); 59 | const int m = round(mIdeal); 60 | 61 | std::vector sizes; 62 | 63 | for(int i = 0; i < n; i++) { 64 | sizes.push_back(i < m ? wl : wu); 65 | } 66 | 67 | return sizes; 68 | } 69 | 70 | void GaussianBlur::boxBlur(IntensityMap &input, IntensityMap &result, double radius, bool tileable) { 71 | for(size_t i = 0; i < input.getWidth() * input.getHeight(); i++) { 72 | result.setValue(i, input.at(i)); 73 | } 74 | 75 | boxBlurH(result, input, radius, tileable); 76 | boxBlurT(input, result, radius, tileable); 77 | } 78 | 79 | void GaussianBlur::boxBlurH(IntensityMap &input, IntensityMap &result, double radius, bool tileable) { 80 | const int width = input.getWidth(); 81 | const int height = input.getHeight(); 82 | 83 | #pragma omp parallel for // OpenMP 84 | for(int i = 0; i < height; i++) { 85 | for(int j = 0; j < width; j++) { 86 | double val = 0.0; 87 | 88 | for(int ix = j - radius; ix < j + radius + 1; ix++) { 89 | const int x = handleEdges(ix, width, tileable); 90 | val += input.at(x, i); 91 | } 92 | 93 | result.setValue(j, i, val / (radius + radius + 1)); 94 | } 95 | } 96 | } 97 | 98 | void GaussianBlur::boxBlurT(IntensityMap &input, IntensityMap &result, double radius, bool tileable) { 99 | const int width = input.getWidth(); 100 | const int height = input.getHeight(); 101 | 102 | #pragma omp parallel for // OpenMP 103 | for(int i = 0; i < height; i++) { 104 | for(int j = 0; j < width; j++) { 105 | double val = 0.0; 106 | 107 | for(int iy = i - radius; iy < i + radius + 1; iy++) { 108 | const int y = handleEdges(iy, height, tileable); 109 | val += input.at(j, y); 110 | } 111 | 112 | result.setValue(j, i, val / (radius + radius + 1)); 113 | } 114 | } 115 | } 116 | 117 | int GaussianBlur::handleEdges(int iterator, int max, bool tileable) const { 118 | if(iterator < 0) { 119 | if(tileable) { 120 | int corrected = max + iterator; 121 | //failsafe, e.g. if filter size is larger than image size 122 | return handleEdges(corrected, max, false); 123 | } 124 | else { 125 | return 0; 126 | } 127 | } 128 | 129 | if(iterator >= max) { 130 | if(tileable) { 131 | int corrected = iterator - max; 132 | //failsafe, e.g. if filter size is larger than image size 133 | return handleEdges(corrected, max, false); 134 | } 135 | else { 136 | return max - 1; 137 | } 138 | } 139 | 140 | return iterator; 141 | } 142 | -------------------------------------------------------------------------------- /src_generators/ssaogenerator.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "ssaogenerator.h" 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | SsaoGenerator::SsaoGenerator() { 29 | } 30 | 31 | QImage SsaoGenerator::calculateSsaomap(QImage normalmap, QImage depthmap, float radius, unsigned int kernelSamples, unsigned int noiseSize) { 32 | QImage result(normalmap.width(), normalmap.height(), QImage::Format_ARGB32); 33 | std::vector kernel = generateKernel(kernelSamples); 34 | std::vector noiseTexture = generateNoise(noiseSize); 35 | 36 | #pragma omp parallel for // OpenMP 37 | for(int y = 0; y < normalmap.height(); y++) { 38 | QRgb *scanline = (QRgb*) result.scanLine(y); 39 | 40 | for(int x = 0; x < normalmap.width(); x++) { 41 | QVector3D origin(x, y, 1.0); 42 | 43 | float r = QColor(normalmap.pixel(x, y)).redF(); 44 | float g = QColor(normalmap.pixel(x, y)).greenF(); 45 | float b = QColor(normalmap.pixel(x, y)).blueF(); 46 | QVector3D normal(r, g, b); 47 | 48 | //reorient the kernel along the normal 49 | //get random vector from noise texture 50 | QVector3D randVec = noiseTexture.at((int)random(0, noiseTexture.size() - 1)); 51 | 52 | QVector3D tangent = (randVec - normal * QVector3D::dotProduct(randVec, normal)).normalized(); 53 | QVector3D bitangent = QVector3D::crossProduct(normal, tangent); 54 | QMatrix4x4 transformMatrix = QMatrix4x4(tangent.x(), bitangent.x(), normal.x(), 0, 55 | tangent.y(), bitangent.y(), normal.y(), 0, 56 | tangent.z(), bitangent.z(), normal.z(), 0, 57 | 0, 0, 0, 0); 58 | 59 | float occlusion = 0.0; 60 | 61 | for(unsigned int i = 0; i < kernel.size(); i++) { 62 | //get sample position 63 | QVector3D sample = transformMatrix * kernel[i]; 64 | sample = (sample * radius) + origin; 65 | 66 | //get sample depth 67 | float sampleDepth = QColor(depthmap.pixel(x, y)).redF(); 68 | 69 | //range check and accumulate 70 | float rangeCheck = fabs(origin.z() - sampleDepth) < radius ? 1.0 : 0.0; 71 | occlusion += (sampleDepth <= sample.z() ? 1.0 : 0.0) * rangeCheck; 72 | } 73 | 74 | //normalize and invert occlusion factor 75 | occlusion = occlusion / kernel.size(); 76 | 77 | //convert occlusion to the 0-255 range 78 | int c = (int)(255.0 * occlusion); 79 | //write result 80 | scanline[x] = qRgba(c, c, c, 255); 81 | } 82 | } 83 | 84 | return result; 85 | } 86 | 87 | std::vector SsaoGenerator::generateKernel(unsigned int size) { 88 | std::vector kernel = std::vector(size, QVector3D()); 89 | 90 | //generate hemisphere 91 | for (unsigned int i = 0; i < size; i++) { 92 | //points on surface of a hemisphere 93 | kernel[i] = QVector3D(random(-1.0, 1.0), random(-1.0, 1.0), random(0.0, 1.0)).normalized(); 94 | //scale into the hemisphere 95 | kernel[i] *= random(0.0, 1.0); 96 | //generate falloff 97 | float scale = float(i) / float(size); 98 | scale = lerp(0.1f, 1.0f, scale * scale); 99 | kernel[i] *= scale; 100 | } 101 | 102 | return kernel; 103 | } 104 | 105 | std::vector SsaoGenerator::generateNoise(unsigned int size) { 106 | std::vector noise = std::vector(size, QVector3D()); 107 | 108 | for (unsigned int i = 0; i < size; i++) { 109 | noise[i] = QVector3D(random(-1.0, 1.0), random(-1.0, 1.0), 0.0).normalized(); 110 | } 111 | 112 | return noise; 113 | } 114 | 115 | double SsaoGenerator::random(double min, double max) { 116 | double f = (double)rand() / RAND_MAX; 117 | return min + f * (max - min); 118 | } 119 | 120 | float SsaoGenerator::lerp(float v0, float v1, float t) { 121 | return (1 - t) * v0 + t * v1; 122 | } 123 | -------------------------------------------------------------------------------- /src_generators/intensitymap.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "intensitymap.h" 23 | #include 24 | #include 25 | 26 | IntensityMap::IntensityMap() { 27 | 28 | } 29 | 30 | IntensityMap::IntensityMap(int width, int height) { 31 | map = std::vector< std::vector >(height, std::vector(width, 0.0)); 32 | } 33 | 34 | IntensityMap::IntensityMap(const QImage& rgbImage, Mode mode, double redMultiplier, double greenMultiplier, 35 | double blueMultiplier, double alphaMultiplier) 36 | { 37 | map = std::vector< std::vector >(rgbImage.height(), std::vector(rgbImage.width(), 0.0)); 38 | 39 | #pragma omp parallel for 40 | //for every row of the image 41 | for(int y = 0; y < rgbImage.height(); y++) { 42 | //for every column of the image 43 | for(int x = 0; x < rgbImage.width(); x++) { 44 | double intensity = 0.0; 45 | 46 | const double r = QColor(rgbImage.pixel(x, y)).redF() * redMultiplier; 47 | const double g = QColor(rgbImage.pixel(x, y)).greenF() * greenMultiplier; 48 | const double b = QColor(rgbImage.pixel(x, y)).blueF() * blueMultiplier; 49 | const double a = QColor(rgbImage.pixel(x, y)).alphaF() * alphaMultiplier; 50 | 51 | if(mode == AVERAGE) { 52 | //take the average out of all selected channels 53 | int num_channels = 0; 54 | 55 | if(redMultiplier != 0.0) { 56 | intensity += r; 57 | num_channels++; 58 | } 59 | if(greenMultiplier != 0.0) { 60 | intensity += g; 61 | num_channels++; 62 | } 63 | if(blueMultiplier != 0.0) { 64 | intensity += b; 65 | num_channels++; 66 | } 67 | if(alphaMultiplier != 0.0) { 68 | intensity += a; 69 | num_channels++; 70 | } 71 | 72 | if(num_channels != 0) 73 | intensity /= num_channels; 74 | else 75 | intensity = 0.0; 76 | } 77 | else if(mode == MAX) { 78 | //take the maximum out of all selected channels 79 | const double tempMaxRG = std::max(r, g); 80 | const double tempMaxBA = std::max(b, a); 81 | intensity = std::max(tempMaxRG, tempMaxBA); 82 | } 83 | 84 | //add resulting pixel intensity to intensity map 85 | this->map.at(y).at(x) = intensity; 86 | } 87 | } 88 | } 89 | 90 | double IntensityMap::at(int x, int y) const { 91 | return this->map.at(y).at(x); 92 | } 93 | 94 | double IntensityMap::at(int pos) const { 95 | const int x = pos % this->getWidth(); 96 | const int y = pos / this->getWidth(); 97 | 98 | return this->at(x, y); 99 | } 100 | 101 | void IntensityMap::setValue(int x, int y, double value) { 102 | this->map.at(y).at(x) = value; 103 | } 104 | 105 | void IntensityMap::setValue(int pos, double value) { 106 | const int x = pos % this->getWidth(); 107 | const int y = pos / this->getWidth(); 108 | 109 | this->map.at(y).at(x) = value; 110 | } 111 | 112 | size_t IntensityMap::getWidth() const { 113 | return this->map.at(0).size(); 114 | } 115 | 116 | size_t IntensityMap::getHeight() const { 117 | return this->map.size(); 118 | } 119 | 120 | void IntensityMap::invert() { 121 | #pragma omp parallel for 122 | for(size_t y = 0; y < this->getHeight(); y++) { 123 | for(size_t x = 0; x < this->getWidth(); x++) { 124 | const double inverted = 1.0 - this->map.at(y).at(x); 125 | this->map.at(y).at(x) = inverted; 126 | } 127 | } 128 | } 129 | 130 | QImage IntensityMap::convertToQImage() const { 131 | QImage result(this->getWidth(), this->getHeight(), QImage::Format_ARGB32); 132 | 133 | for(size_t y = 0; y < this->getHeight(); y++) { 134 | QRgb *scanline = (QRgb*) result.scanLine(y); 135 | 136 | for(size_t x = 0; x < this->getWidth(); x++) { 137 | const int c = 255 * map.at(y).at(x); 138 | scanline[x] = qRgba(c, c, c, 255); 139 | } 140 | } 141 | 142 | return result; 143 | } 144 | -------------------------------------------------------------------------------- /src_generators/normalmapgenerator.cpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | * Copyright (C) 2015 by Simon Wendsche * 3 | * * 4 | * This file is part of NormalmapGenerator. * 5 | * * 6 | * NormalmapGenerator is free software; you can redistribute it and/or modify * 7 | * it under the terms of the GNU General Public License as published by * 8 | * the Free Software Foundation; either version 3 of the License, or * 9 | * (at your option) any later version. * 10 | * * 11 | * NormalmapGenerator is distributed in the hope that it will be useful, * 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 14 | * GNU General Public License for more details. * 15 | * * 16 | * You should have received a copy of the GNU General Public License * 17 | * along with this program. If not, see . * 18 | * * 19 | * Sourcecode: https://github.com/Theverat/NormalmapGenerator * 20 | ********************************************************************************/ 21 | 22 | #include "normalmapgenerator.h" 23 | #include 24 | #include 25 | 26 | NormalmapGenerator::NormalmapGenerator(IntensityMap::Mode mode, double redMultiplier, double greenMultiplier, double blueMultiplier, double alphaMultiplier) 27 | : tileable(false), redMultiplier(redMultiplier), greenMultiplier(greenMultiplier), blueMultiplier(blueMultiplier), alphaMultiplier(alphaMultiplier), mode(mode) 28 | {} 29 | 30 | const IntensityMap& NormalmapGenerator::getIntensityMap() const { 31 | return this->intensity; 32 | } 33 | 34 | QImage NormalmapGenerator::calculateNormalmap(const QImage& input, Kernel kernel, double strength, bool invert, bool tileable, 35 | bool keepLargeDetail, int largeDetailScale, double largeDetailHeight) { 36 | this->tileable = tileable; 37 | 38 | this->intensity = IntensityMap(input, mode, redMultiplier, greenMultiplier, blueMultiplier, alphaMultiplier); 39 | if(!invert) { 40 | // The default "non-inverted" normalmap looks wrong in renderers, 41 | // so I use inversion by default 42 | intensity.invert(); 43 | } 44 | 45 | QImage result(input.width(), input.height(), QImage::Format_ARGB32); 46 | 47 | // optimization 48 | double strengthInv = 1.0 / strength; 49 | 50 | #pragma omp parallel for // OpenMP 51 | //code from http://stackoverflow.com/a/2368794 52 | for(int y = 0; y < input.height(); y++) { 53 | QRgb *scanline = (QRgb*) result.scanLine(y); 54 | 55 | for(int x = 0; x < input.width(); x++) { 56 | 57 | const double topLeft = intensity.at(handleEdges(x - 1, input.width()), handleEdges(y - 1, input.height())); 58 | const double top = intensity.at(handleEdges(x - 1, input.width()), handleEdges(y, input.height())); 59 | const double topRight = intensity.at(handleEdges(x - 1, input.width()), handleEdges(y + 1, input.height())); 60 | const double right = intensity.at(handleEdges(x, input.width()), handleEdges(y + 1, input.height())); 61 | const double bottomRight = intensity.at(handleEdges(x + 1, input.width()), handleEdges(y + 1, input.height())); 62 | const double bottom = intensity.at(handleEdges(x + 1, input.width()), handleEdges(y, input.height())); 63 | const double bottomLeft = intensity.at(handleEdges(x + 1, input.width()), handleEdges(y - 1, input.height())); 64 | const double left = intensity.at(handleEdges(x, input.width()), handleEdges(y - 1, input.height())); 65 | 66 | const double convolution_kernel[3][3] = {{topLeft, top, topRight}, 67 | {left, 0.0, right}, 68 | {bottomLeft, bottom, bottomRight}}; 69 | 70 | QVector3D normal(0, 0, 0); 71 | 72 | if(kernel == SOBEL) 73 | normal = sobel(convolution_kernel, strengthInv); 74 | else if(kernel == PREWITT) 75 | normal = prewitt(convolution_kernel, strengthInv); 76 | 77 | scanline[x] = qRgb(mapComponent(normal.x()), mapComponent(normal.y()), mapComponent(normal.z())); 78 | } 79 | } 80 | 81 | if(keepLargeDetail) { 82 | //generate a second normalmap from a downscaled input image, then mix both normalmaps 83 | 84 | int largeDetailMapWidth = (int) (((double)input.width() / 100.0) * largeDetailScale); 85 | int largeDetailMapHeight = (int) (((double)input.height() / 100.0) * largeDetailScale); 86 | 87 | //create downscaled version of input 88 | QImage inputScaled = input.scaled(largeDetailMapWidth, largeDetailMapHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 89 | //compute downscaled normalmap 90 | QImage largeDetailMap = calculateNormalmap(inputScaled, kernel, largeDetailHeight, invert, tileable, false, 0, 0.0); 91 | //scale map up 92 | largeDetailMap = largeDetailMap.scaled(input.width(), input.height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation); 93 | 94 | #pragma omp parallel for // OpenMP 95 | //mix the normalmaps 96 | for(int y = 0; y < input.height(); y++) { 97 | QRgb *scanlineResult = (QRgb*) result.scanLine(y); 98 | QRgb *scanlineLargeDetail = (QRgb*) largeDetailMap.scanLine(y); 99 | 100 | for(int x = 0; x < input.width(); x++) { 101 | const QRgb colorResult = scanlineResult[x]; 102 | const QRgb colorLargeDetail = scanlineLargeDetail[x]; 103 | 104 | const int r = blendSoftLight(qRed(colorResult), qRed(colorLargeDetail)); 105 | const int g = blendSoftLight(qGreen(colorResult), qGreen(colorLargeDetail)); 106 | const int b = blendSoftLight(qBlue(colorResult), qBlue(colorLargeDetail)); 107 | 108 | scanlineResult[x] = qRgb(r, g, b); 109 | } 110 | } 111 | } 112 | 113 | return result; 114 | } 115 | 116 | QVector3D NormalmapGenerator::sobel(const double convolution_kernel[3][3], double strengthInv) const { 117 | const double top_side = convolution_kernel[0][0] + 2.0 * convolution_kernel[0][1] + convolution_kernel[0][2]; 118 | const double bottom_side = convolution_kernel[2][0] + 2.0 * convolution_kernel[2][1] + convolution_kernel[2][2]; 119 | const double right_side = convolution_kernel[0][2] + 2.0 * convolution_kernel[1][2] + convolution_kernel[2][2]; 120 | const double left_side = convolution_kernel[0][0] + 2.0 * convolution_kernel[1][0] + convolution_kernel[2][0]; 121 | 122 | const double dY = right_side - left_side; 123 | const double dX = bottom_side - top_side; 124 | const double dZ = strengthInv; 125 | 126 | return QVector3D(dX, dY, dZ).normalized(); 127 | } 128 | 129 | QVector3D NormalmapGenerator::prewitt(const double convolution_kernel[3][3], double strengthInv) const { 130 | const double top_side = convolution_kernel[0][0] + convolution_kernel[0][1] + convolution_kernel[0][2]; 131 | const double bottom_side = convolution_kernel[2][0] + convolution_kernel[2][1] + convolution_kernel[2][2]; 132 | const double right_side = convolution_kernel[0][2] + convolution_kernel[1][2] + convolution_kernel[2][2]; 133 | const double left_side = convolution_kernel[0][0] + convolution_kernel[1][0] + convolution_kernel[2][0]; 134 | 135 | const double dY = right_side - left_side; 136 | const double dX = top_side - bottom_side; 137 | const double dZ = strengthInv; 138 | 139 | return QVector3D(dX, dY, dZ).normalized(); 140 | } 141 | 142 | int NormalmapGenerator::handleEdges(int iterator, int maxValue) const { 143 | if(iterator >= maxValue) { 144 | //move iterator from end to beginning + overhead 145 | if(tileable) 146 | return maxValue - iterator; 147 | else 148 | return maxValue - 1; 149 | } 150 | else if(iterator < 0) { 151 | //move iterator from beginning to end - overhead 152 | if(tileable) 153 | return maxValue + iterator; 154 | else 155 | return 0; 156 | } 157 | else { 158 | return iterator; 159 | } 160 | } 161 | 162 | //transform -1..1 to 0..255 163 | int NormalmapGenerator::mapComponent(double value) const { 164 | return (value + 1.0) * (255.0 / 2.0); 165 | } 166 | 167 | //uses a similar algorithm like "soft light" in PS, 168 | //see http://www.michael-kreil.de/algorithmen/photoshop-layer-blending-equations/index.php 169 | int NormalmapGenerator::blendSoftLight(int color1, int color2) const { 170 | const float a = color1; 171 | const float b = color2; 172 | 173 | if(2.0f * b < 255.0f) { 174 | return (int) (((a + 127.5f) * b) / 255.0f); 175 | } 176 | else { 177 | return (int) (255.0f - (((382.5f - a) * (255.0f - b)) / 255.0f)); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /qt_license/LICENSE.FDL: -------------------------------------------------------------------------------- 1 | GNU Free Documentation License 2 | Version 1.3, 3 November 2008 3 | 4 | 5 | Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc. 6 | 7 | Everyone is permitted to copy and distribute verbatim copies 8 | of this license document, but changing it is not allowed. 9 | 10 | 0. PREAMBLE 11 | 12 | The purpose of this License is to make a manual, textbook, or other 13 | functional and useful document "free" in the sense of freedom: to 14 | assure everyone the effective freedom to copy and redistribute it, 15 | with or without modifying it, either commercially or noncommercially. 16 | Secondarily, this License preserves for the author and publisher a way 17 | to get credit for their work, while not being considered responsible 18 | for modifications made by others. 19 | 20 | This License is a kind of "copyleft", which means that derivative 21 | works of the document must themselves be free in the same sense. It 22 | complements the GNU General Public License, which is a copyleft 23 | license designed for free software. 24 | 25 | We have designed this License in order to use it for manuals for free 26 | software, because free software needs free documentation: a free 27 | program should come with manuals providing the same freedoms that the 28 | software does. But this License is not limited to software manuals; 29 | it can be used for any textual work, regardless of subject matter or 30 | whether it is published as a printed book. We recommend this License 31 | principally for works whose purpose is instruction or reference. 32 | 33 | 34 | 1. APPLICABILITY AND DEFINITIONS 35 | 36 | This License applies to any manual or other work, in any medium, that 37 | contains a notice placed by the copyright holder saying it can be 38 | distributed under the terms of this License. Such a notice grants a 39 | world-wide, royalty-free license, unlimited in duration, to use that 40 | work under the conditions stated herein. The "Document", below, 41 | refers to any such manual or work. Any member of the public is a 42 | licensee, and is addressed as "you". You accept the license if you 43 | copy, modify or distribute the work in a way requiring permission 44 | under copyright law. 45 | 46 | A "Modified Version" of the Document means any work containing the 47 | Document or a portion of it, either copied verbatim, or with 48 | modifications and/or translated into another language. 49 | 50 | A "Secondary Section" is a named appendix or a front-matter section of 51 | the Document that deals exclusively with the relationship of the 52 | publishers or authors of the Document to the Document's overall 53 | subject (or to related matters) and contains nothing that could fall 54 | directly within that overall subject. (Thus, if the Document is in 55 | part a textbook of mathematics, a Secondary Section may not explain 56 | any mathematics.) The relationship could be a matter of historical 57 | connection with the subject or with related matters, or of legal, 58 | commercial, philosophical, ethical or political position regarding 59 | them. 60 | 61 | The "Invariant Sections" are certain Secondary Sections whose titles 62 | are designated, as being those of Invariant Sections, in the notice 63 | that says that the Document is released under this License. If a 64 | section does not fit the above definition of Secondary then it is not 65 | allowed to be designated as Invariant. The Document may contain zero 66 | Invariant Sections. If the Document does not identify any Invariant 67 | Sections then there are none. 68 | 69 | The "Cover Texts" are certain short passages of text that are listed, 70 | as Front-Cover Texts or Back-Cover Texts, in the notice that says that 71 | the Document is released under this License. A Front-Cover Text may 72 | be at most 5 words, and a Back-Cover Text may be at most 25 words. 73 | 74 | A "Transparent" copy of the Document means a machine-readable copy, 75 | represented in a format whose specification is available to the 76 | general public, that is suitable for revising the document 77 | straightforwardly with generic text editors or (for images composed of 78 | pixels) generic paint programs or (for drawings) some widely available 79 | drawing editor, and that is suitable for input to text formatters or 80 | for automatic translation to a variety of formats suitable for input 81 | to text formatters. A copy made in an otherwise Transparent file 82 | format whose markup, or absence of markup, has been arranged to thwart 83 | or discourage subsequent modification by readers is not Transparent. 84 | An image format is not Transparent if used for any substantial amount 85 | of text. A copy that is not "Transparent" is called "Opaque". 86 | 87 | Examples of suitable formats for Transparent copies include plain 88 | ASCII without markup, Texinfo input format, LaTeX input format, SGML 89 | or XML using a publicly available DTD, and standard-conforming simple 90 | HTML, PostScript or PDF designed for human modification. Examples of 91 | transparent image formats include PNG, XCF and JPG. Opaque formats 92 | include proprietary formats that can be read and edited only by 93 | proprietary word processors, SGML or XML for which the DTD and/or 94 | processing tools are not generally available, and the 95 | machine-generated HTML, PostScript or PDF produced by some word 96 | processors for output purposes only. 97 | 98 | The "Title Page" means, for a printed book, the title page itself, 99 | plus such following pages as are needed to hold, legibly, the material 100 | this License requires to appear in the title page. For works in 101 | formats which do not have any title page as such, "Title Page" means 102 | the text near the most prominent appearance of the work's title, 103 | preceding the beginning of the body of the text. 104 | 105 | The "publisher" means any person or entity that distributes copies of 106 | the Document to the public. 107 | 108 | A section "Entitled XYZ" means a named subunit of the Document whose 109 | title either is precisely XYZ or contains XYZ in parentheses following 110 | text that translates XYZ in another language. (Here XYZ stands for a 111 | specific section name mentioned below, such as "Acknowledgments", 112 | "Dedications", "Endorsements", or "History".) To "Preserve the Title" 113 | of such a section when you modify the Document means that it remains a 114 | section "Entitled XYZ" according to this definition. 115 | 116 | The Document may include Warranty Disclaimers next to the notice which 117 | states that this License applies to the Document. These Warranty 118 | Disclaimers are considered to be included by reference in this 119 | License, but only as regards disclaiming warranties: any other 120 | implication that these Warranty Disclaimers may have is void and has 121 | no effect on the meaning of this License. 122 | 123 | 2. VERBATIM COPYING 124 | 125 | You may copy and distribute the Document in any medium, either 126 | commercially or noncommercially, provided that this License, the 127 | copyright notices, and the license notice saying this License applies 128 | to the Document are reproduced in all copies, and that you add no 129 | other conditions whatsoever to those of this License. You may not use 130 | technical measures to obstruct or control the reading or further 131 | copying of the copies you make or distribute. However, you may accept 132 | compensation in exchange for copies. If you distribute a large enough 133 | number of copies you must also follow the conditions in section 3. 134 | 135 | You may also lend copies, under the same conditions stated above, and 136 | you may publicly display copies. 137 | 138 | 139 | 3. COPYING IN QUANTITY 140 | 141 | If you publish printed copies (or copies in media that commonly have 142 | printed covers) of the Document, numbering more than 100, and the 143 | Document's license notice requires Cover Texts, you must enclose the 144 | copies in covers that carry, clearly and legibly, all these Cover 145 | Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on 146 | the back cover. Both covers must also clearly and legibly identify 147 | you as the publisher of these copies. The front cover must present 148 | the full title with all words of the title equally prominent and 149 | visible. You may add other material on the covers in addition. 150 | Copying with changes limited to the covers, as long as they preserve 151 | the title of the Document and satisfy these conditions, can be treated 152 | as verbatim copying in other respects. 153 | 154 | If the required texts for either cover are too voluminous to fit 155 | legibly, you should put the first ones listed (as many as fit 156 | reasonably) on the actual cover, and continue the rest onto adjacent 157 | pages. 158 | 159 | If you publish or distribute Opaque copies of the Document numbering 160 | more than 100, you must either include a machine-readable Transparent 161 | copy along with each Opaque copy, or state in or with each Opaque copy 162 | a computer-network location from which the general network-using 163 | public has access to download using public-standard network protocols 164 | a complete Transparent copy of the Document, free of added material. 165 | If you use the latter option, you must take reasonably prudent steps, 166 | when you begin distribution of Opaque copies in quantity, to ensure 167 | that this Transparent copy will remain thus accessible at the stated 168 | location until at least one year after the last time you distribute an 169 | Opaque copy (directly or through your agents or retailers) of that 170 | edition to the public. 171 | 172 | It is requested, but not required, that you contact the authors of the 173 | Document well before redistributing any large number of copies, to 174 | give them a chance to provide you with an updated version of the 175 | Document. 176 | 177 | 178 | 4. MODIFICATIONS 179 | 180 | You may copy and distribute a Modified Version of the Document under 181 | the conditions of sections 2 and 3 above, provided that you release 182 | the Modified Version under precisely this License, with the Modified 183 | Version filling the role of the Document, thus licensing distribution 184 | and modification of the Modified Version to whoever possesses a copy 185 | of it. In addition, you must do these things in the Modified Version: 186 | 187 | A. Use in the Title Page (and on the covers, if any) a title distinct 188 | from that of the Document, and from those of previous versions 189 | (which should, if there were any, be listed in the History section 190 | of the Document). You may use the same title as a previous version 191 | if the original publisher of that version gives permission. 192 | B. List on the Title Page, as authors, one or more persons or entities 193 | responsible for authorship of the modifications in the Modified 194 | Version, together with at least five of the principal authors of the 195 | Document (all of its principal authors, if it has fewer than five), 196 | unless they release you from this requirement. 197 | C. State on the Title page the name of the publisher of the 198 | Modified Version, as the publisher. 199 | D. Preserve all the copyright notices of the Document. 200 | E. Add an appropriate copyright notice for your modifications 201 | adjacent to the other copyright notices. 202 | F. Include, immediately after the copyright notices, a license notice 203 | giving the public permission to use the Modified Version under the 204 | terms of this License, in the form shown in the Addendum below. 205 | G. Preserve in that license notice the full lists of Invariant Sections 206 | and required Cover Texts given in the Document's license notice. 207 | H. Include an unaltered copy of this License. 208 | I. Preserve the section Entitled "History", Preserve its Title, and add 209 | to it an item stating at least the title, year, new authors, and 210 | publisher of the Modified Version as given on the Title Page. If 211 | there is no section Entitled "History" in the Document, create one 212 | stating the title, year, authors, and publisher of the Document aspkg/qt/meta/LICENSE.FDL 213 | given on its Title Page, then add an item describing the Modified 214 | Version as stated in the previous sentence. 215 | J. Preserve the network location, if any, given in the Document for 216 | public access to a Transparent copy of the Document, and likewise 217 | the network locations given in the Document for previous versions 218 | it was based on. These may be placed in the "History" section. 219 | You may omit a network location for a work that was published at 220 | least four years before the Document itself, or if the original 221 | publisher of the version it refers to gives permission. 222 | K. For any section Entitled "Acknowledgments" or "Dedications", 223 | Preserve the Title of the section, and preserve in the section all 224 | the substance and tone of each of the contributor acknowledgments 225 | and/or dedications given therein. 226 | L. Preserve all the Invariant Sections of the Document, 227 | unaltered in their text and in their titles. Section numbers 228 | or the equivalent are not considered part of the section titles. 229 | M. Delete any section Entitled "Endorsements". Such a section 230 | may not be included in the Modified Version. 231 | N. Do not retitle any existing section to be Entitled "Endorsements" 232 | or to conflict in title with any Invariant Section.pkg/qt/meta/LICENSE.FDL 233 | O. Preserve any Warranty Disclaimers. 234 | 235 | If the Modified Version includes new front-matter sections or 236 | appendices that qualify as Secondary Sections and contain no material 237 | copied from the Document, you may at your option designate some or all 238 | of these sections as invariant. To do this, add their titles to the 239 | list of Invariant Sections in the Modified Version's license notice. 240 | These titles must be distinct from any other section titles. 241 | 242 | You may add a section Entitled "Endorsements", provided it contains 243 | nothing but endorsements of your Modified Version by various 244 | parties--for example, statements of peer review or that the text has 245 | been approved by an organization as the authoritative definition of a 246 | standard. 247 | 248 | You may add a passage of up to five words as a Front-Cover Text, and a 249 | passage of up to 25 words as a Back-Cover Text, to the end of the list 250 | of Cover Texts in the Modified Version. Only one passage of 251 | Front-Cover Text and one of Back-Cover Text may be added by (or 252 | through arrangements made by) any one entity. If the Document already 253 | includes a cover text for the same cover, previously added by you or 254 | by arrangement made by the same entity you are acting on behalf of, 255 | you may not add another; but you may replace the old one, on explicit 256 | permission from the previous publisher that added the old one. 257 | 258 | The author(s) and publisher(s) of the Document do not by this License 259 | give permission to use their names for publicity for or to assert or 260 | imply endorsement of any Modified Version. 261 | 262 | 263 | 5. COMBINING DOCUMENTS 264 | 265 | You may combine the Document with other documents released under this 266 | License, under the terms defined in section 4 above for modified 267 | versions, provided that you include in the combination all of the 268 | Invariant Sections of all of the original documents, unmodified, and 269 | list them all as Invariant Sections of your combined work in its 270 | license notice, and that you preserve all their Warranty Disclaimers. 271 | 272 | The combined work need only contain one copy of this License, and 273 | multiple identical Invariant Sections may be replaced with a single 274 | copy. If there are multiple Invariant Sections with the same name but 275 | different contents, make the title of each such section unique by 276 | adding at the end of it, in parentheses, the name of the original 277 | author or publisher of that section if known, or else a unique number. 278 | Make the same adjustment to the section titles in the list of 279 | Invariant Sections in the license notice of the combined work. 280 | 281 | In the combination, you must combine any sections Entitled "History" 282 | in the various original documents, forming one section Entitled 283 | "History"; likewise combine any sections Entitled "Acknowledgments", 284 | and any sections Entitled "Dedications". You must delete all sections 285 | Entitled "Endorsements". 286 | 287 | 288 | 6. COLLECTIONS OF DOCUMENTS 289 | 290 | You may make a collection consisting of the Document and other 291 | documents released under this License, and replace the individual 292 | copies of this License in the various documents with a single copy 293 | that is included in the collection, provided that you follow the rules 294 | of this License for verbatim copying of each of the documents in all 295 | other respects. 296 | 297 | You may extract a single document from such a collection, and 298 | distribute it individually under this License, provided you insert a 299 | copy of this License into the extracted document, and follow this 300 | License in all other respects regarding verbatim copying of that 301 | document. 302 | 303 | 304 | 7. AGGREGATION WITH INDEPENDENT WORKS 305 | 306 | A compilation of the Document or its derivatives with other separate 307 | and independent documents or works, in or on a volume of a storage or 308 | distribution medium, is called an "aggregate" if the copyright 309 | resulting from the compilation is not used to limit the legal rights 310 | of the compilation's users beyond what the individual works permit. 311 | When the Document is included in an aggregate, this License does not 312 | apply to the other works in the aggregate which are not themselves 313 | derivative works of the Document. 314 | 315 | If the Cover Text requirement of section 3 is applicable to these 316 | copies of the Document, then if the Document is less than one half of 317 | the entire aggregate, the Document's Cover Texts may be placed on 318 | covers that bracket the Document within the aggregate, or the 319 | electronic equivalent of covers if the Document is in electronic form. 320 | Otherwise they must appear on printed covers that bracket the whole 321 | aggregate. 322 | 323 | 324 | 8. TRANSLATION 325 | 326 | Translation is considered a kind of modification, so you may 327 | distribute translations of the Document under the terms of section 4. 328 | Replacing Invariant Sections with translations requires specialpkg/qt/meta/LICENSE.FDL 329 | permission from their copyright holders, but you may include 330 | translations of some or all Invariant Sections in addition to the 331 | original versions of these Invariant Sections. You may include a 332 | translation of this License, and all the license notices in the 333 | Document, and any Warranty Disclaimers, provided that you also include 334 | the original English version of this License and the original versions 335 | of those notices and disclaimers. In case of a disagreement between 336 | the translation and the original version of this License or a notice 337 | or disclaimer, the original version will prevail. 338 | 339 | If a section in the Document is Entitled "Acknowledgments", 340 | "Dedications", or "History", the requirement (section 4) to Preserve 341 | its Title (section 1) will typically require changing the actual 342 | title. 343 | 344 | 345 | 9. TERMINATION 346 | 347 | You may not copy, modify, sublicense, or distribute the Document 348 | except as expressly provided under this License. Any attempt 349 | otherwise to copy, modify, sublicense, or distribute it is void, and 350 | will automatically terminate your rights under this License. 351 | 352 | However, if you cease all violation of this License, then your license 353 | from a particular copyright holder is reinstated (a) provisionally, 354 | unless and until the copyright holder explicitly and finally 355 | terminates your license, and (b) permanently, if the copyright holder 356 | fails to notify you of the violation by some reasonable means prior to 357 | 60 days after the cessation. 358 | 359 | Moreover, your license from a particular copyright holder is 360 | reinstated permanently if the copyright holder notifies you of the 361 | violation by some reasonable means, this is the first time you have 362 | received notice of violation of this License (for any work) from that 363 | copyright holder, and you cure the violation prior to 30 days after 364 | your receipt of the notice. 365 | 366 | Termination of your rights under this section does not terminate the 367 | licenses of parties who have received copies or rights from you under 368 | this License. If your rights have been terminated and not permanently 369 | reinstated, receipt of a copy of some or all of the same material does 370 | not give you any rights to use it. 371 | 372 | 373 | 10. FUTURE REVISIONS OF THIS LICENSE 374 | 375 | The Free Software Foundation may publish new, revised versions of the 376 | GNU Free Documentation License from time to time. Such new versions 377 | will be similar in spirit to the present version, but may differ in 378 | detail to address new problems or concerns. See 379 | http://www.gnu.org/copyleft/. 380 | 381 | Each version of the License is given a distinguishing version number. 382 | If the Document specifies that a particular numbered version of this 383 | License "or any later version" applies to it, you have the option of 384 | following the terms and conditions either of that specified version or 385 | of any later version that has been published (not as a draft) by the 386 | Free Software Foundation. If the Document does not specify a version 387 | number of this License, you may choose any version ever published (not 388 | as a draft) by the Free Software Foundation. If the Document 389 | specifies that a proxy can decide which future versions of this 390 | License can be used, that proxy's public statement of acceptance of a 391 | version permanently authorizes you to choose that version for the 392 | Document. 393 | 394 | 11. RELICENSING 395 | 396 | "Massive Multiauthor Collaboration Site" (or "MMC Site") means any 397 | World Wide Web server that publishes copyrightable works and also 398 | provides prominent facilities for anybody to edit those works. A 399 | public wiki that anybody can edit is an example of such a server. A 400 | "Massive Multiauthor Collaboration" (or "MMC") contained in the site 401 | means any set of copyrightable works thus published on the MMC site. 402 | 403 | "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0 404 | license published by Creative Commons Corporation, a not-for-profit 405 | corporation with a principal place of business in San Francisco, 406 | California, as well as future copyleft versions of that license 407 | published by that same organization. 408 | 409 | "Incorporate" means to publish or republish a Document, in whole or in 410 | part, as part of another Document. 411 | 412 | An MMC is "eligible for relicensing" if it is licensed under this 413 | License, and if all works that were first published under this License 414 | somewhere other than this MMC, and subsequently incorporated in whole or 415 | in part into the MMC, (1) had no cover texts or invariant sections, and 416 | (2) were thus incorporated prior to November 1, 2008. 417 | 418 | The operator of an MMC Site may republish an MMC contained in the site 419 | under CC-BY-SA on the same site at any time before August 1, 2009, 420 | provided the MMC is eligible for relicensing. 421 | 422 | 423 | ADDENDUM: How to use this License for your documents 424 | 425 | To use this License in a document you have written, include a copy of 426 | the License in the document and put the following copyright and 427 | license notices just after the title page: 428 | 429 | Copyright (c) YEAR YOUR NAME. 430 | Permission is granted to copy, distribute and/or modify this document 431 | under the terms of the GNU Free Documentation License, Version 1.3 432 | or any later version published by the Free Software Foundation; 433 | with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. 434 | A copy of the license is included in the section entitled "GNU 435 | Free Documentation License". 436 | 437 | If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, 438 | replace the "with...Texts." line with this: 439 | 440 | with the Invariant Sections being LIST THEIR TITLES, with the 441 | Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. 442 | 443 | If you have Invariant Sections without Cover Texts, or some other 444 | combination of the three, merge those two alternatives to suit the 445 | situation. 446 | 447 | If your document contains nontrivial examples of program code, we 448 | recommend releasing these examples in parallel under your choice of 449 | free software license, such as the GNU General Public License, 450 | to permit their use in free software. 451 | -------------------------------------------------------------------------------- /qt_license/LICENSE.LGPL: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | 3 | The Qt Toolkit is Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). 4 | Contact: http://www.qt-project.org/legal 5 | 6 | You may use, distribute and copy the Qt GUI Toolkit under the terms of 7 | GNU Lesser General Public License version 2.1, which is displayed below. 8 | 9 | ------------------------------------------------------------------------- 10 | 11 | GNU LESSER GENERAL PUBLIC LICENSE 12 | Version 2.1, February 1999 13 | 14 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 15 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 16 | Everyone is permitted to copy and distribute verbatim copies 17 | of this license document, but changing it is not allowed. 18 | 19 | [This is the first released version of the Lesser GPL. It also counts 20 | as the successor of the GNU Library Public License, version 2, hence 21 | the version number 2.1.] 22 | 23 | Preamble 24 | 25 | The licenses for most software are designed to take away your 26 | freedom to share and change it. By contrast, the GNU General Public 27 | Licenses are intended to guarantee your freedom to share and change 28 | free software--to make sure the software is free for all its users. 29 | 30 | This license, the Lesser General Public License, applies to some 31 | specially designated software packages--typically libraries--of the 32 | Free Software Foundation and other authors who decide to use it. You 33 | can use it too, but we suggest you first think carefully about whether 34 | this license or the ordinary General Public License is the better 35 | strategy to use in any particular case, based on the explanations below. 36 | 37 | When we speak of free software, we are referring to freedom of use, 38 | not price. Our General Public Licenses are designed to make sure that 39 | you have the freedom to distribute copies of free software (and charge 40 | for this service if you wish); that you receive source code or can get 41 | it if you want it; that you can change the software and use pieces of 42 | it in new free programs; and that you are informed that you can do 43 | these things. 44 | 45 | To protect your rights, we need to make restrictions that forbid 46 | distributors to deny you these rights or to ask you to surrender these 47 | rights. These restrictions translate to certain responsibilities for 48 | you if you distribute copies of the library or if you modify it. 49 | 50 | For example, if you distribute copies of the library, whether gratis 51 | or for a fee, you must give the recipients all the rights that we gave 52 | you. You must make sure that they, too, receive or can get the source 53 | code. If you link other code with the library, you must provide 54 | complete object files to the recipients, so that they can relink them 55 | with the library after making changes to the library and recompiling 56 | it. And you must show them these terms so they know their rights. 57 | 58 | We protect your rights with a two-step method: (1) we copyright the 59 | library, and (2) we offer you this license, which gives you legal 60 | permission to copy, distribute and/or modify the library. 61 | 62 | To protect each distributor, we want to make it very clear that 63 | there is no warranty for the free library. Also, if the library is 64 | modified by someone else and passed on, the recipients should know 65 | that what they have is not the original version, so that the original 66 | author's reputation will not be affected by problems that might be 67 | introduced by others. 68 | 69 | Finally, software patents pose a constant threat to the existence of 70 | any free program. We wish to make sure that a company cannot 71 | effectively restrict the users of a free program by obtaining a 72 | restrictive license from a patent holder. Therefore, we insist that 73 | any patent license obtained for a version of the library must be 74 | consistent with the full freedom of use specified in this license. 75 | 76 | Most GNU software, including some libraries, is covered by the 77 | ordinary GNU General Public License. This license, the GNU Lesser 78 | General Public License, applies to certain designated libraries, and 79 | is quite different from the ordinary General Public License. We use 80 | this license for certain libraries in order to permit linking those 81 | libraries into non-free programs. 82 | 83 | When a program is linked with a library, whether statically or using 84 | a shared library, the combination of the two is legally speaking a 85 | combined work, a derivative of the original library. The ordinary 86 | General Public License therefore permits such linking only if the 87 | entire combination fits its criteria of freedom. The Lesser General 88 | Public License permits more lax criteria for linking other code with 89 | the library. 90 | 91 | We call this license the "Lesser" General Public License because it 92 | does Less to protect the user's freedom than the ordinary General 93 | Public License. It also provides other free software developers Less 94 | of an advantage over competing non-free programs. These disadvantages 95 | are the reason we use the ordinary General Public License for many 96 | libraries. However, the Lesser license provides advantages in certain 97 | special circumstances. 98 | 99 | For example, on rare occasions, there may be a special need to 100 | encourage the widest possible use of a certain library, so that it becomes 101 | a de-facto standard. To achieve this, non-free programs must be 102 | allowed to use the library. A more frequent case is that a free 103 | library does the same job as widely used non-free libraries. In this 104 | case, there is little to gain by limiting the free library to free 105 | software only, so we use the Lesser General Public License. 106 | 107 | In other cases, permission to use a particular library in non-free 108 | programs enables a greater number of people to use a large body of 109 | free software. For example, permission to use the GNU C Library in 110 | non-free programs enables many more people to use the whole GNU 111 | operating system, as well as its variant, the GNU/Linux operating 112 | system. 113 | 114 | Although the Lesser General Public License is Less protective of the 115 | users' freedom, it does ensure that the user of a program that is 116 | linked with the Library has the freedom and the wherewithal to run 117 | that program using a modified version of the Library. 118 | 119 | The precise terms and conditions for copying, distribution and 120 | modification follow. Pay close attention to the difference between a 121 | "work based on the library" and a "work that uses the library". The 122 | former contains code derived from the library, whereas the latter must 123 | be combined with the library in order to run. 124 | 125 | GNU LESSER GENERAL PUBLIC LICENSE 126 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 127 | 128 | 0. This License Agreement applies to any software library or other 129 | program which contains a notice placed by the copyright holder or 130 | other authorized party saying it may be distributed under the terms of 131 | this Lesser General Public License (also called "this License"). 132 | Each licensee is addressed as "you". 133 | 134 | A "library" means a collection of software functions and/or data 135 | prepared so as to be conveniently linked with application programs 136 | (which use some of those functions and data) to form executables. 137 | 138 | The "Library", below, refers to any such software library or work 139 | which has been distributed under these terms. A "work based on the 140 | Library" means either the Library or any derivative work under 141 | copyright law: that is to say, a work containing the Library or a 142 | portion of it, either verbatim or with modifications and/or translated 143 | straightforwardly into another language. (Hereinafter, translation is 144 | included without limitation in the term "modification".) 145 | 146 | "Source code" for a work means the preferred form of the work for 147 | making modifications to it. For a library, complete source code means 148 | all the source code for all modules it contains, plus any associated 149 | interface definition files, plus the scripts used to control compilation 150 | and installation of the library. 151 | 152 | Activities other than copying, distribution and modification are not 153 | covered by this License; they are outside its scope. The act of 154 | running a program using the Library is not restricted, and output from 155 | such a program is covered only if its contents constitute a work based 156 | on the Library (independent of the use of the Library in a tool for 157 | writing it). Whether that is true depends on what the Library does 158 | and what the program that uses the Library does. 159 | 160 | 1. You may copy and distribute verbatim copies of the Library's 161 | complete source code as you receive it, in any medium, provided that 162 | you conspicuously and appropriately publish on each copy an 163 | appropriate copyright notice and disclaimer of warranty; keep intact 164 | all the notices that refer to this License and to the absence of any 165 | warranty; and distribute a copy of this License along with the 166 | Library. 167 | 168 | You may charge a fee for the physical act of transferring a copy, 169 | and you may at your option offer warranty protection in exchange for a 170 | fee. 171 | 172 | 2. You may modify your copy or copies of the Library or any portion 173 | of it, thus forming a work based on the Library, and copy and 174 | distribute such modifications or work under the terms of Section 1 175 | above, provided that you also meet all of these conditions: 176 | 177 | a) The modified work must itself be a software library. 178 | 179 | b) You must cause the files modified to carry prominent notices 180 | stating that you changed the files and the date of any change. 181 | 182 | c) You must cause the whole of the work to be licensed at no 183 | charge to all third parties under the terms of this License. 184 | 185 | d) If a facility in the modified Library refers to a function or a 186 | table of data to be supplied by an application program that uses 187 | the facility, other than as an argument passed when the facility 188 | is invoked, then you must make a good faith effort to ensure that, 189 | in the event an application does not supply such function or 190 | table, the facility still operates, and performs whatever part of 191 | its purpose remains meaningful. 192 | 193 | (For example, a function in a library to compute square roots has 194 | a purpose that is entirely well-defined independent of the 195 | application. Therefore, Subsection 2d requires that any 196 | application-supplied function or table used by this function must 197 | be optional: if the application does not supply it, the square 198 | root function must still compute square roots.) 199 | 200 | These requirements apply to the modified work as a whole. If 201 | identifiable sections of that work are not derived from the Library, 202 | and can be reasonably considered independent and separate works in 203 | themselves, then this License, and its terms, do not apply to those 204 | sections when you distribute them as separate works. But when you 205 | distribute the same sections as part of a whole which is a work based 206 | on the Library, the distribution of the whole must be on the terms of 207 | this License, whose permissions for other licensees extend to the 208 | entire whole, and thus to each and every part regardless of who wrote 209 | it. 210 | 211 | Thus, it is not the intent of this section to claim rights or contest 212 | your rights to work written entirely by you; rather, the intent is to 213 | exercise the right to control the distribution of derivative or 214 | collective works based on the Library. 215 | 216 | In addition, mere aggregation of another work not based on the Library 217 | with the Library (or with a work based on the Library) on a volume of 218 | a storage or distribution medium does not bring the other work under 219 | the scope of this License. 220 | 221 | 3. You may opt to apply the terms of the ordinary GNU General Public 222 | License instead of this License to a given copy of the Library. To do 223 | this, you must alter all the notices that refer to this License, so 224 | that they refer to the ordinary GNU General Public License, version 2, 225 | instead of to this License. (If a newer version than version 2 of the 226 | ordinary GNU General Public License has appeared, then you can specify 227 | that version instead if you wish.) Do not make any other change in 228 | these notices. 229 | 230 | Once this change is made in a given copy, it is irreversible for 231 | that copy, so the ordinary GNU General Public License applies to all 232 | subsequent copies and derivative works made from that copy. 233 | 234 | This option is useful when you wish to copy part of the code of 235 | the Library into a program that is not a library. 236 | 237 | 4. You may copy and distribute the Library (or a portion or 238 | derivative of it, under Section 2) in object code or executable form 239 | under the terms of Sections 1 and 2 above provided that you accompany 240 | it with the complete corresponding machine-readable source code, which 241 | must be distributed under the terms of Sections 1 and 2 above on a 242 | medium customarily used for software interchange. 243 | 244 | If distribution of object code is made by offering access to copy 245 | from a designated place, then offering equivalent access to copy the 246 | source code from the same place satisfies the requirement to 247 | distribute the source code, even though third parties are not 248 | compelled to copy the source along with the object code. 249 | 250 | 5. A program that contains no derivative of any portion of the 251 | Library, but is designed to work with the Library by being compiled or 252 | linked with it, is called a "work that uses the Library". Such a 253 | work, in isolation, is not a derivative work of the Library, and 254 | therefore falls outside the scope of this License. 255 | 256 | However, linking a "work that uses the Library" with the Library 257 | creates an executable that is a derivative of the Library (because it 258 | contains portions of the Library), rather than a "work that uses the 259 | library". The executable is therefore covered by this License. 260 | Section 6 states terms for distribution of such executables. 261 | 262 | When a "work that uses the Library" uses material from a header file 263 | that is part of the Library, the object code for the work may be a 264 | derivative work of the Library even though the source code is not. 265 | Whether this is true is especially significant if the work can be 266 | linked without the Library, or if the work is itself a library. The 267 | threshold for this to be true is not precisely defined by law. 268 | 269 | If such an object file uses only numerical parameters, data 270 | structure layouts and accessors, and small macros and small inline 271 | functions (ten lines or less in length), then the use of the object 272 | file is unrestricted, regardless of whether it is legally a derivative 273 | work. (Executables containing this object code plus portions of the 274 | Library will still fall under Section 6.) 275 | 276 | Otherwise, if the work is a derivative of the Library, you may 277 | distribute the object code for the work under the terms of Section 6. 278 | Any executables containing that work also fall under Section 6, 279 | whether or not they are linked directly with the Library itself. 280 | 281 | 6. As an exception to the Sections above, you may also combine or 282 | link a "work that uses the Library" with the Library to produce a 283 | work containing portions of the Library, and distribute that work 284 | under terms of your choice, provided that the terms permit 285 | modification of the work for the customer's own use and reverse 286 | engineering for debugging such modifications. 287 | 288 | You must give prominent notice with each copy of the work that the 289 | Library is used in it and that the Library and its use are covered by 290 | this License. You must supply a copy of this License. If the work 291 | during execution displays copyright notices, you must include the 292 | copyright notice for the Library among them, as well as a reference 293 | directing the user to the copy of this License. Also, you must do one 294 | of these things: 295 | 296 | a) Accompany the work with the complete corresponding 297 | machine-readable source code for the Library including whatever 298 | changes were used in the work (which must be distributed under 299 | Sections 1 and 2 above); and, if the work is an executable linked 300 | with the Library, with the complete machine-readable "work that 301 | uses the Library", as object code and/or source code, so that the 302 | user can modify the Library and then relink to produce a modified 303 | executable containing the modified Library. (It is understood 304 | that the user who changes the contents of definitions files in the 305 | Library will not necessarily be able to recompile the application 306 | to use the modified definitions.) 307 | 308 | b) Use a suitable shared library mechanism for linking with the 309 | Library. A suitable mechanism is one that (1) uses at run time a 310 | copy of the library already present on the user's computer system, 311 | rather than copying library functions into the executable, and (2) 312 | will operate properly with a modified version of the library, if 313 | the user installs one, as long as the modified version is 314 | interface-compatible with the version that the work was made with. 315 | 316 | c) Accompany the work with a written offer, valid for at 317 | least three years, to give the same user the materials 318 | specified in Subsection 6a, above, for a charge no more 319 | than the cost of performing this distribution. 320 | 321 | d) If distribution of the work is made by offering access to copy 322 | from a designated place, offer equivalent access to copy the above 323 | specified materials from the same place. 324 | 325 | e) Verify that the user has already received a copy of these 326 | materials or that you have already sent this user a copy. 327 | 328 | For an executable, the required form of the "work that uses the 329 | Library" must include any data and utility programs needed for 330 | reproducing the executable from it. However, as a special exception, 331 | the materials to be distributed need not include anything that is 332 | normally distributed (in either source or binary form) with the major 333 | components (compiler, kernel, and so on) of the operating system on 334 | which the executable runs, unless that component itself accompanies 335 | the executable. 336 | 337 | It may happen that this requirement contradicts the license 338 | restrictions of other proprietary libraries that do not normally 339 | accompany the operating system. Such a contradiction means you cannot 340 | use both them and the Library together in an executable that you 341 | distribute. 342 | 343 | 7. You may place library facilities that are a work based on the 344 | Library side-by-side in a single library together with other library 345 | facilities not covered by this License, and distribute such a combined 346 | library, provided that the separate distribution of the work based on 347 | the Library and of the other library facilities is otherwise 348 | permitted, and provided that you do these two things: 349 | 350 | a) Accompany the combined library with a copy of the same work 351 | based on the Library, uncombined with any other library 352 | facilities. This must be distributed under the terms of the 353 | Sections above. 354 | 355 | b) Give prominent notice with the combined library of the fact 356 | that part of it is a work based on the Library, and explaining 357 | where to find the accompanying uncombined form of the same work. 358 | 359 | 8. You may not copy, modify, sublicense, link with, or distribute 360 | the Library except as expressly provided under this License. Any 361 | attempt otherwise to copy, modify, sublicense, link with, or 362 | distribute the Library is void, and will automatically terminate your 363 | rights under this License. However, parties who have received copies, 364 | or rights, from you under this License will not have their licenses 365 | terminated so long as such parties remain in full compliance. 366 | 367 | 9. You are not required to accept this License, since you have not 368 | signed it. However, nothing else grants you permission to modify or 369 | distribute the Library or its derivative works. These actions are 370 | prohibited by law if you do not accept this License. Therefore, by 371 | modifying or distributing the Library (or any work based on the 372 | Library), you indicate your acceptance of this License to do so, and 373 | all its terms and conditions for copying, distributing or modifying 374 | the Library or works based on it. 375 | 376 | 10. Each time you redistribute the Library (or any work based on the 377 | Library), the recipient automatically receives a license from the 378 | original licensor to copy, distribute, link with or modify the Library 379 | subject to these terms and conditions. You may not impose any further 380 | restrictions on the recipients' exercise of the rights granted herein. 381 | You are not responsible for enforcing compliance by third parties with 382 | this License. 383 | 384 | 11. If, as a consequence of a court judgment or allegation of patent 385 | infringement or for any other reason (not limited to patent issues), 386 | conditions are imposed on you (whether by court order, agreement or 387 | otherwise) that contradict the conditions of this License, they do not 388 | excuse you from the conditions of this License. If you cannot 389 | distribute so as to satisfy simultaneously your obligations under this 390 | License and any other pertinent obligations, then as a consequence you 391 | may not distribute the Library at all. For example, if a patent 392 | license would not permit royalty-free redistribution of the Library by 393 | all those who receive copies directly or indirectly through you, then 394 | the only way you could satisfy both it and this License would be to 395 | refrain entirely from distribution of the Library. 396 | 397 | If any portion of this section is held invalid or unenforceable under any 398 | particular circumstance, the balance of the section is intended to apply, 399 | and the section as a whole is intended to apply in other circumstances. 400 | 401 | It is not the purpose of this section to induce you to infringe any 402 | patents or other property right claims or to contest validity of any 403 | such claims; this section has the sole purpose of protecting the 404 | integrity of the free software distribution system which is 405 | implemented by public license practices. Many people have made 406 | generous contributions to the wide range of software distributed 407 | through that system in reliance on consistent application of that 408 | system; it is up to the author/donor to decide if he or she is willing 409 | to distribute software through any other system and a licensee cannot 410 | impose that choice. 411 | 412 | This section is intended to make thoroughly clear what is believed to 413 | be a consequence of the rest of this License. 414 | 415 | 12. If the distribution and/or use of the Library is restricted in 416 | certain countries either by patents or by copyrighted interfaces, the 417 | original copyright holder who places the Library under this License may add 418 | an explicit geographical distribution limitation excluding those countries, 419 | so that distribution is permitted only in or among countries not thus 420 | excluded. In such case, this License incorporates the limitation as if 421 | written in the body of this License. 422 | 423 | 13. The Free Software Foundation may publish revised and/or new 424 | versions of the Lesser General Public License from time to time. 425 | Such new versions will be similar in spirit to the present version, 426 | but may differ in detail to address new problems or concerns. 427 | 428 | Each version is given a distinguishing version number. If the Library 429 | specifies a version number of this License which applies to it and 430 | "any later version", you have the option of following the terms and 431 | conditions either of that version or of any later version published by 432 | the Free Software Foundation. If the Library does not specify a 433 | license version number, you may choose any version ever published by 434 | the Free Software Foundation. 435 | 436 | 14. If you wish to incorporate parts of the Library into other free 437 | programs whose distribution conditions are incompatible with these, 438 | write to the author to ask for permission. For software which is 439 | copyrighted by the Free Software Foundation, write to the Free 440 | Software Foundation; we sometimes make exceptions for this. Our 441 | decision will be guided by the two goals of preserving the free status 442 | of all derivatives of our free software and of promoting the sharing 443 | and reuse of software generally. 444 | 445 | NO WARRANTY 446 | 447 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 448 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 449 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 450 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 451 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 452 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 453 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 454 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 455 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 456 | 457 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 458 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 459 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 460 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 461 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 462 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 463 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 464 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 465 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 466 | DAMAGES. 467 | 468 | END OF TERMS AND CONDITIONS 469 | 470 | How to Apply These Terms to Your New Libraries 471 | 472 | If you develop a new library, and you want it to be of the greatest 473 | possible use to the public, we recommend making it free software that 474 | everyone can redistribute and change. You can do so by permitting 475 | redistribution under these terms (or, alternatively, under the terms of the 476 | ordinary General Public License). 477 | 478 | To apply these terms, attach the following notices to the library. It is 479 | safest to attach them to the start of each source file to most effectively 480 | convey the exclusion of warranty; and each file should have at least the 481 | "copyright" line and a pointer to where the full notice is found. 482 | 483 | 484 | Copyright (C) 485 | 486 | This library is free software; you can redistribute it and/or 487 | modify it under the terms of the GNU Lesser General Public 488 | License as published by the Free Software Foundation; either 489 | version 2.1 of the License, or (at your option) any later version. 490 | 491 | This library is distributed in the hope that it will be useful, 492 | but WITHOUT ANY WARRANTY; without even the implied warranty of 493 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 494 | Lesser General Public License for more details. 495 | 496 | You should have received a copy of the GNU Lesser General Public 497 | License along with this library; if not, write to the Free Software 498 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 499 | 500 | Also add information on how to contact you by electronic and paper mail. 501 | 502 | You should also get your employer (if you work as a programmer) or your 503 | school, if any, to sign a "copyright disclaimer" for the library, if 504 | necessary. Here is a sample; alter the names: 505 | 506 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 507 | library `Frob' (a library for tweaking knobs) written by James Random Hacker. 508 | 509 | , 1 April 1990 510 | Ty Coon, President of Vice 511 | 512 | That's all there is to it! 513 | 514 | 515 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . -------------------------------------------------------------------------------- /qt_license/LICENSE.GPL: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------