11#include <QMutexLocker>
12#include <QRandomGenerator>
14#include <boost/random/normal_distribution.hpp>
15#include <boost/random/taus88.hpp>
16#include <boost/random/uniform_smallint.hpp>
23 boost::taus88 tempGenerator(
seed);
43 : m_d(new
Private(QRandomGenerator::global()->generate()))
61 QMutexLocker l(&
mutex);
68 boost::taus88 oneTimeGenerator(
seed +
qHash(key));
69 const qint64 newValue = oneTimeGenerator();
78 return min +
m_d->fetchInt(key) % (max - min);
83 return qreal(
m_d->fetchInt(key)) /
m_d->generatorMax;
~KisPerStrokeRandomSource()
KisPerStrokeRandomSource()
const QScopedPointer< Private > m_d
qreal generateNormalized(const QString &key) const
int generate(const QString &key, int min, int max) const
QHash< QString, qint64 > valuesCache
Private(const Private &rhs)
qint64 fetchInt(const QString &key)