krita

KisPipeBrushParasite Class Reference

#include <kis_imagepipe_brush.h>

List of all members.


Detailed Description

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 apparantly 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 57 of file kis_imagepipe_brush.h.


Public Types

enum  SelectionMode {
  Constant, Incremental, Angular, Velocity,
  Random, Pressure, TiltX, TiltY
}
enum  Placement { DefaultPlacement, ConstantPlacement, RandomPlacement }

Public Member Functions

 KisPipeBrushParasite ()
void setBrushesCount ()
 KisPipeBrushParasite (const QString &source)
bool saveToDevice (QIODevice *dev) const

Public Attributes

Q_INT32 ncells
Q_INT32 dim
Q_INT32 rank [MaxDim]
SelectionMode selection [MaxDim]
Q_INT32 brushesCount [MaxDim]
Q_INT32 index [MaxDim]
bool needsMovement

Static Public Attributes

static int const MaxDim = 4

Member Enumeration Documentation

Velocity won't be supported, atm Angular and Tilt aren't either, but have chances of implementation.

Definition at line 76 of file kis_imagepipe_brush.h.


Constructor & Destructor Documentation

KisPipeBrushParasite::KisPipeBrushParasite (  )  [inline]

Set some default values.

Definition at line 60 of file kis_imagepipe_brush.h.

KisPipeBrushParasite::KisPipeBrushParasite ( const QString &  source  ) 

Load the parasite from the source string.

Definition at line 56 of file kis_imagepipe_brush.cc.


Member Function Documentation

void KisPipeBrushParasite::setBrushesCount (  ) 

Initializes the brushesCount helper.

Definition at line 119 of file kis_imagepipe_brush.cc.

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 '
')

FIXME things like step, placement and so are not added (nor loaded, as a matter of fact)

Definition at line 127 of file kis_imagepipe_brush.cc.


Member Data Documentation

The total count of brushes in each dimension (helper).

Definition at line 93 of file kis_imagepipe_brush.h.

The current index in each dimension, so that the selection modes know where to start.

Definition at line 95 of file kis_imagepipe_brush.h.

If true, the brush won't be painted when there is no motion.

Definition at line 97 of file kis_imagepipe_brush.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys