19#ifndef KIS_IMAGEPIPE_BRUSH_
20#define KIS_IMAGEPIPE_BRUSH_
23#include <tqvaluelist.h>
24#include <tqvaluevector.h>
30#include "kis_resource.h"
32#include "kis_global.h"
61 for (
int i = 0; i < MaxDim; i++) {
63 selection[i] = Constant;
77 Constant, Incremental, Angular, Velocity, Random, Pressure, TiltX, TiltY
79 enum Placement { DefaultPlacement, ConstantPlacement, RandomPlacement };
80 static int const MaxDim = 4;
90 TQ_INT32 rank[MaxDim];
101class KisImagePipeBrush :
public KisBrush {
102 typedef KisBrush super;
107 KisImagePipeBrush(
const TQString& filename);
112 KisImagePipeBrush(
const TQString& name,
int w,
int h,
113 TQValueVector< TQValueVector<KisPaintDevice*> > devices,
114 TQValueVector<KisPipeBrushParasite::SelectionMode> modes);
115 virtual ~KisImagePipeBrush();
120 virtual bool saveToDevice(TQIODevice* dev)
const;
125 virtual TQImage
img();
131 double subPixelX = 0,
double subPixelY = 0)
const;
133 double subPixelX = 0,
double subPixelY = 0)
const;
135 virtual bool useColorAsMask()
const;
136 virtual void setUseColorAsMask(
bool useColorAsMask);
137 virtual bool hasColor()
const;
139 virtual enumBrushType brushType()
const;
145 virtual bool canPaintFor(
const KisPaintInformation& info);
147 virtual void makeMaskImage();
149 virtual KisImagePipeBrush* clone()
const;
153 void setParasiteString(
const TQString& parasite);
154 void selectNextBrush(
const KisPaintInformation& info)
const;
157 TQString m_parasiteString;
158 mutable KisPipeBrushParasite m_parasite;
159 TQ_UINT32 m_numOfBrushes;
160 mutable TQ_UINT32 m_currentBrush;
163 mutable TQPtrList<KisBrush> m_brushes;
165 enumBrushType m_brushType;
Generates an 'outline' for a paint device.
A colorspace is the definition of a certain color model in Chalk.
The parasite info that gets loaded from the terribly documented gimp pipe brush parasite.
KisPipeBrushParasite()
Set some default values.
TQ_INT32 brushesCount[MaxDim]
The total count of brushes in each dimension (helper).
void setBrushesCount()
Initializes the brushesCount helper.
bool saveToDevice(TQIODevice *dev) const
Saves a GIMP-compatible representation of this parasite to the device.
SelectionMode
Velocity won't be supported, atm Angular and Tilt aren't either, but have chances of implementation.
bool needsMovement
If true, the brush won't be painted when there is no motion.
TQ_INT32 index[MaxDim]
The current index in each dimension, so that the selection modes know where to start.
virtual TQImage img()=0
Returns a TQImage representing this resource.
virtual bool save()=0
Save this resource asynchronously.
virtual bool load()=0
Load this resource.