|
Krita Source Code Documentation
|
#include <kis_pipebrush_parasite.h>
Public Types | |
| enum | Placement { DefaultPlacement , ConstantPlacement , RandomPlacement } |
Public Member Functions | |
| void | init () |
| KisPipeBrushParasite () | |
| Set some default values. | |
| KisPipeBrushParasite (QStringView source) | |
| Load the parasite from the source string. | |
| bool | loadFromDevice (QIODevice *dev) |
| void | sanitize () |
| bool | saveToDevice (QIODevice *dev) const |
| void | setBrushesCount () |
| Initializes the brushesCount helper. | |
Public Attributes | |
| qint32 | brushesCount [MaxDim] |
| The total count of brushes in each dimension (helper) | |
| qint32 | dim {0} |
| qint32 | index [MaxDim] |
| The current index in each dimension, so that the selection modes know where to start. | |
| qint32 | ncells {0} |
| bool | needsMovement {false} |
| If true, the brush won't be painted when there is no motion. | |
| qint32 | rank [MaxDim] {} |
| KisParasite::SelectionMode | selection [MaxDim] |
| QString | selectionMode |
Static Public Attributes | |
| static int const | MaxDim = 4 |
The parasite info that gets loaded from the terribly documented gimp pipe brush parasite.
We only store data we actually use.
BC: How it seems the dimension stuff interacts with rank, selectionMode and the actual selection of a brush to be drawn. So apparently you can have at most 4 'dimensions'. Each dimension has a number of brushes, the rank. Each dimension has an associated selection mode and placement mode (which we don't use). The selection mode says us in which way which of the brushes or brush sets will be selected. In the case of a 1-dimensional pipe brush it is easy.
However, when there are more dimensions it is a bit harder. You can according to the gimp source maximally use 4 dimensions. When you want to select a brush, you first go to the first dimension. Say it has a rank of 2. The code chooses one of the 2 according to the selection mode. Say we choose 2. Then the currentBrush will skip over all the brushes from the first element in dimension 1. Then in dimension we pick again from the choices we have in dimension 2. We again add the appropriate amount to currentBrush. And so on, until we have reached dimension dim. Or at least, that is how it looks like, we'll know for sure when we can test it better with >1 dim brushes and Angular selectionMode.
Definition at line 48 of file kis_pipebrush_parasite.h.
| Enumerator | |
|---|---|
| DefaultPlacement | |
| ConstantPlacement | |
| RandomPlacement | |
Definition at line 74 of file kis_pipebrush_parasite.h.
|
inline |
Set some default values.
Definition at line 52 of file kis_pipebrush_parasite.h.
| KisPipeBrushParasite::KisPipeBrushParasite | ( | QStringView | source | ) |
Load the parasite from the source string.
Definition at line 11 of file kis_pipebrush_parasite.cpp.
References KisParasite::Angular, KisParasite::Constant, dim, KisParasite::Incremental, index, init(), MaxDim, ncells, needsMovement, KisParasite::Pressure, KisParasite::Random, rank, selection, selectionMode, setBrushesCount(), source(), KisParasite::TiltX, KisParasite::TiltY, KisParasite::Velocity, and warnImage.
| void KisPipeBrushParasite::init | ( | ) |
Definition at line 82 of file kis_pipebrush_parasite.cpp.
References brushesCount, KisParasite::Constant, index, MaxDim, rank, and selection.
| bool KisPipeBrushParasite::loadFromDevice | ( | QIODevice * | dev | ) |
| void KisPipeBrushParasite::sanitize | ( | ) |
Definition at line 90 of file kis_pipebrush_parasite.cpp.
References KisParasite::Angular, KisParasite::Constant, dim, KisParasite::Incremental, rank, selection, and warnImage.
| bool KisPipeBrushParasite::saveToDevice | ( | QIODevice * | dev | ) | const |
Saves a GIMP-compatible representation of this parasite to the device. Also writes the number of brushes (== ncells) (no trailing '
')
Definition at line 124 of file kis_pipebrush_parasite.cpp.
References KisParasite::Angular, KisParasite::Constant, dim, KisParasite::Incremental, ncells, KisParasite::Pressure, KisParasite::Random, rank, selection, KisPortingUtils::setUtf8OnStream(), KisParasite::TiltX, KisParasite::TiltY, and KisParasite::Velocity.
| void KisPipeBrushParasite::setBrushesCount | ( | ) |
Initializes the brushesCount helper.
Definition at line 104 of file kis_pipebrush_parasite.cpp.
References brushesCount, dim, ncells, and rank.
The total count of brushes in each dimension (helper)
Definition at line 94 of file kis_pipebrush_parasite.h.
| qint32 KisPipeBrushParasite::dim {0} |
Definition at line 80 of file kis_pipebrush_parasite.h.
The current index in each dimension, so that the selection modes know where to start.
Definition at line 97 of file kis_pipebrush_parasite.h.
Definition at line 76 of file kis_pipebrush_parasite.h.
| qint32 KisPipeBrushParasite::ncells {0} |
Definition at line 79 of file kis_pipebrush_parasite.h.
If true, the brush won't be painted when there is no motion.
Definition at line 100 of file kis_pipebrush_parasite.h.
Definition at line 88 of file kis_pipebrush_parasite.h.
| KisParasite::SelectionMode KisPipeBrushParasite::selection[MaxDim] |
Definition at line 90 of file kis_pipebrush_parasite.h.
| QString KisPipeBrushParasite::selectionMode |
Definition at line 91 of file kis_pipebrush_parasite.h.