|
Krita Source Code Documentation
|
#include <kis_gbr_brush.h>
Inheritance diagram for KisGbrBrush:Classes | |
| struct | Private |
Public Member Functions | |
| KoResourceSP | clone () const override |
| QString | defaultFileExtension () const override |
| KisGbrBrush (const KisGbrBrush &rhs) | |
| KisGbrBrush (const QImage &image, const QString &name=QString()) | |
| Load brush as a copy from the specified QImage (handy when you need to copy a brush!) | |
| KisGbrBrush (const QString &filename) | |
| Construct brush to load filename later as brush. | |
| KisGbrBrush (const QString &filename, const QByteArray &data, qint32 &dataPos) | |
| Load brush from the specified data, at position dataPos, and set the filename. | |
| KisGbrBrush (KisPaintDeviceSP image, int x, int y, int w, int h) | |
| Load brush from the specified paint device, in the specified region. | |
| bool | loadFromDevice (QIODevice *dev, KisResourcesInterfaceSP resourcesInterface) override |
| virtual void | makeMaskImage (bool preserveAlpha) |
| KisGbrBrush & | operator= (const KisGbrBrush &rhs) |
| QPair< QString, QString > | resourceType () const override |
| bool | saveToDevice (QIODevice *dev) const override |
| ~KisGbrBrush () override | |
Public Member Functions inherited from KisColorfulBrush | |
| qreal | adjustedMidPoint () const |
| quint8 | adjustmentMidPoint () const |
| bool | autoAdjustMidPoint () const |
| qreal | brightnessAdjustment () const |
| QImage | brushTipImage () const override |
| brushImage the image the brush tip can paint with. Not all brush types have a single image. | |
| qreal | contrastAdjustment () const |
| qreal | estimatedSourceMidPoint () const |
| bool | hasColorAndTransparency () const |
| virtual bool | isImageType () const |
| KisColorfulBrush ()=default | |
| KisColorfulBrush (const KisColorfulBrush &rhs)=default | |
| KisColorfulBrush (const QString &filename) | |
| virtual void | setAdjustmentMidPoint (quint8 value) |
| virtual void | setAutoAdjustMidPoint (bool autoAdjustMidPoint) |
| virtual void | setBrightnessAdjustment (qreal value) |
| virtual void | setContrastAdjustment (qreal value) |
| void | setHasColorAndTransparency (bool value) |
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 quint32 | brushIndex () const |
| virtual enumBrushType | brushType () const |
| virtual bool | canPaintFor (const KisPaintInformation &) |
| virtual QSizeF | characteristicSize (KisDabShape const &) const |
| void | clearBrushPyramid () |
| virtual void | coldInitBrush () |
| virtual void | generateMaskAndApplyMaskOrCreateDab (KisFixedPaintDeviceSP dst, ColoringInformation *coloringInfo, KisDabShape const &, const KisPaintInformation &info, double subPixelX, double subPixelY, qreal softnessFactor, qreal lightnessStrength) const |
| 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 () |
| virtual void | notifyStrokeStarted () |
| KisBrush & | operator= (const KisBrush &rhs)=delete |
| virtual KisOptimizedBrushOutline | outline (bool forcePreciseOutline=false) const |
| virtual KisFixedPaintDeviceSP | outlineSourceImage () const |
| virtual KisFixedPaintDeviceSP | paintDevice (const KoColorSpace *colorSpace, KisDabShape const &, const KisPaintInformation &info, double subPixelX=0, double subPixelY=0) const |
| virtual void | prepareForSeqNo (const KisPaintInformation &info, int seqNo) |
| virtual bool | preserveLightness () const |
| qreal | scale () const |
| virtual void | setAngle (qreal _angle) |
| void | setAutoSpacing (bool active, qreal coeff) |
| virtual void | setBrushApplication (enumBrushApplication brushApplication) |
| virtual void | setGradient (KoAbstractGradientSP gradient) |
| virtual void | setScale (qreal _scale) |
| virtual void | setSpacing (double spacing) |
| 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 QList< KoResourceLoadResult > | embeddedResources (KisResourcesInterfaceSP globalResourcesInterface) const |
| QString | filename () const |
| QImage | image () const |
| bool | isDirty () const |
| virtual bool | isEphemeral () 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) | |
Protected Member Functions | |
| void | setBrushTipImage (const QImage &image) override |
| void | toXML (QDomDocument &d, QDomElement &e) const override |
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) |
Private Member Functions | |
| bool | init () |
| bool | initFromPaintDev (KisPaintDeviceSP image, int x, int y, int w, int h) |
Private Attributes | |
| Private *const | d |
Friends | |
| class | KisBrushExport |
| class | KisImageBrushesPipe |
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" |
Definition at line 26 of file kis_gbr_brush.h.
| KisGbrBrush::KisGbrBrush | ( | const QString & | filename | ) |
Construct brush to load filename later as brush.
Definition at line 69 of file kis_gbr_brush.cpp.
References DEFAULT_SPACING, and KisBrush::setSpacing().
| KisGbrBrush::KisGbrBrush | ( | const QString & | filename, |
| const QByteArray & | data, | ||
| qint32 & | dataPos ) |
Load brush from the specified data, at position dataPos, and set the filename.
Definition at line 76 of file kis_gbr_brush.cpp.
References KisGbrBrush::Private::bytes, d, KisGbrBrush::Private::data, DEFAULT_SPACING, KisGbrBrush::Private::header_size, KisBrush::height(), init(), KisBrush::setSpacing(), and KisBrush::width().
| KisGbrBrush::KisGbrBrush | ( | KisPaintDeviceSP | image, |
| int | x, | ||
| int | y, | ||
| int | w, | ||
| int | h ) |
Load brush from the specified paint device, in the specified region.
Definition at line 90 of file kis_gbr_brush.cpp.
References DEFAULT_SPACING, KoResource::image, initFromPaintDev(), and KisBrush::setSpacing().
| KisGbrBrush::KisGbrBrush | ( | const QImage & | image, |
| const QString & | name = QString() ) |
Load brush as a copy from the specified QImage (handy when you need to copy a brush!)
Definition at line 98 of file kis_gbr_brush.cpp.
References DEFAULT_SPACING, KoResource::image, KoResource::name, setBrushTipImage(), KoResource::setName(), and KisBrush::setSpacing().
|
override |
| KisGbrBrush::KisGbrBrush | ( | const KisGbrBrush & | rhs | ) |
Definition at line 108 of file kis_gbr_brush.cpp.
References d, and KisGbrBrush::Private::data.
|
overridevirtual |
Implements KoResource.
Reimplemented in KisImagePipeBrush.
Definition at line 115 of file kis_gbr_brush.cpp.
References KisGbrBrush().
|
overridevirtual |
Reimplemented from KoResource.
Reimplemented in KisImagePipeBrush.
Definition at line 421 of file kis_gbr_brush.cpp.
|
private |
Definition at line 132 of file kis_gbr_brush.cpp.
References ALPHAMASK, GimpBrushHeader::bytes, KisGbrBrush::Private::bytes, d, KisGbrBrush::Private::data, DEFAULT_SPACING, KoResource::filename, GimpBrushHeader::header_size, KisGbrBrush::Private::header_size, GimpBrushHeader::height, IMAGE, KoResource::image, LIGHTNESSMAP, GimpBrushHeader::magic_number, KisGbrBrush::Private::magic_number, MASK, KoResource::name, KisBrush::setBrushApplication(), setBrushTipImage(), KisBrush::setBrushType(), KisColorfulBrush::setHasColorAndTransparency(), KisBrush::setHeight(), KoResource::setName(), KisBrush::setSpacing(), KoResource::setValid(), KisBrush::setWidth(), GimpBrushHeader::spacing, GimpBrushHeader::version, KisGbrBrush::Private::version, warnKrita, and GimpBrushHeader::width.
|
private |
Definition at line 278 of file kis_gbr_brush.cpp.
References IMAGE, KoResource::image, KoColorConversionTransformation::internalConversionFlags(), KoColorConversionTransformation::internalRenderingIntent(), LIGHTNESSMAP, KisBrush::setBrushApplication(), setBrushTipImage(), KisBrush::setBrushType(), and KoResource::setName().
|
overridevirtual |
Implements KoResource.
Reimplemented in KisImagePipeBrush.
Definition at line 125 of file kis_gbr_brush.cpp.
References d, KisGbrBrush::Private::data, and init().
|
virtual |
Convert the mask to inverted gray scale, so it is alpha mask. It can be used as MASK brush type. This operates on the data of the brush, so it destruct the original brush data.
| preserveAlpha | convert to grayscale, but save as full RGBA format, to allow preserving lightness option |
Reimplemented in KisImagePipeBrush.
Definition at line 371 of file kis_gbr_brush.cpp.
References ALPHAMASK, KisColorfulBrush::brushTipImage(), KisBrush::clearBrushPyramid(), IMAGE, KoResource::image, KisColorfulBrush::isImageType(), MASK, KisBrush::resetOutlineCache(), KisBrush::setBrushApplication(), setBrushTipImage(), and KisBrush::setBrushType().
| KisGbrBrush & KisGbrBrush::operator= | ( | const KisGbrBrush & | rhs | ) |
|
inlineoverridevirtual |
Reimplemented from KisBrush.
Definition at line 58 of file kis_gbr_brush.h.
References ResourceType::Brushes, and ResourceSubType::GbrBrushes.
|
overridevirtual |
Reimplemented from KoResource.
Reimplemented in KisImagePipeBrush.
Definition at line 291 of file kis_gbr_brush.cpp.
References KisColorfulBrush::brushTipImage(), GimpBrushHeader::bytes, KoResource::filename, GimpV2BrushMagic, GimpBrushHeader::header_size, KisBrush::height(), GimpBrushHeader::height, KoResource::image, KisColorfulBrush::isImageType(), GimpBrushHeader::magic_number, KoResource::name, KisBrush::spacing(), GimpBrushHeader::spacing, KoResource::valid, GimpBrushHeader::version, KisBrush::width(), and GimpBrushHeader::width.
|
overrideprotectedvirtual |
The image is used to represent the brush in the gui, and may also, depending on the brush type be used to define the actual brush instance.
Reimplemented from KisBrush.
Definition at line 365 of file kis_gbr_brush.cpp.
References KoResource::image, KisBrush::setBrushTipImage(), and KoResource::setValid().
|
overrideprotectedvirtual |
Serialize this brush to XML.
Reimplemented from KisColorfulBrush.
Definition at line 415 of file kis_gbr_brush.cpp.
References d, KisBrush::predefinedBrushToXML(), and KisColorfulBrush::toXML().
|
friend |
Definition at line 82 of file kis_gbr_brush.h.
|
friend |
save the content of this brush to an IO device
Definition at line 81 of file kis_gbr_brush.h.
|
private |
Definition at line 94 of file kis_gbr_brush.h.