本文整理汇总了C++中KisImageSP::pixelToDocument方法的典型用法代码示例。如果您正苦于以下问题:C++ KisImageSP::pixelToDocument方法的具体用法?C++ KisImageSP::pixelToDocument怎么用?C++ KisImageSP::pixelToDocument使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KisImageSP
的用法示例。
在下文中一共展示了KisImageSP::pixelToDocument方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: paintOutlineRect
QRectF KisDuplicateOpSettings::paintOutlineRect(const QPointF& pos, KisImageSP image) const
{
KisBrushSP brush = m_optionsWidget->m_brushOption->brush();
QPointF hotSpot = brush->hotSpot(1.0, 1.0);
QRectF rect = image->pixelToDocument(QRect(0,0, brush->width(), brush->height()) );
rect.translate( pos - hotSpot + QPoint(1,1) );
rect |= duplicateOutlineRect(pos, image);
return rect;
}
示例2: duplicateOutlineRect
QRectF KisDuplicateOpSettings::duplicateOutlineRect(const QPointF& pos, KisImageSP image) const
{
// Compute the rectangle for the offset
QRectF rect2 = QRectF( -5, -5, 10, 10);
if(m_isOffsetNotUptodate)
{
rect2.translate(m_position);
} else {
rect2.translate(- m_offset + image->documentToPixel( pos) );
}
return image->pixelToDocument(rect2);
}
示例3: paintOutline
void KisDuplicateOpSettings::paintOutline(const QPointF& pos, KisImageSP image, QPainter &painter, const KoViewConverter &converter) const
{
KisBrushSP brush = m_optionsWidget->m_brushOption->brush();
QPointF hotSpot = brush->hotSpot(1.0, 1.0);
painter.setPen(Qt::black);
painter.setBackground(Qt::black);
painter.drawEllipse( converter.documentToView( image->pixelToDocument(QRect(0,0, brush->width(), brush->height()) ).translated( pos - hotSpot + QPoint(1,1) ) ) );
QRectF rect2 = converter.documentToView( duplicateOutlineRect( pos, image ) );
painter.drawLine(rect2.topLeft(), rect2.bottomRight() );
painter.drawLine(rect2.topRight(), rect2.bottomLeft() );
}