|
Krita Source Code Documentation
|
#include <hairy_brush.h>
Public Member Functions | |
| void | fromDabWithDensity (KisFixedPaintDeviceSP dab, qreal density) |
| set the shape of the bristles according the dab | |
| HairyBrush () | |
| void | paintLine (KisPaintDeviceSP dab, KisPaintDeviceSP layer, const KisPaintInformation &pi1, const KisPaintInformation &pi2, qreal scale, qreal rotation) |
| void | setInkColor (const KoColor &color) |
| set ink color for the whole bristle shape | |
| void | setProperties (KisHairyProperties *properties) |
| set parameters for the brush engine | |
| ~HairyBrush () | |
Private Member Functions | |
| void | addBristleInk (Bristle *bristle, const QPointF &pos, const KoColor &color) |
| paints single bristle | |
| void | colorifyBristles (KisPaintDeviceSP source, QPointF point) |
| similar to sample input color in spray | |
| double | computeMousePressure (double distance) |
| compute mouse pressure according distance | |
| void | darkenPixel (int wx, int wy, const KoColor &color) |
| check the opacity of dab pixel and if the opacity is less than color, it will copy color to dab | |
| qreal | fetchInkDepletion (Bristle *bristle, int inkDepletionSize) |
| fetch actual ink status according depletion curve | |
| bool | firstStroke () const |
| void | initAndCache () |
| void | opacityDepletion (Bristle *bristle, KoColor &bristleColor, qreal pressure, qreal inkDepletion) |
| simulate running out of ink through opacity decreasing | |
| void | paintParticle (QPointF pos, const KoColor &color) |
| paint wu particle using composite operation | |
| void | paintParticle (QPointF pos, const KoColor &color, qreal weight) |
| paint wu particle by copying the color and setup just the opacity, weight is complementary to opacity of the color | |
| void | plotPixel (int wx, int wy, const KoColor &color) |
| composite single pixel to dab | |
| void | repositionBristles (double angle, double slope) |
| void | saturationDepletion (Bristle *bristle, KoColor &bristleColor, qreal pressure, qreal inkDepletion) |
| simulate running out of saturation | |
Private Attributes | |
| QVector< Bristle * > | m_bristles |
| KoColor | m_color |
| const KoCompositeOp * | m_compositeOp {nullptr} |
| int | m_counter {0} |
| KisPaintDeviceSP | m_dab |
| KisRandomAccessorSP | m_dabAccessor |
| double | m_lastAngle {0.0} |
| double | m_oldPressure {1.0} |
| QHash< QString, QVariant > | m_params |
| quint32 | m_pixelSize {0} |
| const KisHairyProperties * | m_properties {nullptr} |
| int | m_saturationId {-1} |
| Trajectory | m_trajectory |
| KoColorTransformation * | m_transfo {nullptr} |
| QTransform | m_transform |
Definition at line 56 of file hairy_brush.h.
| HairyBrush::HairyBrush | ( | ) |
Definition at line 28 of file hairy_brush.cpp.
References m_counter, m_lastAngle, m_oldPressure, and m_saturationId.
| HairyBrush::~HairyBrush | ( | ) |
Definition at line 37 of file hairy_brush.cpp.
References m_bristles, and m_transfo.
|
inlineprivate |
paints single bristle
Definition at line 296 of file hairy_brush.cpp.
References KisHairyProperties::antialias, darkenPixel(), m_properties, paintParticle(), plotPixel(), and KisHairyProperties::useCompositing.
|
private |
similar to sample input color in spray
Definition at line 418 of file hairy_brush.cpp.
References KisPaintDevice::colorSpace(), KoColor::data(), m_bristles, m_dab, KisCrossDeviceColorSamplerImpl< Traits >::sampleOldColor(), and source().
|
private |
compute mouse pressure according distance
Definition at line 401 of file hairy_brush.cpp.
References distance(), and m_oldPressure.
check the opacity of dab pixel and if the opacity is less than color, it will copy color to dab
Definition at line 393 of file hairy_brush.cpp.
References KisPaintDevice::colorSpace(), KoColor::data(), m_dab, m_dabAccessor, m_pixelSize, KisRandomConstAccessorNG::moveTo(), KoColor::opacityU8(), KoColorSpace::opacityU8(), and KisBaseAccessor::rawData().
|
inlineprivate |
fetch actual ink status according depletion curve
Definition at line 239 of file hairy_brush.cpp.
References Bristle::counter(), KisHairyProperties::inkDepletionCurve, and m_properties.
|
inlineprivate |
Definition at line 127 of file hairy_brush.h.
References m_counter.
| void HairyBrush::fromDabWithDensity | ( | KisFixedPaintDeviceSP | dab, |
| qreal | density ) |
set the shape of the bristles according the dab
Definition at line 58 of file hairy_brush.cpp.
References KisFixedPaintDevice::bounds(), KisFixedPaintDevice::colorSpace(), KisFixedPaintDevice::data(), KoColor::data(), KisRandomSource::generateNormalized(), m_bristles, KoColorSpace::opacityF(), KisFixedPaintDevice::pixelSize(), and Bristle::setColor().
|
private |
Definition at line 45 of file hairy_brush.cpp.
References KisPaintDevice::colorSpace(), COMPOSITE_OVER, KoColorSpace::compositeOp(), KoColorSpace::createColorTransformation(), m_compositeOp, m_dab, m_params, m_pixelSize, m_properties, m_saturationId, m_transfo, KoColorTransformation::parameterId(), KoColorSpace::pixelSize(), and KisHairyProperties::useSaturation.
|
private |
simulate running out of ink through opacity decreasing
Definition at line 277 of file hairy_brush.cpp.
References KisHairyProperties::bristleInkAmountWeight, KisHairyProperties::bristleLengthWeight, Bristle::inkAmount(), KisHairyProperties::inkDepletionWeight, kisBoundFast(), Bristle::length(), m_properties, OPACITY_OPAQUE_F, KisHairyProperties::pressureWeight, KoColor::setOpacity(), and KisHairyProperties::useWeights.
| void HairyBrush::paintLine | ( | KisPaintDeviceSP | dab, |
| KisPaintDeviceSP | layer, | ||
| const KisPaintInformation & | pi1, | ||
| const KisPaintInformation & | pi2, | ||
| qreal | scale, | ||
| qreal | rotation ) |
Definition at line 96 of file hairy_brush.cpp.
References addBristleInk(), KisHairyProperties::antialias, colorifyBristles(), KisPaintDevice::colorSpace(), computeMousePressure(), KisHairyProperties::connectedPath, KisPaintDevice::createRandomAccessorNG(), KoColor::data(), dbgKrita, distance(), fetchInkDepletion(), firstStroke(), KisRandomSource::generateNormalized(), Trajectory::getLinearTrajectory(), initAndCache(), KisHairyProperties::inkDepletionCurve, KisHairyProperties::inkDepletionEnabled, m_bristles, m_counter, m_dab, m_dabAccessor, m_pixelSize, m_properties, m_trajectory, m_transfo, m_transform, opacityDepletion(), KoColor::opacityU8(), KisPaintInformation::pos(), KisPaintInformation::pressure(), KisHairyProperties::randomFactor, KisPaintInformation::randomSource(), saturationDepletion(), KoColor::setOpacity(), KisHairyProperties::shearFactor, Trajectory::size(), KisHairyProperties::threshold, KisHairyProperties::useMousePressure, KisHairyProperties::useOpacity, KisHairyProperties::useSaturation, and KisHairyProperties::useSoakInk.
paint wu particle using composite operation
Definition at line 357 of file hairy_brush.cpp.
References KoColor::data(), m_color, m_pixelSize, KoColor::opacityU8(), plotPixel(), and KoColor::setOpacity().
paint wu particle by copying the color and setup just the opacity, weight is complementary to opacity of the color
Definition at line 318 of file hairy_brush.cpp.
References KisPaintDevice::colorSpace(), KoColor::data(), m_dab, m_dabAccessor, KisRandomConstAccessorNG::moveTo(), OPACITY_OPAQUE_U8, OPACITY_TRANSPARENT_U8, KoColor::opacityU8(), KoColorSpace::opacityU8(), KoColorSpace::pixelSize(), KisBaseAccessor::rawData(), and KoColorSpace::setOpacity().
composite single pixel to dab
Definition at line 387 of file hairy_brush.cpp.
References KoCompositeOp::composite(), KoColor::data(), m_compositeOp, m_dabAccessor, m_pixelSize, KisRandomConstAccessorNG::moveTo(), OPACITY_OPAQUE_F, and KisBaseAccessor::rawData().
|
private |
|
private |
simulate running out of saturation
Definition at line 249 of file hairy_brush.cpp.
References KisHairyProperties::bristleInkAmountWeight, KisHairyProperties::bristleLengthWeight, KoColor::data(), Bristle::inkAmount(), KisHairyProperties::inkDepletionWeight, Bristle::length(), m_properties, m_saturationId, m_transfo, KoColorTransformation::parameterId(), KisHairyProperties::pressureWeight, KoColorTransformation::setParameter(), KoColorTransformation::transform(), and KisHairyProperties::useWeights.
set ink color for the whole bristle shape
Definition at line 65 of file hairy_brush.h.
References m_color.
|
inline |
set parameters for the brush engine
Definition at line 69 of file hairy_brush.h.
References m_properties.
Definition at line 105 of file hairy_brush.h.
|
private |
Definition at line 121 of file hairy_brush.h.
|
private |
Definition at line 114 of file hairy_brush.h.
|
private |
Definition at line 117 of file hairy_brush.h.
|
private |
Definition at line 112 of file hairy_brush.h.
|
private |
Definition at line 113 of file hairy_brush.h.
|
private |
Definition at line 119 of file hairy_brush.h.
|
private |
Definition at line 120 of file hairy_brush.h.
|
private |
Definition at line 110 of file hairy_brush.h.
|
private |
Definition at line 115 of file hairy_brush.h.
|
private |
Definition at line 103 of file hairy_brush.h.
|
private |
Definition at line 123 of file hairy_brush.h.
|
private |
Definition at line 109 of file hairy_brush.h.
|
private |
Definition at line 124 of file hairy_brush.h.
|
private |
Definition at line 106 of file hairy_brush.h.