Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qpixmapfilter.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include <qglobal.h>
5
6#include <QDebug>
7
8#include "qpainter.h"
9#include "qpixmap.h"
10#include "qpixmapfilter_p.h"
11#include "qvarlengtharray.h"
12
13#include "private/qguiapplication_p.h"
14#include "private/qpaintengineex_p.h"
15#include "private/qpaintengine_raster_p.h"
16#include "qmath.h"
17#include "private/qmath_p.h"
18#include "private/qdrawhelper_p.h"
19
20#include <memory>
21
23
25{
26 Q_DECLARE_PUBLIC(QPixmapFilter)
27public:
29};
30
80 : QObject(*new QPixmapFilterPrivate, parent)
81{
82 d_func()->type = type;
83}
84
85
86
95
96
105
113{
114 Q_D(const QPixmapFilter);
115 return d->type;
116}
117
125{
126 return rect;
127}
128
184
185
194 : QPixmapFilter(*new QPixmapConvolutionFilterPrivate, ConvolutionFilter, parent)
195{
197 d->convoluteAlpha = true;
198}
199
208
221{
223 delete [] d->convolutionKernel;
224 d->convolutionKernel = new qreal[rows * columns];
225 memcpy(d->convolutionKernel, kernel, sizeof(qreal) * rows * columns);
226 d->kernelWidth = columns;
227 d->kernelHeight = rows;
228}
229
235const qreal *QPixmapConvolutionFilter::convolutionKernel() const
236{
237 Q_D(const QPixmapConvolutionFilter);
238 return d->convolutionKernel;
239}
240
246int QPixmapConvolutionFilter::rows() const
247{
248 Q_D(const QPixmapConvolutionFilter);
249 return d->kernelHeight;
250}
251
257int QPixmapConvolutionFilter::columns() const
258{
259 Q_D(const QPixmapConvolutionFilter);
260 return d->kernelWidth;
261}
262
263
268{
269 Q_D(const QPixmapConvolutionFilter);
270 return rect.adjusted(-d->kernelWidth / 2, -d->kernelHeight / 2, (d->kernelWidth - 1) / 2, (d->kernelHeight - 1) / 2);
271}
272
273// Convolutes the image
274static void convolute(
275 QImage *destImage,
276 const QPointF &pos,
277 const QImage &srcImage,
278 const QRectF &srcRect,
280 qreal *kernel,
281 int kernelWidth,
282 int kernelHeight )
283{
284 const QImage processImage = (srcImage.format() != QImage::Format_ARGB32_Premultiplied ) ? srcImage.convertToFormat(QImage::Format_ARGB32_Premultiplied) : srcImage;
285 // TODO: support also other formats directly without copying
286
287 std::unique_ptr<int[]> fixedKernel(new int[kernelWidth * kernelHeight]);
288 for(int i = 0; i < kernelWidth*kernelHeight; i++)
289 {
290 fixedKernel[i] = (int)(65536 * kernel[i]);
291 }
292 QRectF trect = srcRect.isNull() ? processImage.rect() : srcRect;
293 trect.moveTo(pos);
294 QRectF bounded = trect.adjusted(-kernelWidth / 2, -kernelHeight / 2, (kernelWidth - 1) / 2, (kernelHeight - 1) / 2);
295 QRect rect = bounded.toAlignedRect();
296 QRect targetRect = rect.intersected(destImage->rect());
297
298 QRectF srect = srcRect.isNull() ? processImage.rect() : srcRect;
299 QRectF sbounded = srect.adjusted(-kernelWidth / 2, -kernelHeight / 2, (kernelWidth - 1) / 2, (kernelHeight - 1) / 2);
300 QPoint srcStartPoint = sbounded.toAlignedRect().topLeft()+(targetRect.topLeft()-rect.topLeft());
301
302 const uint *sourceStart = (const uint*)processImage.scanLine(0);
303 uint *outputStart = (uint*)destImage->scanLine(0);
304
305 int yk = srcStartPoint.y();
306 for (int y = targetRect.top(); y <= targetRect.bottom(); y++) {
307 uint* output = outputStart + (destImage->bytesPerLine()/sizeof(uint))*y+targetRect.left();
308 int xk = srcStartPoint.x();
309 for(int x = targetRect.left(); x <= targetRect.right(); x++) {
310 int r = 0;
311 int g = 0;
312 int b = 0;
313 int a = 0;
314
315 // some out of bounds pre-checking to avoid inner-loop ifs
316 int kernely = -kernelHeight/2;
317 int starty = 0;
318 int endy = kernelHeight;
319 if (yk+kernely+endy >= srcImage.height())
320 endy = kernelHeight-((yk+kernely+endy)-srcImage.height())-1;
321 if (yk+kernely < 0)
322 starty = -(yk+kernely);
323
324 int kernelx = -kernelWidth/2;
325 int startx = 0;
326 int endx = kernelWidth;
327 if (xk+kernelx+endx >= srcImage.width())
328 endx = kernelWidth-((xk+kernelx+endx)-srcImage.width())-1;
329 if (xk+kernelx < 0)
330 startx = -(xk+kernelx);
331
332 for (int ys = starty; ys < endy; ys ++) {
333 const uint *pix = sourceStart + (processImage.bytesPerLine()/sizeof(uint))*(yk+kernely+ys) + ((xk+kernelx+startx));
334 const uint *endPix = pix+endx-startx;
335 int kernelPos = ys*kernelWidth+startx;
336 while (pix < endPix) {
337 int factor = fixedKernel[kernelPos++];
338 a += (((*pix) & 0xff000000)>>24) * factor;
339 r += (((*pix) & 0x00ff0000)>>16) * factor;
340 g += (((*pix) & 0x0000ff00)>>8 ) * factor;
341 b += (((*pix) & 0x000000ff) ) * factor;
342 pix++;
343 }
344 }
345
346 r = qBound((int)0, r >> 16, (int)255);
347 g = qBound((int)0, g >> 16, (int)255);
348 b = qBound((int)0, b >> 16, (int)255);
349 a = qBound((int)0, a >> 16, (int)255);
350 // composition mode checking could be moved outside of loop
352 uint color = (a<<24)+(r<<16)+(g<<8)+b;
353 *output++ = color;
354 } else {
355 uint current = *output;
356 uchar ca = (current&0xff000000)>>24;
357 uchar cr = (current&0x00ff0000)>>16;
358 uchar cg = (current&0x0000ff00)>>8;
359 uchar cb = (current&0x000000ff);
360 uint color =
361 (((ca*(255-a) >> 8)+a) << 24)+
362 (((cr*(255-a) >> 8)+r) << 16)+
363 (((cg*(255-a) >> 8)+g) << 8)+
364 (((cb*(255-a) >> 8)+b));
365 *output++ = color;
366 }
367 xk++;
368 }
369 yk++;
370 }
371}
372
376void QPixmapConvolutionFilter::draw(QPainter *painter, const QPointF &p, const QPixmap &src, const QRectF& srcRect) const
377{
378 Q_D(const QPixmapConvolutionFilter);
379 if (!painter->isActive())
380 return;
381
382 if (d->kernelWidth<=0 || d->kernelHeight <= 0)
383 return;
384
385 if (src.isNull())
386 return;
387
388 // raster implementation
389
390 QImage *target = nullptr;
392 target = static_cast<QImage *>(painter->paintEngine()->paintDevice());
393
395
396 if (mat.type() > QTransform::TxTranslate) {
397 // Disabled because of transformation...
398 target = nullptr;
399 } else {
401 if (pe->clipType() == QRasterPaintEngine::ComplexClip)
402 // disabled because of complex clipping...
403 target = nullptr;
404 else {
405 QRectF clip = pe->clipBoundingRect();
406 QRectF rect = boundingRectFor(srcRect.isEmpty() ? src.rect() : srcRect);
408 if (!clip.contains(rect.translated(x.dx() + p.x(), x.dy() + p.y()))) {
409 target = nullptr;
410 }
411
412 }
413 }
414 }
415
416 if (target) {
418 QPointF offset(x.dx(), x.dy());
419
420 convolute(target, p+offset, src.toImage(), srcRect, QPainter::CompositionMode_SourceOver, d->convolutionKernel, d->kernelWidth, d->kernelHeight);
421 } else {
422 QRect srect = srcRect.isNull() ? src.rect() : srcRect.toRect();
423 QRect rect = boundingRectFor(srect).toRect();
425 QPoint offset = srect.topLeft() - rect.topLeft();
427 offset,
428 src.toImage(),
429 srect,
431 d->convolutionKernel,
432 d->kernelWidth,
433 d->kernelHeight);
435 }
436}
437
463{
464public:
466
468 QGraphicsBlurEffect::BlurHints hints;
469};
470
471
481
490
497{
499 d->radius = radius;
500}
501
508{
509 Q_D(const QPixmapBlurFilter);
510 return d->radius;
511}
512
528void QPixmapBlurFilter::setBlurHints(QGraphicsBlurEffect::BlurHints hints)
529{
531 d->hints = hints;
532}
533
539QGraphicsBlurEffect::BlurHints QPixmapBlurFilter::blurHints() const
540{
541 Q_D(const QPixmapBlurFilter);
542 return d->hints;
543}
544
546
551{
552 Q_D(const QPixmapBlurFilter);
553 const qreal delta = radiusScale * d->radius + 1;
554 return rect.adjusted(-delta, -delta, delta, delta);
555}
556
557Q_GUI_EXPORT extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale);
558
559Q_GUI_EXPORT extern void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed = 0);
560
565{
566 Q_D(const QPixmapBlurFilter);
567 if (!painter->isActive())
568 return;
569
570 if (src.isNull())
571 return;
572
573 QRectF srcRect = rect;
574 if (srcRect.isNull())
575 srcRect = src.rect();
576
577 if (d->radius <= 1) {
578 painter->drawPixmap(srcRect.translated(p), src, srcRect);
579 return;
580 }
581
582 qreal scaledRadius = radiusScale * d->radius;
583 qreal scale;
585 scaledRadius /= scale;
586
587 QImage srcImage;
588
589 if (srcRect == src.rect()) {
590 srcImage = src.toImage();
591 } else {
592 QRect rect = srcRect.toAlignedRect().intersected(src.rect());
593 srcImage = src.copy(rect).toImage();
594 }
595
598 qt_blurImage(painter, srcImage, scaledRadius, (d->hints & QGraphicsBlurEffect::QualityHint), false);
600}
601
602// grayscales the image to dest (could be same). If rect isn't defined
603// destination image size is used to determine the dimension of grayscaling
604// process.
605static void grayscale(const QImage &image, QImage &dest, const QRect& rect = QRect())
606{
607 QRect destRect = rect;
608 QRect srcRect = rect;
609 if (rect.isNull()) {
610 srcRect = dest.rect();
611 destRect = dest.rect();
612 }
613 if (&image != &dest) {
614 destRect.moveTo(QPoint(0, 0));
615 }
616
617 const unsigned int *data = (const unsigned int *)image.bits();
618 unsigned int *outData = (unsigned int *)dest.bits();
619
620 if (dest.size() == image.size() && image.rect() == srcRect) {
621 // a bit faster loop for grayscaling everything
622 int pixels = dest.width() * dest.height();
623 for (int i = 0; i < pixels; ++i) {
624 int val = qGray(data[i]);
625 outData[i] = qRgba(val, val, val, qAlpha(data[i]));
626 }
627 } else {
628 int yd = destRect.top();
629 for (int y = srcRect.top(); y <= srcRect.bottom() && y < image.height(); y++) {
630 data = (const unsigned int*)image.scanLine(y);
631 outData = (unsigned int*)dest.scanLine(yd++);
632 int xd = destRect.left();
633 for (int x = srcRect.left(); x <= srcRect.right() && x < image.width(); x++) {
634 int val = qGray(data[x]);
635 outData[xd++] = qRgba(val, val, val, qAlpha(data[x]));
636 }
637 }
638 }
639}
640
671
680 : QPixmapFilter(*new QPixmapColorizeFilterPrivate, ColorizeFilter, parent)
681{
683 d->color = QColor(0, 0, 192);
684 d->strength = qreal(1);
685 d->opaque = true;
686 d->alphaBlend = false;
687}
688
695
702{
703 Q_D(const QPixmapColorizeFilter);
704 return d->color;
705}
706
713{
715 d->color = color;
716}
717
725{
726 Q_D(const QPixmapColorizeFilter);
727 return d->strength;
728}
729
736{
738 d->strength = qBound(qreal(0), strength, qreal(1));
739 d->opaque = !qFuzzyIsNull(d->strength);
740 d->alphaBlend = !qFuzzyIsNull(d->strength - 1);
741}
742
746void QPixmapColorizeFilter::draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect) const
747{
748 Q_D(const QPixmapColorizeFilter);
749
750 if (src.isNull())
751 return;
752
753 // raster implementation
754
755 if (!d->opaque) {
756 painter->drawPixmap(dest, src, srcRect);
757 return;
758 }
759
760 QImage srcImage;
761 QImage destImage;
762
763 if (srcRect.isNull()) {
764 srcImage = src.toImage();
766 srcImage = std::move(srcImage).convertToFormat(format);
767 destImage = QImage(srcImage.size(), srcImage.format());
768 } else {
769 QRect rect = srcRect.toAlignedRect().intersected(src.rect());
770
771 srcImage = src.copy(rect).toImage();
772 const auto format = srcImage.hasAlphaChannel() ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32;
773 srcImage = std::move(srcImage).convertToFormat(format);
774 destImage = QImage(rect.size(), srcImage.format());
775 }
776 destImage.setDevicePixelRatio(src.devicePixelRatio());
777
778 // do colorizing
779 QPainter destPainter(&destImage);
780 grayscale(srcImage, destImage, srcImage.rect());
781 destPainter.setCompositionMode(QPainter::CompositionMode_Screen);
782 destPainter.fillRect(srcImage.rect(), d->color);
783 destPainter.end();
784
785 if (d->alphaBlend) {
786 // alpha blending srcImage and destImage
787 QImage buffer = srcImage;
788 QPainter bufPainter(&buffer);
789 bufPainter.setOpacity(d->strength);
790 bufPainter.drawImage(0, 0, destImage);
791 bufPainter.end();
792 destImage = std::move(buffer);
793 }
794
795 if (srcImage.hasAlphaChannel()) {
796 Q_ASSERT(destImage.format() == QImage::Format_ARGB32_Premultiplied);
797 QPainter maskPainter(&destImage);
798 maskPainter.setCompositionMode(QPainter::CompositionMode_DestinationIn);
799 maskPainter.drawImage(0, 0, srcImage);
800 }
801
802 painter->drawImage(dest, destImage);
803}
804
815
858
867
878{
879 Q_D(const QPixmapDropShadowFilter);
880 return d->radius;
881}
882
893{
895 d->radius = radius;
896}
897
906{
907 Q_D(const QPixmapDropShadowFilter);
908 return d->color;
909}
910
919{
921 d->color = color;
922}
923
932{
933 Q_D(const QPixmapDropShadowFilter);
934 return d->offset;
935}
936
945{
947 d->offset = offset;
948}
949
966{
967 Q_D(const QPixmapDropShadowFilter);
968 return rect.united(rect.translated(d->offset).adjusted(-d->radius, -d->radius, d->radius, d->radius));
969}
970
975 const QPointF &pos,
976 const QPixmap &px,
977 const QRectF &src) const
978{
979 Q_D(const QPixmapDropShadowFilter);
980
981 if (px.isNull())
982 return;
983
985 tmp.setDevicePixelRatio(px.devicePixelRatio());
986 tmp.fill(0);
987 QPainter tmpPainter(&tmp);
988 tmpPainter.setCompositionMode(QPainter::CompositionMode_Source);
989 tmpPainter.drawPixmap(d->offset, px);
990 tmpPainter.end();
991
992 // blur the alpha channel
994 blurred.setDevicePixelRatio(px.devicePixelRatio());
995 blurred.fill(0);
996 QPainter blurPainter(&blurred);
997 qt_blurImage(&blurPainter, tmp, d->radius, false, true);
998 blurPainter.end();
999
1000 tmp = std::move(blurred);
1001
1002 // blacken the image...
1003 tmpPainter.begin(&tmp);
1004 tmpPainter.setCompositionMode(QPainter::CompositionMode_SourceIn);
1005 tmpPainter.fillRect(tmp.rect(), d->color);
1006 tmpPainter.end();
1007
1008 // draw the blurred drop shadow...
1009 p->drawImage(pos, tmp);
1010
1011 // Draw the actual pixmap...
1012 p->drawPixmap(pos, px, src);
1013}
1014
1016
1017#include "moc_qpixmapfilter_p.cpp"
The QColor class provides colors based on RGB, HSV or CMYK values.
Definition qcolor.h:31
The QGraphicsBlurEffect class provides a blur effect.
\inmodule QtGui
Definition qimage.h:37
bool hasAlphaChannel() const
Returns true if the image has a format that respects the alpha channel, otherwise returns false.
Definition qimage.cpp:4589
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition qimage.cpp:1637
QSize size() const
Returns the size of the image, i.e.
int width() const
Returns the width of the image.
uchar * bits()
Returns a pointer to the first pixel data.
Definition qimage.cpp:1698
int height() const
Returns the height of the image.
@ Format_RGB32
Definition qimage.h:46
@ Format_ARGB32_Premultiplied
Definition qimage.h:48
void fill(uint pixel)
Fills the entire image with the given pixelValue.
Definition qimage.cpp:1758
QRect rect() const
Returns the enclosing rectangle (0, 0, width(), height()) of the image.
void setDevicePixelRatio(qreal scaleFactor)
Sets the device pixel ratio for the image.
Definition qimage.cpp:1510
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const &
Definition qimage.h:125
\inmodule QtCore
Definition qobject.h:103
virtual int devType() const
QPaintDevice * paintDevice() const
Returns the device that this engine is painting on, if painting is active; otherwise returns \nullptr...
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
QPaintEngine * paintEngine() const
Returns the paint engine that the painter is currently operating on if the painter is active; otherwi...
QTransform combinedTransform() const
Returns the transformation matrix combining the current window/viewport and world transformation.
const QTransform & worldTransform() const
Returns the world transformation matrix.
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
void drawImage(const QRectF &targetRect, const QImage &image, const QRectF &sourceRect, Qt::ImageConversionFlags flags=Qt::AutoColor)
Draws the rectangular portion source of the given image into the target rectangle in the paint device...
const QTransform & deviceTransform() const
Returns the matrix that transforms from logical coordinates to device coordinates of the platform dep...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
const QTransform & transform() const
Alias for worldTransform().
CompositionMode
Defines the modes supported for digital image compositing.
Definition qpainter.h:97
@ CompositionMode_SourceOver
Definition qpainter.h:98
@ CompositionMode_Source
Definition qpainter.h:101
@ CompositionMode_DestinationIn
Definition qpainter.h:104
@ CompositionMode_Screen
Definition qpainter.h:114
@ CompositionMode_SourceIn
Definition qpainter.h:103
bool isActive() const
Returns true if begin() has been called and end() has not yet been called; otherwise returns false.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
QGraphicsBlurEffect::BlurHints hints
The QPixmapBlurFilter class provides blur filtering for pixmaps.
void setBlurHints(QGraphicsBlurEffect::BlurHints hints)
Setting the blur hints to PerformanceHint causes the implementation to trade off visual quality to bl...
QPixmapBlurFilter(QObject *parent=nullptr)
Constructs a pixmap blur filter.
void setRadius(qreal radius)
Sets the radius of the blur filter.
QGraphicsBlurEffect::BlurHints blurHints() const
Gets the blur hints of the blur filter.
QRectF boundingRectFor(const QRectF &rect) const override
qreal radius() const
Gets the radius of the blur filter.
~QPixmapBlurFilter()
Destructor of pixmap blur filter.
void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect=QRectF()) const override
The QPixmapColorizeFilter class provides colorizing filtering for pixmaps.
QColor color() const
Gets the color of the colorize filter.
qreal strength() const
Gets the strength of the colorize filter, 1.0 means full colorized while 0.0 equals to no filtering a...
void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect=QRectF()) const override
QPixmapColorizeFilter(QObject *parent=nullptr)
Constructs an pixmap colorize filter.
void setStrength(qreal strength)
Sets the strength of the colorize filter to strength.
void setColor(const QColor &color)
Sets the color of the colorize filter to the color specified.
The QPixmapConvolutionFilter class provides convolution filtering for pixmaps.
void draw(QPainter *painter, const QPointF &dest, const QPixmap &src, const QRectF &srcRect=QRectF()) const override
QPixmapConvolutionFilter(QObject *parent=nullptr)
Constructs a pixmap convolution filter.
void setConvolutionKernel(const qreal *matrix, int rows, int columns)
Sets convolution kernel with the given number of rows and columns.
~QPixmapConvolutionFilter()
Destructor of pixmap convolution filter.
QRectF boundingRectFor(const QRectF &rect) const override
The QPixmapDropShadowFilter class is a convenience class for drawing pixmaps with drop shadows.
void setOffset(const QPointF &offset)
Sets the shadow offset in pixels to the offset specified.
qreal blurRadius() const
Returns the radius in pixels of the blur on the drop shadow.
QPixmapDropShadowFilter(QObject *parent=nullptr)
Constructs drop shadow filter.
QColor color() const
Returns the color of the drop shadow.
QRectF boundingRectFor(const QRectF &rect) const override
void draw(QPainter *p, const QPointF &pos, const QPixmap &px, const QRectF &src=QRectF()) const override
void setColor(const QColor &color)
Sets the color of the drop shadow to the color specified.
QPointF offset() const
Returns the shadow offset in pixels.
~QPixmapDropShadowFilter()
Destroys drop shadow filter.
void setBlurRadius(qreal radius)
Sets the radius in pixels of the blur on the drop shadow to the radius specified.
QPixmapFilter::FilterType type
The QPixmapFilter class provides the basic functionality for pixmap filter classes....
virtual QRectF boundingRectFor(const QRectF &rect) const
Returns the bounding rectangle that is affected by the pixmap filter if the filter is applied to the ...
virtual ~QPixmapFilter()=0
Destroys the pixmap filter.
FilterType type() const
Returns the type of the filter.
QPixmapFilter(QPixmapFilterPrivate &d, FilterType type, QObject *parent)
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
Definition qpixmap.h:27
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:135
The QRasterPaintEngine class enables hardware acceleration of painting operations in Qt for Embedded ...
\inmodule QtCore\reentrant
Definition qrect.h:484
QRect toAlignedRect() const noexcept
Definition qrect.cpp:2338
bool contains(const QRectF &r) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qrect.cpp:1993
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition qrect.h:813
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
Definition qrect.h:658
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
Definition qrect.h:859
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr bool isNull() const noexcept
Returns true if the rectangle is a null rectangle, otherwise returns false.
Definition qrect.h:164
QRect intersected(const QRect &other) const noexcept
Definition qrect.h:415
constexpr void moveTo(int x, int t) noexcept
Moves the rectangle, leaving the top-left corner at the given position (x, y).
Definition qrect.h:270
The QTransform class specifies 2D transformations of a coordinate system.
Definition qtransform.h:20
rect
[4]
QPixmap pix
Combined button and popup list for selecting options.
Definition image.cpp:4
bool qFuzzyIsNull(qfloat16 f) noexcept
Definition qfloat16.h:349
Q_GUI_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed=0)
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition qminmax.h:44
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLenum mode
GLboolean GLboolean GLboolean GLboolean a
[7]
GLboolean r
[2]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum src
GLenum GLuint buffer
GLuint color
[2]
GLenum type
GLenum target
GLenum GLuint GLintptr offset
GLboolean GLboolean g
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const void * pixels
GLint GLsizei GLsizei GLenum format
GLint y
GLuint GLenum GLenum transform
GLuint GLfloat * val
GLuint64EXT * result
[6]
GLfloat GLfloat p
[1]
GLenum GLenum GLenum GLenum GLenum scale
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
Q_GUI_EXPORT void qt_blurImage(QPainter *p, QImage &blurImage, qreal radius, bool quality, bool alphaOnly, int transposed=0)
const qreal radiusScale
Q_GUI_EXPORT bool qt_scaleForTransform(const QTransform &transform, qreal *scale)
static void grayscale(const QImage &image, QImage &dest, const QRect &rect=QRect())
static void convolute(QImage *destImage, const QPointF &pos, const QImage &srcImage, const QRectF &srcRect, QPainter::CompositionMode mode, qreal *kernel, int kernelWidth, int kernelHeight)
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
constexpr int qGray(int r, int g, int b)
Definition qrgb.h:36
constexpr QRgb qRgba(int r, int g, int b, int a)
Definition qrgb.h:33
constexpr int qAlpha(QRgb rgb)
Definition qrgb.h:27
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
unsigned int quint32
Definition qtypes.h:50
unsigned char uchar
Definition qtypes.h:32
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QT_BEGIN_NAMESPACE typedef uchar * output
QObject::connect nullptr
QPainter painter(this)
[7]