|
Krita Source Code Documentation
|
#include <kis_text_brush.h>
Inheritance diagram for KisTextBrush:Public Member Functions | |
| quint32 | brushIndex () const override |
| KoResourceSP | clone () const override |
| QFont | font () |
| void | generateMaskAndApplyMaskOrCreateDab (KisFixedPaintDeviceSP dst, KisBrush::ColoringInformation *coloringInformation, KisDabShape const &, const KisPaintInformation &info, double subPixelX=0, double subPixelY=0, qreal softnessFactor=DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength=1.0) const override |
| bool | isEphemeral () const override |
| KisTextBrush () | |
| KisTextBrush (const KisTextBrush &rhs) | |
| bool | loadFromDevice (QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override |
| qint32 | maskHeight (KisDabShape const &, double subPixelX, double subPixelY, const KisPaintInformation &info) const override |
| qint32 | maskWidth (KisDabShape const &, double subPixelX, double subPixelY, const KisPaintInformation &info) const override |
| void | notifyStrokeStarted () override |
| KisTextBrush & | operator= (const KisTextBrush &rhs)=delete |
| KisFixedPaintDeviceSP | paintDevice (const KoColorSpace *colorSpace, KisDabShape const &, const KisPaintInformation &info, double subPixelX, double subPixelY) const override |
| bool | pipeMode () const |
| void | prepareForSeqNo (const KisPaintInformation &info, int seqNo) override |
| bool | saveToDevice (QIODevice *dev) const override |
| void | setAngle (qreal _angle) override |
| void | setFont (const QFont &font) |
| void | setPipeMode (bool pipe) |
| void | setScale (qreal _scale) override |
| void | setSpacing (double _spacing) override |
| void | setText (const QString &txt) |
| QString | text (void) const |
| void | toXML (QDomDocument &, QDomElement &) const override |
| void | updateBrush () |
| ~KisTextBrush () override | |
Public Member Functions inherited from KisScalingSizeBrush | |
| KisScalingSizeBrush () | |
| KisScalingSizeBrush (const KisScalingSizeBrush &rhs) | |
| KisScalingSizeBrush (const QString &filename) | |
| void | setUserEffectiveSize (qreal value) override |
| qreal | userEffectiveSize () const override |
Public Member Functions inherited from KisBrush | |
| qreal | angle () const |
| virtual bool | applyingGradient () const |
| bool | autoSpacingActive () const |
| qreal | autoSpacingCoeff () const |
| virtual enumBrushApplication | brushApplication () const |
| virtual QImage | brushTipImage () const |
| brushImage the image the brush tip can paint with. Not all brush types have a single image. | |
| virtual enumBrushType | brushType () const |
| virtual bool | canPaintFor (const KisPaintInformation &) |
| virtual QSizeF | characteristicSize (KisDabShape const &) const |
| void | clearBrushPyramid () |
| virtual void | coldInitBrush () |
| void | generateMaskAndApplyMaskOrCreateDab (KisFixedPaintDeviceSP dst, ColoringInformation *coloringInfo, KisDabShape const &, const KisPaintInformation &info, double subPixelX=0, double subPixelY=0, qreal softnessFactor=DEFAULT_SOFTNESS_FACTOR) const |
| qint32 | height () const |
| QPointF | hotSpot (KisDabShape const &, const KisPaintInformation &info) const |
| virtual bool | isPiercedApprox () const |
| KisBrush () | |
| KisBrush (const KisBrush &rhs) | |
| KisBrush (const QString &filename) | |
| virtual void | lodLimitations (KisPaintopLodLimitations *l) const |
| void | mask (KisFixedPaintDeviceSP dst, const KisPaintDeviceSP src, KisDabShape const &shape, const KisPaintInformation &info, double subPixelX=0, double subPixelY=0, qreal softnessFactor=DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength=DEFAULT_LIGHTNESS_STRENGTH) const |
| void | mask (KisFixedPaintDeviceSP dst, const KoColor &color, KisDabShape const &shape, const KisPaintInformation &info, double subPixelX=0, double subPixelY=0, qreal softnessFactor=DEFAULT_SOFTNESS_FACTOR, qreal lightnessStrength=DEFAULT_LIGHTNESS_STRENGTH) const |
| double | maskAngle (double angle=0) const |
| virtual qint32 | maskHeight (KisDabShape const &, qreal subPixelX, qreal subPixelY, const KisPaintInformation &info) const |
| virtual qint32 | maskWidth (KisDabShape const &, qreal subPixelX, qreal subPixelY, const KisPaintInformation &info) const |
| virtual void | notifyBrushIsGoingToBeClonedForStroke () |
| KisBrush & | operator= (const KisBrush &rhs)=delete |
| virtual KisOptimizedBrushOutline | outline (bool forcePreciseOutline=false) const |
| virtual KisFixedPaintDeviceSP | outlineSourceImage () const |
| virtual bool | preserveLightness () const |
| QPair< QString, QString > | resourceType () const override |
| qreal | scale () const |
| void | setAutoSpacing (bool active, qreal coeff) |
| virtual void | setBrushApplication (enumBrushApplication brushApplication) |
| virtual void | setBrushTipImage (const QImage &image) |
| virtual void | setGradient (KoAbstractGradientSP gradient) |
| double | spacing () const |
| virtual bool | supportsCaching () const |
| qint32 | width () const |
| ~KisBrush () override | |
Public Member Functions inherited from KoResource | |
| bool | active () const |
| void | addMetaData (QString key, QVariant value) |
| store the given key, value pair in the resource | |
| virtual void | clearSideLoadedResources () |
| virtual QString | defaultFileExtension () const |
| virtual QList< KoResourceLoadResult > | embeddedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| QString | filename () const |
| QImage | image () const |
| bool | isDirty () const |
| virtual bool | isSerializable () const |
| KoResource () | |
| KoResource (const KoResource &rhs) | |
| KoResource (const QString &filename) | |
| virtual QList< KoResourceLoadResult > | linkedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| bool | load (KisResourcesInterfaceSP resourcesInterface) |
| QString | md5Sum (bool generateIfEmpty=true) const |
| QMap< QString, QVariant > | metadata () const |
| get a map with all the metadata | |
| virtual QString | name () const |
| KoResource & | operator= (const KoResource &rhs)=delete |
| bool | permanent () const |
| virtual QList< int > | requiredCanvasResources () const |
| QList< KoResourceLoadResult > | requiredResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| int | resourceId () const |
| bool | save () |
| void | setActive (bool active) |
| void | setDirty (bool value) |
| Mark the preset as modified but not saved. | |
| void | setFilename (const QString &filename) |
| void | setImage (const QImage &image) |
| void | setMD5Sum (const QString &md5sum) |
| Set the md5sum of this resource. It must be in hex-encoded string format. | |
| void | setName (const QString &name) |
| void | setPermanent (bool permanent) |
| void | setResourceId (int id) |
| void | setStorageLocation (const QString &location) |
| void | setValid (bool valid) |
| void | setVersion (int version) |
| virtual QList< KoResourceLoadResult > | sideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| KoResourceSignature | signature () const |
| QString | storageLocation () const |
| QList< KoResourceLoadResult > | takeSideLoadedResources (KisResourcesInterfaceSP globalResourcesInterface) |
| virtual QImage | thumbnail () const |
| thumbnail the thumbnail image to use in resource selectors | |
| virtual QString | thumbnailPath () const |
| thumbnailPath returns the path to a separate thumbnail image, outside the actual resource file itself. If the path is relative, it is supposed start in the same location as the resource itself. If it's absolute, that is, it starts with "/", it is from the root of the storage. | |
| virtual void | updateThumbnail () |
| updateThumbnail updates the thumbnail for this resource. Reimplement if your thumbnail is something else than the image set with setImage. | |
| bool | valid () const |
| int | version () const |
| Get the version of the resource. | |
| virtual | ~KoResource () |
Public Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
Private Attributes | |
| KisTextBrushesPipe * | m_brushesPipe |
| QFont | m_font |
| QString | m_text |
Additional Inherited Members | |
Static Public Member Functions inherited from KisBrush | |
| static KisBrushSP | fromXML (const QDomElement &element, KisResourcesInterfaceSP resourcesInterface) |
| static KoResourceLoadResult | fromXMLLoadResult (const QDomElement &element, KisResourcesInterfaceSP resourcesInterface) |
Public Attributes inherited from KoResource | |
| bool | active {true} |
| QString | filename |
| QImage | image |
| QString | md5sum |
| QMap< QString, QVariant > | metadata |
| bool | modified {false} |
| QString | name |
| bool | permanent {false} |
| int | resourceId {-1} |
| QString | storageLocation |
| bool | valid {false} |
| int | version {-1} |
Public Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Static Public Attributes inherited from KisBrush | |
| static const QString | brushTypeMetaDataKey = "image-based-brush" |
Protected Member Functions inherited from KisBrush | |
| void | generateOutlineCache () |
| bool | outlineCacheIsValid () const |
| void | predefinedBrushToXML (const QString &type, QDomElement &e) const |
| void | resetOutlineCache () |
| virtual void | setBrushType (enumBrushType type) |
| void | setHeight (qint32 height) |
| void | setHotSpot (QPointF) |
| void | setWidth (qint32 width) |
Definition at line 19 of file kis_text_brush.h.
| KisTextBrush::KisTextBrush | ( | ) |
Definition at line 170 of file kis_text_brush.cpp.
References setPipeMode().
| KisTextBrush::KisTextBrush | ( | const KisTextBrush & | rhs | ) |
Definition at line 176 of file kis_text_brush.cpp.
|
override |
Definition at line 184 of file kis_text_brush.cpp.
References m_brushesPipe.
|
overridevirtual |
Reimplemented from KisBrush.
Definition at line 312 of file kis_text_brush.cpp.
References KisBrush::brushType(), KisTextBrushesPipe::currentBrushIndex(), m_brushesPipe, and MASK.
|
overridevirtual |
Implements KoResource.
Definition at line 189 of file kis_text_brush.cpp.
References KisTextBrush().
| QFont KisTextBrush::font | ( | ) |
|
overridevirtual |
Create a mask and either mask dst (that is, change all alpha values of the existing pixels to those of the mask) or, if coloringInfo is present, clear dst and fill dst with pixels according to coloringInfo, masked according to the generated mask.
| dst | the destination that will be draw on the image, and this function will edit its alpha channel |
| coloringInfo | coloring information that will be copied on the dab, it can be null |
| shape | a shape applied on the alpha mask |
| info | the painting information (this is only and should only be used by KisImagePipeBrush and only to be backward compatible with the Gimp, KisImagePipeBrush is ignoring scale and angle information) |
| subPixelX | sub position of the brush (contained between 0.0 and 1.0) |
| subPixelY | sub position of the brush (contained between 0.0 and 1.0) |
| softnessFactor | softness factor of the brush |
Reimplemented from KisBrush.
Definition at line 252 of file kis_text_brush.cpp.
References KisBrush::brushType(), KisBrush::generateMaskAndApplyMaskOrCreateDab(), KisBrushesPipe< BrushType >::generateMaskAndApplyMaskOrCreateDab(), m_brushesPipe, and MASK.
|
overridevirtual |
Ephemeral resource is a type of resource that has no physical representation on disk. Therefore, its load()/save() calls do nothing. Such resources will always have empty md5Sum() and, therefore, will never be stored in the resources database.
This type of resources is created directly by the corresponding factory or other object (e.g. KisAutoBrushFactory).
Ephemeral resource cannot be serializable.
Reimplemented from KoResource.
Definition at line 194 of file kis_text_brush.cpp.
|
overridevirtual |
Implements KoResource.
Definition at line 199 of file kis_text_brush.cpp.
|
override |
Definition at line 324 of file kis_text_brush.cpp.
References KisBrush::brushType(), m_brushesPipe, MASK, KisBrush::maskHeight(), and KisBrushesPipe< BrushType >::maskHeight().
|
override |
Definition at line 317 of file kis_text_brush.cpp.
References KisBrush::brushType(), m_brushesPipe, MASK, KisBrush::maskWidth(), and KisBrushesPipe< BrushType >::maskWidth().
|
overridevirtual |
Is called by the paint op when a paintop starts a stroke. The point is that we store brushes a server while the paint ops are are recreated all the time. Is means that upon a stroke start the brushes may need to clear its state.
Reimplemented from KisBrush.
Definition at line 242 of file kis_text_brush.cpp.
References m_brushesPipe, and KisTextBrushesPipe::notifyStrokeStarted().
|
delete |
|
overridevirtual |
Return a fixed paint device that contains a correctly scaled image dab.
Reimplemented from KisBrush.
Definition at line 264 of file kis_text_brush.cpp.
References KisBrush::brushType(), m_brushesPipe, MASK, KisBrush::paintDevice(), and KisBrushesPipe< BrushType >::paintDevice().
| bool KisTextBrush::pipeMode | ( | ) | const |
Definition at line 217 of file kis_text_brush.cpp.
References KisBrush::brushType(), and PIPE_MASK.
|
overridevirtual |
Is called by the multithreaded queue to prepare a specific brush tip for the particular seqNo.
NOTE: one should use always call prepareForSeqNo() before using the brush
Currently, this is used by pipe'd brushes to implement incremental and random parasites
Reimplemented from KisBrush.
Definition at line 247 of file kis_text_brush.cpp.
References m_brushesPipe, and KisBrushesPipe< BrushType >::prepareForSeqNo().
|
overridevirtual |
Reimplemented from KoResource.
Definition at line 206 of file kis_text_brush.cpp.
|
overridevirtual |
Reimplemented from KisBrush.
Definition at line 331 of file kis_text_brush.cpp.
References m_brushesPipe, KisBrush::setAngle(), and KisBrushesPipe< BrushType >::setAngle().
| void KisTextBrush::setFont | ( | const QFont & | font | ) |
Definition at line 232 of file kis_text_brush.cpp.
| void KisTextBrush::setPipeMode | ( | bool | pipe | ) |
Definition at line 212 of file kis_text_brush.cpp.
References MASK, PIPE_MASK, and KisBrush::setBrushType().
|
overridevirtual |
Reimplemented from KisBrush.
Definition at line 337 of file kis_text_brush.cpp.
References m_brushesPipe, KisBrush::setScale(), and KisBrushesPipe< BrushType >::setScale().
|
overridevirtual |
Change the spacing of the brush.
| spacing | a spacing of 1.0 means that strokes will be separated from one time the size of the brush. |
Reimplemented from KisBrush.
Definition at line 343 of file kis_text_brush.cpp.
References m_brushesPipe, KisBrush::setSpacing(), and KisBrushesPipe< BrushType >::setSpacing().
| void KisTextBrush::setText | ( | const QString & | txt | ) |
| QString KisTextBrush::text | ( | void | ) | const |
|
overridevirtual |
Serialize this brush to XML.
Reimplemented from KisBrush.
Definition at line 277 of file kis_text_brush.cpp.
References KisBrush::brushType(), m_font, m_text, PIPE_MASK, KisBrush::spacing(), KisDomUtils::toString(), and KisBrush::toXML().
| void KisTextBrush::updateBrush | ( | ) |
Definition at line 289 of file kis_text_brush.cpp.
References KisBrush::brushType(), KisTextBrushesPipe::firstBrush(), KIS_ASSERT_RECOVER, m_brushesPipe, m_font, m_text, MASK, PIPE_MASK, KisTextBrushesPipe::renderChar(), KisBrush::resetOutlineCache(), KisBrush::setBrushTipImage(), KisBrush::setBrushType(), KisTextBrushesPipe::setText(), and KoResource::setValid().
|
private |
Definition at line 70 of file kis_text_brush.h.
|
private |
Definition at line 66 of file kis_text_brush.h.
|
private |
Definition at line 67 of file kis_text_brush.h.