Beispiel #1
0
/**
 * @param brush brush info to send
 */
void SessionState::sendToolSelect(const dpcore::Brush& brush)
{
    host_->sendPacket( protocol::ToolSelect(
                           host_->localuser_,
                           brush.subpixel()?SUBPIXEL:0,
                           brush.blendingMode(),
                           encodeColor(brush.color(1), brush.opacity(1)),
                           encodeColor(brush.color(0), brush.opacity(0)),
                           brush.radius(1),
                           brush.radius(0),
                           qRound(brush.hardness(1)*255),
                           qRound(brush.hardness(0)*255),
                           brush.spacing()
                       )
                     );

}
Beispiel #2
0
protocol::MessagePtr brushToToolChange(int userid, int layer, const dpcore::Brush &brush)
{
	uint8_t mode = brush.subpixel() ? protocol::TOOL_MODE_SUBPIXEL : 0;
	mode |= brush.incremental() ? protocol::TOOL_MODE_INCREMENTAL : 0;

	return protocol::MessagePtr(new protocol::ToolChange(
		userid,
		layer,
		brush.blendingMode(),
		mode,
		brush.spacing(),
		brush.color(1.0).rgba(),
		brush.color(0.0).rgba(),
		brush.hardness(1.0) * 255,
		brush.hardness(0.0) * 255,
		brush.radius(1.0),
		brush.radius(0.0),
		brush.opacity(1.0) * 255,
		brush.opacity(0.0) * 255
	));
}