Krita Source Code Documentation
Loading...
Searching...
No Matches
KisStrokeRandomSource Class Reference

#include <kis_stroke_random_source.h>

Classes

struct  Private
 

Public Member Functions

 KisStrokeRandomSource ()
 
 KisStrokeRandomSource (const KisStrokeRandomSource &rhs)
 
int levelOfDetail () const
 
KisStrokeRandomSourceoperator= (const KisStrokeRandomSource &rhs)
 
KisPerStrokeRandomSourceSP perStrokeSource () const
 
void setLevelOfDetail (int value)
 
KisRandomSourceSP source () const
 
 ~KisStrokeRandomSource ()
 

Private Attributes

const QScopedPointer< Privatem_d
 

Detailed Description

A helper class to handle multiple KisRandomSource objects in a stroke strategies. It creates two identical random sources in the beginning of the stroke, so, when copied through copy-ctor and set another level of detail starts returning the same sequence of numbers as was returned for the first stroke.

Definition at line 24 of file kis_stroke_random_source.h.

Constructor & Destructor Documentation

◆ KisStrokeRandomSource() [1/2]

KisStrokeRandomSource::KisStrokeRandomSource ( )

Definition at line 29 of file kis_stroke_random_source.cpp.

30 : m_d(new Private)
31{
32}
const QScopedPointer< Private > m_d

◆ KisStrokeRandomSource() [2/2]

KisStrokeRandomSource::KisStrokeRandomSource ( const KisStrokeRandomSource & rhs)

Definition at line 34 of file kis_stroke_random_source.cpp.

35 : m_d(new Private(*rhs.m_d))
36{
37}

◆ ~KisStrokeRandomSource()

KisStrokeRandomSource::~KisStrokeRandomSource ( )

Definition at line 48 of file kis_stroke_random_source.cpp.

49{
50}

Member Function Documentation

◆ levelOfDetail()

int KisStrokeRandomSource::levelOfDetail ( ) const

Definition at line 63 of file kis_stroke_random_source.cpp.

64{
65 return m_d->levelOfDetail;
66}

References m_d.

◆ operator=()

KisStrokeRandomSource & KisStrokeRandomSource::operator= ( const KisStrokeRandomSource & rhs)

Definition at line 39 of file kis_stroke_random_source.cpp.

40{
41 if (&rhs != this) {
42 *m_d = *rhs.m_d;
43 }
44
45 return *this;
46}

References m_d.

◆ perStrokeSource()

KisPerStrokeRandomSourceSP KisStrokeRandomSource::perStrokeSource ( ) const

Definition at line 57 of file kis_stroke_random_source.cpp.

58{
59 return m_d->levelOfDetail ? m_d->lodNPerStrokeRandomSource : m_d->lod0PerStrokeRandomSource;
60}

References m_d.

◆ setLevelOfDetail()

void KisStrokeRandomSource::setLevelOfDetail ( int value)

Definition at line 68 of file kis_stroke_random_source.cpp.

69{
70 m_d->levelOfDetail = value;
71}
float value(const T *src, size_t ch)

References m_d, and value().

◆ source()

KisRandomSourceSP KisStrokeRandomSource::source ( ) const

Definition at line 52 of file kis_stroke_random_source.cpp.

53{
54 return m_d->levelOfDetail ? m_d->lodNRandomSource : m_d->lod0RandomSource;
55}

References m_d.

Member Data Documentation

◆ m_d

const QScopedPointer<Private> KisStrokeRandomSource::m_d
private

Definition at line 41 of file kis_stroke_random_source.h.


The documentation for this class was generated from the following files: