File indexing completed on 2025-03-09 04:04:38

0001 /*
0002  *  SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_STROKE_RANDOM_SOURCE_H
0008 #define __KIS_STROKE_RANDOM_SOURCE_H
0009 
0010 #include <QScopedPointer>
0011 
0012 #include "kritaimage_export.h"
0013 #include "kis_random_source.h"
0014 #include "KisPerStrokeRandomSource.h"
0015 
0016 
0017 /**
0018  * A helper class to handle multiple KisRandomSource objects in a
0019  * stroke strategies. It creates two identical random sources in the
0020  * beginning of the stroke, so, when copied through copy-ctor and set
0021  * another level of detail starts returning the same sequence of
0022  * numbers as was returned for the first stroke.
0023  */
0024 class KRITAIMAGE_EXPORT  KisStrokeRandomSource
0025 {
0026 public:
0027     KisStrokeRandomSource();
0028     KisStrokeRandomSource(const KisStrokeRandomSource &rhs);
0029     KisStrokeRandomSource& operator=(const KisStrokeRandomSource &rhs);
0030 
0031     ~KisStrokeRandomSource();
0032 
0033     KisRandomSourceSP source() const;
0034     KisPerStrokeRandomSourceSP perStrokeSource() const;
0035 
0036     int levelOfDetail() const;
0037     void setLevelOfDetail(int value);
0038 
0039 private:
0040     struct Private;
0041     const QScopedPointer<Private> m_d;
0042 };
0043 
0044 #endif /* __KIS_STROKE_RANDOM_SOURCE_H */