mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-24 14:42:53 +02:00
* Added TomahawkUtils::tinted(QPixmap, QColor).
This commit is contained in:
@@ -947,6 +947,21 @@ squareCenterPixmap( const QPixmap& sourceImage )
|
||||
}
|
||||
|
||||
|
||||
QPixmap
|
||||
tinted( const QPixmap& p, const QColor& tint )
|
||||
{
|
||||
QImage resultImage( p.size(), QImage::Format_ARGB32_Premultiplied );
|
||||
QPainter painter( &resultImage );
|
||||
painter.drawPixmap( 0, 0, p );
|
||||
painter.setCompositionMode( QPainter::CompositionMode_Screen );
|
||||
painter.fillRect( resultImage.rect(), tint );
|
||||
painter.end();
|
||||
|
||||
resultImage.setAlphaChannel( p.toImage().alphaChannel() );
|
||||
return QPixmap::fromImage( resultImage );
|
||||
}
|
||||
|
||||
|
||||
QImage
|
||||
blurred( const QImage& image, const QRect& rect, int radius, bool alphaOnly, bool blackWhite )
|
||||
{
|
||||
|
@@ -76,6 +76,7 @@ namespace TomahawkUtils
|
||||
DLLEXPORT QPixmap addDropShadow( const QPixmap& sourceImage, const QSize& targetSize );
|
||||
DLLEXPORT QPixmap squareCenterPixmap( const QPixmap& sourceImage );
|
||||
|
||||
DLLEXPORT QPixmap tinted( const QPixmap& pixmap, const QColor& tint );
|
||||
DLLEXPORT QImage blurred( const QImage& image, const QRect& rect, int radius, bool alphaOnly = false, bool blackWhite = false );
|
||||
|
||||
DLLEXPORT void drawCompositedPopup( QWidget* widget, const QPainterPath& outline, const QColor& lineColor, const QBrush& backgroundBrush, qreal opacity );
|
||||
|
Reference in New Issue
Block a user