/** * @param size brush size */ void BrushPreview::setSize(int size) { m_brush.setSize(size); if(_sizepressure==false) m_brush.setSize2(size); notifyBrushChange(); }
void BrushPreview::setHardnessPressure(bool enable) { _hardnesspressure = enable; if(!m_hardedge) m_brush.setHardness2(enable ? 0 : m_brush.hardness1()); notifyBrushChange(); }
/** * @param smudge color smudge pressure * @pre 0 <= smudge <= 100 */ void BrushPreview::setSmudge(int smudge) { const qreal s = smudge / 100.0; m_brush.setSmudge(s); if(_smudgepressure==false) m_brush.setSmudge2(s); notifyBrushChange(); }
/** * @param opacity brush opacity * @pre 0 <= opacity <= 100 */ void BrushPreview::setOpacity(int opacity) { const qreal o = opacity/100.0; m_brush.setOpacity(o); if(_opacitypressure==false) m_brush.setOpacity2(o); notifyBrushChange(); }
void BrushPreview::setSmudgePressure(bool enable) { _smudgepressure = enable; if(enable) m_brush.setSmudge2(0); else m_brush.setSmudge2(m_brush.smudge1()); notifyBrushChange(); }
/** * @param hardness brush hardness * @pre 0 <= hardness <= 100 */ void BrushPreview::setHardness(int hardness) { m_hardness = hardness/100.0; if(!m_hardedge) { m_brush.setHardness(m_hardness); m_brush.setHardness2(_hardnesspressure ? 0 : m_hardness); } notifyBrushChange(); }
void BrushPreview::setOpacityPressure(bool enable) { _opacitypressure = enable; if(enable) m_brush.setOpacity2(0); else m_brush.setOpacity2(m_brush.opacity1()); notifyBrushChange(); }
void BrushPreview::setSizePressure(bool enable) { _sizepressure = enable; if(enable) m_brush.setSize2(1); else m_brush.setSize2(m_brush.size1()); notifyBrushChange(); }
void BrushPreview::setHardEdge(bool hard) { m_hardedge = hard; if(hard) { m_brush.setHardness(1); m_brush.setHardness2(1); m_brush.setSubpixel(false); } else { m_brush.setHardness(m_hardness); m_brush.setHardness2(_hardnesspressure ? 0 : m_hardness); m_brush.setSubpixel(true); } notifyBrushChange(); }
void BrushPreview::setColor(const QColor& color) { m_color = color; m_brush.setColor(color); // Decide background color const qreal lum = color.redF() * 0.216 + color.greenF() * 0.7152 + color.redF() * 0.0722; if(lum < 0.8) { m_bg = Qt::white; } else { m_bg = QColor(32, 32, 32); } notifyBrushChange(); }
void BrushPreview::setIncremental(bool incremental) { m_brush.setIncremental(incremental); notifyBrushChange(); }
/** * @param brush brush to set */ void BrushPreview::setBrush(const paintcore::Brush& brush) { m_brush = brush; notifyBrushChange(); }
/** * @param spacing dab spacing * @pre 0 <= spacing <= 100 */ void BrushPreview::setSpacing(int spacing) { m_brush.setSpacing(spacing); notifyBrushChange(); }
void BrushPreview::setBlendingMode(paintcore::BlendMode::Mode mode) { m_brush.setBlendingMode(mode); notifyBrushChange(); }
void BrushPreview::setSubpixel(bool enable) { m_brush.setSubpixel(enable); notifyBrushChange(); }
void BrushPreview::setSmudgeFrequency(int f) { m_brush.setResmudge(f); notifyBrushChange(); }
/** * @param brush brush to set */ void BrushPreview::setBrush(const brushes::ClassicBrush& brush) { m_brush = brush; notifyBrushChange(); }