7#include <QtGui/QPixmap>
17 m_rectPath = vgCreatePath(VG_PATH_FORMAT_STANDARD, VG_PATH_DATATYPE_F, 1, 0, 0, 0,
18 VG_PATH_CAPABILITY_APPEND_TO);
19 m_rectPaint = vgCreatePaint();
24 vgDestroyPaint(m_rectPaint);
25 vgDestroyPath(m_rectPath);
67 vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
71 vgSeti(VG_MATRIX_MODE, VG_MATRIX_PATH_USER_TO_SURFACE);
76 vgClearPath(m_rectPath, VG_PATH_CAPABILITY_APPEND_TO);
80 static const VGubyte rectCommands[] = {
90 coordinates[0] = m_rect.
x();
91 coordinates[1] = m_rect.
y();
92 coordinates[2] = m_rect.
width();
93 coordinates[3] = m_rect.
height();
94 coordinates[4] = -m_rect.
width();
96 vgAppendPathData(m_rectPath, 5, rectCommands, coordinates.
constData());
100 static const VGubyte rectCommands[] = {
113 coordinates[0] = bottomLeft.
x();
114 coordinates[1] = bottomLeft.
y();
115 coordinates[2] = bottomRight.
x();
116 coordinates[3] = bottomRight.
y();
117 coordinates[4] = topRight.
x();
118 coordinates[5] = topRight.
y();
119 coordinates[6] = topLeft.
x();
120 coordinates[7] = topLeft.
y();
122 vgAppendPathData(m_rectPath, 5, rectCommands, coordinates.
constData());
129 vgSetPaint(m_rectPaint, VG_FILL_PATH);
130 vgSetParameteri(m_rectPaint, VG_PAINT_TYPE, VG_PAINT_TYPE_COLOR);
133 m_paintDirty =
false;
136 vgSetPaint(m_rectPaint, VG_FILL_PATH);
137 vgDrawPath(m_rectPath, VG_FILL_PATH);
220 if (m_transformMode == transformNode)
222 m_transformMode = transformNode;
228 return m_transformMode;
251 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
253 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
257 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
264 float translateX = 0.0f;
265 float translateY = 0.0f;
270 translateX = m_rect.
width();
275 translateY = m_rect.
height();
279 vgTranslate(translateX, translateY);
280 vgScale(scaleX, scaleY);
284 if (m_sourceRect == m_rect) {
288 float scaleX = m_rect.
width() / m_sourceRect.
width();
290 vgScale(scaleX, scaleY);
291 VGImage subImage = vgChildImage(
image, m_sourceRect.
x(), m_sourceRect.
y(), m_sourceRect.
width(), m_sourceRect.
height());
292 vgDrawImage(subImage);
293 vgDestroyImage(subImage);
328 if (m_pixelRatio == ratio)
330 m_pixelRatio = ratio;
337 if (m_margins == margins)
357 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_MULTIPLY);
359 vgSeti(VG_IMAGE_MODE, VG_DRAW_IMAGE_NORMAL);
363 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
The QColor class provides colors based on RGB, HSV or CMYK values.
const_pointer constData() const noexcept
QPointF map(const QPointF &point) const
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QRectF marginsRemoved(const QMarginsF &margins) const noexcept
constexpr QPointF bottomLeft() const noexcept
Returns the position of the rectangle's bottom-left corner.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QPointF bottomRight() const noexcept
Returns the position of the rectangle's bottom-right corner.
constexpr QPointF topRight() const noexcept
Returns the position of the rectangle's top-right corner.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
The QSGMaterial class encapsulates rendering state for a shader program.
void markDirty(DirtyState bits)
Notifies all connected renderers that the node has dirty bits.
void setOwnsTexture(bool owns) override
Sets whether the node takes ownership of the texture to owns.
void setTexture(QSGTexture *texture) override
Sets the texture of this image node to texture.
QSGTexture::AnisotropyLevel anisotropyLevel() const override
Returns this image node's anistropy level.
bool ownsTexture() const override
void setAnisotropyLevel(QSGTexture::AnisotropyLevel level) override
Sets this image node's anistropy level to level.
void setFiltering(QSGTexture::Filtering filtering) override
Sets the filtering to be used for this image node to filtering.
void setRect(const QRectF &rect) override
Sets the target rect of this image node to rect.
TextureCoordinatesTransformMode textureCoordinatesTransform() const override
Returns the mode used to generate texture coordinates for this node.
void setMipmapFiltering(QSGTexture::Filtering) override
Sets the mipmap filtering to be used for this image node to filtering.
QSGTexture::Filtering mipmapFiltering() const override
Returns the mipmap filtering for this image node.
QSGTexture::Filtering filtering() const override
Returns the filtering for this image node.
QRectF rect() const override
Returns the target rect of this image node.
QSGTexture * texture() const override
Returns the texture for this image node.
void setSourceRect(const QRectF &r) override
Sets the source rect of this image node to rect.
QRectF sourceRect() const override
Returns the source rect of this image node.
void setTextureCoordinatesTransform(TextureCoordinatesTransformMode transformNode) override
Sets the method used to generate texture coordinates to mode.
void setTexture(QSGTexture *texture) override
void setBounds(const QRectF &bounds) override
void setDevicePixelRatio(qreal ratio) override
void setPadding(qreal left, qreal top, qreal right, qreal bottom) override
~QSGOpenVGNinePatchNode()
QRectF rect() const override
Returns the rectangle that this rect node covers.
~QSGOpenVGRectangleNode()
QColor color() const override
Returns the color of this rectangle.
void setRect(const QRectF &rect) override
Sets the rectangle of this rect node to rect.
void setTransform(const QOpenVGMatrix &transform) override
void setColor(const QColor &color) override
Sets the color of this rectangle to color.
VGPaint opacityPaint() const
const QOpenVGMatrix & transform() const
virtual void setTransform(const QOpenVGMatrix &transform)
virtual QSize textureSize() const =0
Returns the size of the texture in pixels.
Filtering
Specifies how sampling of texels should filter when texture coordinates are not pixel aligned.
AnisotropyLevel
Specifies the anisotropic filtering level to be used when the texture is not screen aligned.
virtual qint64 comparisonKey() const =0
Returns a key suitable for comparing textures.
void qDrawBorderImage(VGImage image, const QSizeF &textureSize, const QRectF &targetRect, const QRectF &innerTargetRect, const QRectF &subSourceRect)
const QVector< VGfloat > qColorToVGColor(const QColor &color, float opacity)
Combined button and popup list for selecting options.
GLdouble GLdouble GLdouble GLdouble top
GLuint GLenum GLenum transform