Commit e3f78b79 authored by Wolthera van Hövell's avatar Wolthera van Hövell 🛍

Merge branch 'master' into krita-testing-wolthera

parents 273dd04a ebc8a43c
...@@ -48,7 +48,7 @@ else() ...@@ -48,7 +48,7 @@ else()
URL_MD5 8fdec6d657bc370bd3183d8fe8e9c47a URL_MD5 8fdec6d657bc370bd3183d8fe8e9c47a
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qt-no-motion-compression.diff PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/qt-no-motion-compression.diff
INSTALL_DIR ${EXTPREFIX_qt} INSTALL_DIR ${EXTPREFIX_qt}
CONFIGURE_COMMAND <SOURCE_DIR>/configure -prefix ${EXTPREFIX_qt} -opensource -confirm-license -nomake examples -no-sql-sqlite -no-openssl -no-qml-debug -no-mtdev -no-journald -no-syslog -no-nis -no-cups -no-tslib -no-directfb -no-linuxfb -no-libproxy -no-pch -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-freetype -qt-xcb -qt-xkbcommon-x11 -optimized-qmake -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview CONFIGURE_COMMAND <SOURCE_DIR>/configure -prefix ${EXTPREFIX_qt} -opensource -confirm-license -nomake examples -no-sql-sqlite -no-openssl -no-qml-debug -no-mtdev -no-journald -no-syslog -no-nis -no-cups -no-tslib -no-directfb -no-linuxfb -no-libproxy -no-pch -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg -qt-harfbuzz -qt-freetype -qt-xcb -qt-xkbcommon-x11 -optimized-qmake -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtenginio -skip qtgraphicaleffects -skip qtlocation -skip qtmultimedia -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip qtandroidextras -skip qtserialport
BUILD_COMMAND make BUILD_COMMAND make
INSTALL_COMMAND make install INSTALL_COMMAND make install
......
...@@ -425,9 +425,6 @@ macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.rem ...@@ -425,9 +425,6 @@ macro_log_feature(TIFF_FOUND "tiff" "TIFF Library and Utilities" "http://www.rem
macro_optional_find_package(JPEG) macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter") macro_log_feature(JPEG_FOUND "jpeg" "Free library for JPEG image compression. Note: libjpeg8 is NOT supported." "http://www.libjpeg-turbo.org" FALSE "" "Required by the Krita JPEG filter")
macro_optional_find_package(OpenJPEG)
macro_log_feature(OPENJPEG_FOUND "openjpeg" "Free library for JPEG 2000 image compression" "http://www.openjpeg.org" FALSE "" "Required by the Krita JPEG 2000 filter")
set(LIBRAW_MIN_VERSION "0.16") set(LIBRAW_MIN_VERSION "0.16")
macro_optional_find_package(LibRaw ${LIBRAW_MIN_VERSION}) macro_optional_find_package(LibRaw ${LIBRAW_MIN_VERSION})
macro_log_feature(LIBRAW_FOUND "LibRaw" "Library to decode RAW images" "http://www.libraw.org" FALSE "" "Required to build the raw import plugin") macro_log_feature(LIBRAW_FOUND "LibRaw" "Library to decode RAW images" "http://www.libraw.org" FALSE "" "Required to build the raw import plugin")
......
...@@ -53,7 +53,6 @@ Krita depends on: ...@@ -53,7 +53,6 @@ Krita depends on:
* libraw * libraw
* opencolorio * opencolorio
* openexr * openexr
* openjpeg
* png * png
* poppler-qt5 * poppler-qt5
* pthreads * pthreads
......
...@@ -254,14 +254,16 @@ const QBitArray& KisPaintLayer::channelLockFlags() const ...@@ -254,14 +254,16 @@ const QBitArray& KisPaintLayer::channelLockFlags() const
QRect KisPaintLayer::extent() const QRect KisPaintLayer::extent() const
{ {
QRect rect = temporaryTarget() ? temporaryTarget()->extent() : QRect(); KisPaintDeviceSP t = temporaryTarget();
QRect rect = t ? t->extent() : QRect();
if (onionSkinEnabled()) rect |= KisOnionSkinCompositor::instance()->calculateExtent(m_d->paintDevice); if (onionSkinEnabled()) rect |= KisOnionSkinCompositor::instance()->calculateExtent(m_d->paintDevice);
return rect | KisLayer::extent(); return rect | KisLayer::extent();
} }
QRect KisPaintLayer::exactBounds() const QRect KisPaintLayer::exactBounds() const
{ {
QRect rect = temporaryTarget() ? temporaryTarget()->exactBounds() : QRect(); KisPaintDeviceSP t = temporaryTarget();
QRect rect = t ? t->extent() : QRect();
if (onionSkinEnabled()) rect |= KisOnionSkinCompositor::instance()->calculateExtent(m_d->paintDevice); if (onionSkinEnabled()) rect |= KisOnionSkinCompositor::instance()->calculateExtent(m_d->paintDevice);
return rect | KisLayer::exactBounds(); return rect | KisLayer::exactBounds();
} }
...@@ -276,7 +278,7 @@ void KisPaintLayer::setAlphaLocked(bool lock) ...@@ -276,7 +278,7 @@ void KisPaintLayer::setAlphaLocked(bool lock)
{ {
if(m_d->paintChannelFlags.isEmpty()) if(m_d->paintChannelFlags.isEmpty())
m_d->paintChannelFlags = colorSpace()->channelFlags(true, true); m_d->paintChannelFlags = colorSpace()->channelFlags(true, true);
if(lock) if(lock)
m_d->paintChannelFlags &= colorSpace()->channelFlags(true, false); m_d->paintChannelFlags &= colorSpace()->channelFlags(true, false);
else else
......
...@@ -894,6 +894,13 @@ void KisMainWindow::slotSaveCompleted() ...@@ -894,6 +894,13 @@ void KisMainWindow::slotSaveCompleted()
} }
} }
bool KisMainWindow::hackIsSaving() const
{
StdLockableWrapper<QMutex> wrapper(&d->savingEntryMutex);
std::unique_lock<StdLockableWrapper<QMutex>> l(wrapper, std::try_to_lock);
return !l.owns_lock();
}
bool KisMainWindow::saveDocument(KisDocument *document, bool saveas, bool silent, int specialOutputFlag) bool KisMainWindow::saveDocument(KisDocument *document, bool saveas, bool silent, int specialOutputFlag)
{ {
if (!document) { if (!document) {
...@@ -1808,7 +1815,10 @@ void KisMainWindow::slotProgress(int value) ...@@ -1808,7 +1815,10 @@ void KisMainWindow::slotProgress(int value)
{ {
qApp->processEvents(); qApp->processEvents();
if (!d->progressMutex.tryLock()) return; StdLockableWrapper<QMutex> wrapper(&d->progressMutex);
std::unique_lock<StdLockableWrapper<QMutex>> l(wrapper, std::try_to_lock);
if (!l.owns_lock()) return;
dbgUI << "KisMainWindow::slotProgress" << value; dbgUI << "KisMainWindow::slotProgress" << value;
if (value <= -1 || value >= 100) { if (value <= -1 || value >= 100) {
...@@ -1823,7 +1833,6 @@ void KisMainWindow::slotProgress(int value) ...@@ -1823,7 +1833,6 @@ void KisMainWindow::slotProgress(int value)
d->progressCancel = 0; d->progressCancel = 0;
} }
d->firstTime = true; d->firstTime = true;
d->progressMutex.unlock();
return; return;
} }
if (d->firstTime || !d->progress) { if (d->firstTime || !d->progress) {
...@@ -1866,8 +1875,6 @@ void KisMainWindow::slotProgress(int value) ...@@ -1866,8 +1875,6 @@ void KisMainWindow::slotProgress(int value)
d->progress->setValue(value); d->progress->setValue(value);
} }
qApp->processEvents(); qApp->processEvents();
d->progressMutex.unlock();
} }
void KisMainWindow::slotProgressCanceled() void KisMainWindow::slotProgressCanceled()
......
...@@ -142,6 +142,17 @@ public: ...@@ -142,6 +142,17 @@ public:
QStringList showOpenFileDialog(); QStringList showOpenFileDialog();
/**
* Shows if the main window is saving anything right now. If the
* user presses Ctrl+W too fast, then the document can be close
* before the saving is completed. I'm not sure if it is fixable
* in any way without avoiding using porcessEvents()
* everywhere (DK)
*
* Don't use it unless you have no option.
*/
bool hackIsSaving() const;
Q_SIGNALS: Q_SIGNALS:
/** /**
......
...@@ -269,6 +269,16 @@ void KisPart::removeView(KisView *view) ...@@ -269,6 +269,16 @@ void KisPart::removeView(KisView *view)
{ {
if (!view) return; if (!view) return;
/**
* HACK ALERT: we check here explicitly if the document (or main
* window), is saving the stuff. If we close the
* document *before* the saving is completed, a crash
* will happen.
*/
if (view->mainWindow()->hackIsSaving()) {
return;
}
emit sigViewRemoved(view); emit sigViewRemoved(view);
QPointer<KisDocument> doc = view->document(); QPointer<KisDocument> doc = view->document();
......
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
struct KisStabilizedEventsSampler::Private struct KisStabilizedEventsSampler::Private
{ {
Private(int _sampleTime) : sampleTime(_sampleTime) {} Private(int _sampleTime) : sampleTime(_sampleTime), elapsedTimeOverride(0) {}
std::function<void(const KisPaintInformation &)> paintLine; std::function<void(const KisPaintInformation &)> paintLine;
QElapsedTimer lastPaintTime; QElapsedTimer lastPaintTime;
QList<KisPaintInformation> realEvents; QList<KisPaintInformation> realEvents;
int sampleTime; int sampleTime;
int elapsedTimeOverride;
KisPaintInformation lastPaintInformation; KisPaintInformation lastPaintInformation;
}; };
...@@ -70,6 +71,14 @@ void KisStabilizedEventsSampler::addEvent(const KisPaintInformation &pi) ...@@ -70,6 +71,14 @@ void KisStabilizedEventsSampler::addEvent(const KisPaintInformation &pi)
m_d->realEvents.append(pi); m_d->realEvents.append(pi);
} }
void KisStabilizedEventsSampler::addFinishingEvent(int numSamples)
{
clear();
m_d->elapsedTimeOverride = numSamples;
m_d->realEvents.append(m_d->lastPaintInformation);
}
void KisStabilizedEventsSampler::processAllEvents() void KisStabilizedEventsSampler::processAllEvents()
{ {
const int elapsed = m_d->lastPaintTime.restart(); const int elapsed = m_d->lastPaintTime.restart();
...@@ -93,9 +102,11 @@ const KisPaintInformation& KisStabilizedEventsSampler::iterator::dereference() c ...@@ -93,9 +102,11 @@ const KisPaintInformation& KisStabilizedEventsSampler::iterator::dereference() c
std::pair<KisStabilizedEventsSampler::iterator, KisStabilizedEventsSampler::iterator> std::pair<KisStabilizedEventsSampler::iterator, KisStabilizedEventsSampler::iterator>
KisStabilizedEventsSampler::range() const KisStabilizedEventsSampler::range() const
{ {
const int elapsed = m_d->lastPaintTime.restart() / m_d->sampleTime; const int elapsed = (m_d->lastPaintTime.restart() + m_d->elapsedTimeOverride) / m_d->sampleTime;
const qreal alpha = qreal(m_d->realEvents.size()) / elapsed; const qreal alpha = qreal(m_d->realEvents.size()) / elapsed;
m_d->elapsedTimeOverride = 0;
return std::make_pair(iterator(this, 0, alpha), return std::make_pair(iterator(this, 0, alpha),
iterator(this, elapsed, alpha)); iterator(this, elapsed, alpha));
} }
......
...@@ -40,6 +40,7 @@ public: ...@@ -40,6 +40,7 @@ public:
void clear(); void clear();
void addEvent(const KisPaintInformation &pi); void addEvent(const KisPaintInformation &pi);
void addFinishingEvent(int numSamples);
void processAllEvents(); void processAllEvents();
public: public:
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <QPainter> #include <QPainter>
#include <QRect> #include <QRect>
#include <QThreadPool> #include <QThreadPool>
#include <QApplication>
#include <QDesktopWidget>
#include <kis_icon.h> #include <kis_icon.h>
#include <KoPointerEvent.h> #include <KoPointerEvent.h>
...@@ -323,6 +325,7 @@ void KisToolFreehand::beginAlternateAction(KoPointerEvent *event, AlternateActio ...@@ -323,6 +325,7 @@ void KisToolFreehand::beginAlternateAction(KoPointerEvent *event, AlternateActio
m_initialGestureGlobalPoint = QCursor::pos(); m_initialGestureGlobalPoint = QCursor::pos();
m_lastDocumentPoint = event->point; m_lastDocumentPoint = event->point;
m_lastPaintOpSize = currentPaintOpPreset()->settings()->paintOpSize();
} }
void KisToolFreehand::continueAlternateAction(KoPointerEvent *event, AlternateAction action) void KisToolFreehand::continueAlternateAction(KoPointerEvent *event, AlternateAction action)
...@@ -339,19 +342,30 @@ void KisToolFreehand::continueAlternateAction(KoPointerEvent *event, AlternateAc ...@@ -339,19 +342,30 @@ void KisToolFreehand::continueAlternateAction(KoPointerEvent *event, AlternateAc
QPointF offset = actualWidgetPosition - lastWidgetPosition; QPointF offset = actualWidgetPosition - lastWidgetPosition;
/** KisCanvas2 *canvas2 = dynamic_cast<KisCanvas2 *>(canvas());
* view pixels != widget pixels, but we do this anyway, we only QRect screenRect = QApplication::desktop()->screenGeometry();
* need to scale the gesture down, not rotate or anything
*/ qreal scaleX = 0;
QPointF scaledOffset = canvas()->viewConverter()->viewToDocument(offset); qreal scaleY = 0;
canvas2->coordinatesConverter()->imageScale(&scaleX, &scaleY);
if (qRound(scaledOffset.x()) != 0) { // we have no centralized knowledge of the maximum brush size!
const qreal maxBrushSize = 1000.0;
const qreal effectiveMaxDragSize = 0.5 * screenRect.width();
const qreal effectiveMaxBrushSize = qMin(maxBrushSize, effectiveMaxDragSize / scaleX);
const qreal scaleCoeff = effectiveMaxBrushSize / effectiveMaxDragSize;
const qreal sizeDiff = scaleCoeff * offset.x() ;
if (qAbs(sizeDiff) > 0.01) {
KisPaintOpSettingsSP settings = currentPaintOpPreset()->settings(); KisPaintOpSettingsSP settings = currentPaintOpPreset()->settings();
const qreal newSize = settings->paintOpSize() + scaledOffset.x(); const qreal newSize = qBound(0.01, m_lastPaintOpSize + sizeDiff, maxBrushSize);
settings->setPaintOpSize(newSize); settings->setPaintOpSize(newSize);
requestUpdateOutline(m_initialGestureDocPoint, 0); requestUpdateOutline(m_initialGestureDocPoint, 0);
m_lastDocumentPoint = event->point; m_lastDocumentPoint = event->point;
m_lastPaintOpSize = newSize;
} }
} }
......
...@@ -124,6 +124,7 @@ private: ...@@ -124,6 +124,7 @@ private:
QPointF m_initialGestureDocPoint; QPointF m_initialGestureDocPoint;
QPointF m_lastDocumentPoint; QPointF m_lastDocumentPoint;
qreal m_lastPaintOpSize;
QPoint m_initialGestureGlobalPoint; QPoint m_initialGestureGlobalPoint;
bool m_paintopBasedPickingInAction; bool m_paintopBasedPickingInAction;
......
...@@ -680,7 +680,6 @@ void KisToolFreehandHelper::stabilizerPollAndPaint() ...@@ -680,7 +680,6 @@ void KisToolFreehandHelper::stabilizerPollAndPaint()
m_d->stabilizerDeque.dequeue(); m_d->stabilizerDeque.dequeue();
m_d->stabilizerDeque.enqueue(sampledInfo); m_d->stabilizerDeque.enqueue(sampledInfo);
emit requestExplicitUpdateOutline(); emit requestExplicitUpdateOutline();
} else if (m_d->stabilizerDeque.head().pos() != m_d->previousPaintInformation.pos()) { } else if (m_d->stabilizerDeque.head().pos() != m_d->previousPaintInformation.pos()) {
...@@ -699,21 +698,17 @@ void KisToolFreehandHelper::stabilizerPollAndPaint() ...@@ -699,21 +698,17 @@ void KisToolFreehandHelper::stabilizerPollAndPaint()
void KisToolFreehandHelper::stabilizerEnd() void KisToolFreehandHelper::stabilizerEnd()
{ {
// FIXME: Ugly hack, this is no a "distance" in any way
int sampleSize = m_d->smoothingOptions->smoothnessDistance();
assert(sampleSize > 0);
// Stop the timer // Stop the timer
m_d->stabilizerPollTimer.stop(); m_d->stabilizerPollTimer.stop();
// Finish the line // Finish the line
for (int i = sampleSize; i > 0; i--) { if (m_d->smoothingOptions->finishStabilizedCurve()) {
// In each iteration we add the latest paint info and delete the oldest // In each iteration we add the latest paint info and delete the oldest
// After `sampleSize` iterations the deque will be filled with the latest // After `sampleSize` iterations the deque will be filled with the latest
// value and we will have reached the end point. // value and we will have reached the end point.
if (m_d->smoothingOptions->finishStabilizedCurve()) {
stabilizerPollAndPaint(); m_d->stabilizedSampler.addFinishingEvent(m_d->stabilizerDeque.size());
} stabilizerPollAndPaint();
} }
} }
......
...@@ -272,13 +272,17 @@ void KisPainterBasedStrokeStrategy::cancelStrokeCallback() ...@@ -272,13 +272,17 @@ void KisPainterBasedStrokeStrategy::cancelStrokeCallback()
KisIndirectPaintingSupport *indirect = KisIndirectPaintingSupport *indirect =
dynamic_cast<KisIndirectPaintingSupport*>(node.data()); dynamic_cast<KisIndirectPaintingSupport*>(node.data());
if(indirect && indirect->hasTemporaryTarget()) {
delete m_transaction;
deletePainters();
QRegion region = indirect->temporaryTarget()->region(); if (indirect) {
indirect->setTemporaryTarget(0); KisPaintDeviceSP t = indirect->temporaryTarget();
node->setDirty(region); if (t) {
delete m_transaction;
deletePainters();
QRegion region = t->region();
indirect->setTemporaryTarget(0);
node->setDirty(region);
}
} else { } else {
m_transaction->revert(); m_transaction->revert();
delete m_transaction; delete m_transaction;
......
...@@ -34,7 +34,7 @@ const QVector<char> opLevel2 = {'*', '/'}; ...@@ -34,7 +34,7 @@ const QVector<char> opLevel2 = {'*', '/'};
const QStringList supportedFuncs = {"", "cos", "sin", "tan", "acos", "asin", "atan", "exp", "ln", "log10", "abs"}; const QStringList supportedFuncs = {"", "cos", "sin", "tan", "acos", "asin", "atan", "exp", "ln", "log10", "abs"};
const QRegExp funcExpr("(-)?([a-zA-Z]*)?\\((.+)\\)"); const QRegExp funcExpr("(-)?([a-zA-Z]*[0-9]*)?\\((.+)\\)");
const QRegExp numberExpr("(-)?([0-9]+\\.?[0-9]*(e[0-9]*)?)"); const QRegExp numberExpr("(-)?([0-9]+\\.?[0-9]*(e[0-9]*)?)");
const QRegExp funcExprInteger("(-)?\\((.+)\\)"); const QRegExp funcExprInteger("(-)?\\((.+)\\)");
......
...@@ -52,7 +52,10 @@ void KisSimpleMathParserTest::testDoubleComputation() ...@@ -52,7 +52,10 @@ void KisSimpleMathParserTest::testDoubleComputation()
"cos(1)^3.0*2", "cos(1)^3.0*2",
"cos(1)*2 + sin(3)/2", "cos(1)*2 + sin(3)/2",
"cos(acos(-1)+1*3^2.0)*2 + sin(3)/2", "cos(acos(-1)+1*3^2.0)*2 + sin(3)/2",
"cos(acos(-1)+1*3^2.0)^2 + sin(3)/2"}; "cos(acos(-1)+1*3^2.0)^2 + sin(3)/2",
"log10(100)",
"exp(10)",
"ln(10)"};
QVector<double> expected = {1, QVector<double> expected = {1,
2 + 3.4, 2 + 3.4,
...@@ -75,7 +78,10 @@ void KisSimpleMathParserTest::testDoubleComputation() ...@@ -75,7 +78,10 @@ void KisSimpleMathParserTest::testDoubleComputation()
qPow(qCos(1.0/180*qAcos(-1)),3.0)*2, qPow(qCos(1.0/180*qAcos(-1)),3.0)*2,
qCos(1.0/180*qAcos(-1))*2 + qSin(3.0/180*qAcos(-1))/2, qCos(1.0/180*qAcos(-1))*2 + qSin(3.0/180*qAcos(-1))/2,
qCos((qAcos(-1.0)*180/qAcos(-1)+1*qPow(3,2.0))/180*qAcos(-1))*2 + qSin(3.0/180*qAcos(-1))/2, qCos((qAcos(-1.0)*180/qAcos(-1)+1*qPow(3,2.0))/180*qAcos(-1))*2 + qSin(3.0/180*qAcos(-1))/2,
qPow(qCos((qAcos(-1.0)*180/qAcos(-1)+1*qPow(3,2.0))/180*qAcos(-1)),2) + qSin(3.0/180*qAcos(-1))/2}; qPow(qCos((qAcos(-1.0)*180/qAcos(-1)+1*qPow(3,2.0))/180*qAcos(-1)),2) + qSin(3.0/180*qAcos(-1))/2,
qLn(100)/qLn(10),
qExp(10),
qLn(10)};
for (int i = 0; i < expected.size(); i++) { for (int i = 0; i < expected.size(); i++) {
......
...@@ -116,8 +116,6 @@ cmake3 --build . --config RelWithDebInfo --target ext_vc ...@@ -116,8 +116,6 @@ cmake3 --build . --config RelWithDebInfo --target ext_vc
cmake3 --build . --config RelWithDebInfo --target ext_tiff cmake3 --build . --config RelWithDebInfo --target ext_tiff
cmake3 --build . --config RelWithDebInfo --target ext_jpeg cmake3 --build . --config RelWithDebInfo --target ext_jpeg
cmake3 --build . --config RelWithDebInfo --target ext_libraw cmake3 --build . --config RelWithDebInfo --target ext_libraw
# XXX: this builds, but cmake3 never manages to find the library
#cmake3 --build . --config RelWithDebInfo --target ext_openjpeg
cmake3 --build . --config RelWithDebInfo --target ext_kcrash cmake3 --build . --config RelWithDebInfo --target ext_kcrash
cmake3 --build . --config RelWithDebInfo --target ext_poppler cmake3 --build . --config RelWithDebInfo --target ext_poppler
cmake3 --build . --config RelWithDebInfo --target ext_gsl cmake3 --build . --config RelWithDebInfo --target ext_gsl
......
...@@ -72,7 +72,6 @@ parts: ...@@ -72,7 +72,6 @@ parts:
- libjpeg-dev - libjpeg-dev
- liblcms2-dev - liblcms2-dev
- libopenexr-dev - libopenexr-dev
- libopenjpeg-dev
- libpng12-dev - libpng12-dev
- libpoppler-qt4-dev - libpoppler-qt4-dev
- libtiff5-dev - libtiff5-dev
......
...@@ -14,6 +14,5 @@ cmake --build . --config RelWithDebInfo --target ext_png ...@@ -14,6 +14,5 @@ cmake --build . --config RelWithDebInfo --target ext_png
cmake --build . --config RelWithDebInfo --target ext_tiff cmake --build . --config RelWithDebInfo --target ext_tiff
cmake --build . --config RelWithDebInfo --target ext_vc cmake --build . --config RelWithDebInfo --target ext_vc
cmake --build . --config RelWithDebInfo --target ext_libraw cmake --build . --config RelWithDebInfo --target ext_libraw
cmake --build . --config RelWithDebInfo --target ext_openjpeg
cmake --build . --config RelWithDebInfo --target ext_kwindowsystem cmake --build . --config RelWithDebInfo --target ext_kwindowsystem
cmake --build . --config RelWithDebInfo --target ext_gsl cmake --build . --config RelWithDebInfo --target ext_gsl
...@@ -20,7 +20,6 @@ cmake --build . --config RelWithDebInfo --target ext_tiff ...@@ -20,7 +20,6 @@ cmake --build . --config RelWithDebInfo --target ext_tiff
cmake --build . --config RelWithDebInfo --target ext_gsl cmake --build . --config RelWithDebInfo --target ext_gsl
cmake --build . --config RelWithDebInfo --target ext_vc cmake --build . --config RelWithDebInfo --target ext_vc
cmake --build . --config RelWithDebInfo --target ext_libraw cmake --build . --config RelWithDebInfo --target ext_libraw
rem cmake --build . --config RelWithDebInfo --target ext_openjpeg
rem cmake --build . --config RelWithDebInfo --target ext_freetype rem cmake --build . --config RelWithDebInfo --target ext_freetype
cmake --build . --config RelWithDebInfo --target ext_ocio cmake --build . --config RelWithDebInfo --target ext_ocio
cmake --build . --config RelWithDebInfo --target ext_openexr cmake --build . --config RelWithDebInfo --target ext_openexr
......
...@@ -15,7 +15,7 @@ export PATH=$BUILDROOT/mxe/usr/bin:$BUILDROOT/mxe/usr/x86_64-w64-mingw32.shared/ ...@@ -15,7 +15,7 @@ export PATH=$BUILDROOT/mxe/usr/bin:$BUILDROOT/mxe/usr/x86_64-w64-mingw32.shared/
# Use i686-w64-mingw32.shared for 32 bits builds # Use i686-w64-mingw32.shared for 32 bits builds
# note: vc is 1.2, so we either need zagge's branch, or you need to build Vc 0.75 # note: vc is 1.2, so we either need zagge's branch, or you need to build Vc 0.75
# yourself. Make sure you use -DBUILD_TESTING=OFF for Vc # yourself. Make sure you use -DBUILD_TESTING=OFF for Vc
make MXE_TARGETS=x86_64-w64-mingw32.shared gcc boost curl eigen exiv2 expat fftw fontconfig freetype gettext ilmbase openexr jpeg lcms libpng libraw opencolorio openjpeg qt5 qtscript tiff vc zlib gsl make MXE_TARGETS=x86_64-w64-mingw32.shared gcc boost curl eigen exiv2 expat fftw fontconfig freetype gettext ilmbase openexr jpeg lcms libpng libraw opencolorio qt5 qtscript tiff vc zlib gsl
cd $BUILDROOT cd $BUILDROOT
git clone git://anongit.kde.org/krita.git git clone git://anongit.kde.org/krita.git
......
...@@ -422,131 +422,103 @@ QVector <double> LcmsColorProfileContainer::getEstimatedTRC() const ...@@ -422,131 +422,103 @@ QVector <double> LcmsColorProfileContainer::getEstimatedTRC() const
void LcmsColorProfileContainer::LinearizeFloatValue(QVector <double> & Value) const void LcmsColorProfileContainer::LinearizeFloatValue(QVector <double> & Value) const
{ {
QVector <double> TRCtriplet(3);
TRCtriplet[0] = Value[0];
TRCtriplet[1] = Value[1];
TRCtriplet[2] = Value[2];
if (d->hasColorants) { if (d->hasColorants) {
if (cmsIsToneCurveLinear(d->redTRC)) { if (!cmsIsToneCurveLinear(d->redTRC)) {
TRCtriplet[0] = Value[0]; Value[0] = cmsEvalToneCurveFloat(d->redTRC, Value[0]);
} else {
TRCtriplet[0] = cmsEvalToneCurveFloat(d->redTRC, Value[0]);
} }
if (cmsIsToneCurveLinear(d->greenTRC)) { if (!cmsIsToneCurveLinear(d->greenTRC)) {
TRCtriplet[1] = Value[1]; Value[1] = cmsEvalToneCurveFloat(d->greenTRC, Value[1]);
} else {
TRCtriplet[1] = cmsEvalToneCurveFloat(d->greenTRC, Value[1]);
} }
if (cmsIsToneCurveLinear(d->blueTRC)) { if (!cmsIsToneCurveLinear(d->blueTRC)) {
TRCtriplet[2] = Value[2]; Value[2] = cmsEvalToneCurveFloat(d->blueTRC, Value[2]);
} else {
TRCtriplet[2] = cmsEvalToneCurveFloat(d->blueTRC, Value[2]);
} }
} else { } else {
if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) { if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) {
TRCtriplet.fill(cmsEvalToneCurveFloat(d->grayTRC, Value[0])); Value[0] = cmsEvalToneCurveFloat(d->grayTRC, Value[0]);
} }
} }
Value[0] = TRCtriplet[0];
Value[1] = TRCtriplet[1];
Value[2] = TRCtriplet[2];
} }
void LcmsColorProfileContainer::DelinearizeFloatValue(QVector <double> & Value) const void LcmsColorProfileContainer::DelinearizeFloatValue(QVector <double> & Value) const
{ {
QVector <double> TRCtriplet(3); if (d->hasColorants) {
TRCtriplet[0] = Value[0]; if (!cmsIsToneCurveLinear(d->redTRC)) {
TRCtriplet[1] = Value[1]; Value[0] = cmsEvalToneCurveFloat(d->redTRCReverse, Value[0]);
TRCtriplet[2] = Value[2];
if (cmsIsTag(d->profile, cmsSigRedTRCTag)) {
if (cmsIsToneCurveLinear(d->redTRC)) {
TRCtriplet[0] = Value[0];
} else {
TRCtriplet[0] = cmsEvalToneCurveFloat(d->redTRCReverse, Value[0]);
} }
if (cmsIsToneCurveLinear(d->greenTRC)) { if (!cmsIsToneCurveLinear(d->greenTRC)) {
TRCtriplet[1] = Value[1]; Value[1] = cmsEvalToneCurveFloat(d->greenTRCReverse, Value[1]);
} else {
TRCtriplet[1] = cmsEvalToneCurveFloat(d->greenTRCReverse, Value[1]);
} }
if (cmsIsToneCurveLinear(d->blueTRC)) { if (!cmsIsToneCurveLinear(d->blueTRC)) {
TRCtriplet[2] = Value[2]; Value[2] = cmsEvalToneCurveFloat(d->blueTRCReverse, Value[2]);
} else {
TRCtriplet[2] = cmsEvalToneCurveFloat(d->blueTRCReverse, Value[2]);
} }
} else { } else {
if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) { if (cmsIsTag(d->profile, cmsSigGrayTRCTag)) {
TRCtriplet.fill(cmsEvalToneCurveFloat(d->grayTRCReverse, Value[0])); Value[0] = cmsEvalToneCurveFloat(d->grayTRCReverse, Value[0]);
} }
} }
Value[0] = TRCtriplet[0];
Value[1] = TRCtriplet[1];