Beispiel #1
0
/**
 * @param size brush size
 */
void BrushPreview::setSize(int size)
{
	m_brush.setSize(size);
	if(_sizepressure==false)
		m_brush.setSize2(size);
	notifyBrushChange();
}
Beispiel #2
0
void BrushPreview::setHardnessPressure(bool enable)
{
	_hardnesspressure = enable;
	if(!m_hardedge)
		m_brush.setHardness2(enable ? 0 : m_brush.hardness1());
	notifyBrushChange();
}
Beispiel #3
0
/**
 * @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();
}
Beispiel #4
0
/**
 * @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();
}
Beispiel #5
0
void BrushPreview::setSmudgePressure(bool enable)
{
	_smudgepressure = enable;
	if(enable)
		m_brush.setSmudge2(0);
	else
		m_brush.setSmudge2(m_brush.smudge1());
	notifyBrushChange();
}
Beispiel #6
0
/**
 * @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();
}
Beispiel #7
0
void BrushPreview::setOpacityPressure(bool enable)
{
	_opacitypressure = enable;
	if(enable)
		m_brush.setOpacity2(0);
	else
		m_brush.setOpacity2(m_brush.opacity1());
	notifyBrushChange();
}
Beispiel #8
0
void BrushPreview::setSizePressure(bool enable)
{
	_sizepressure = enable;
	if(enable)
		m_brush.setSize2(1);
	else
		m_brush.setSize2(m_brush.size1());
	notifyBrushChange();
}
Beispiel #9
0
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();
}
Beispiel #10
0
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();
}
Beispiel #11
0
void BrushPreview::setIncremental(bool incremental)
{
	m_brush.setIncremental(incremental);
	notifyBrushChange();
}
Beispiel #12
0
/**
 * @param brush brush to set
 */
void BrushPreview::setBrush(const paintcore::Brush& brush)
{
	m_brush = brush;
	notifyBrushChange();
}
Beispiel #13
0
/**
 * @param spacing dab spacing
 * @pre 0 <= spacing <= 100
 */
void BrushPreview::setSpacing(int spacing)
{
	m_brush.setSpacing(spacing);
	notifyBrushChange();
}
Beispiel #14
0
void BrushPreview::setBlendingMode(paintcore::BlendMode::Mode mode)
{
	m_brush.setBlendingMode(mode);
	notifyBrushChange();
}
Beispiel #15
0
void BrushPreview::setSubpixel(bool enable)
{
	m_brush.setSubpixel(enable);
	notifyBrushChange();
}
Beispiel #16
0
void BrushPreview::setSmudgeFrequency(int f)
{
	m_brush.setResmudge(f);
	notifyBrushChange();
}
Beispiel #17
0
/**
 * @param brush brush to set
 */
void BrushPreview::setBrush(const brushes::ClassicBrush& brush)
{
	m_brush = brush;
	notifyBrushChange();
}