15 VGPath vgpath = vgCreatePath(VG_PATH_FORMAT_STANDARD,
21 VG_PATH_CAPABILITY_ALL);
40 bool haveStart =
false;
45 switch (element.
type) {
49 if (haveStart && haveEnd && startx == endx && starty == endy) {
103 if (haveStart && haveEnd && startx == endx && starty == endy) {
108 vgAppendPathData(vgpath,
segments.count(),
120 if (targetRect.
width() <= 0 || targetRect.
height() <= 0)
128 qreal yPos = targetRect.
y();
138 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
140 vgGetMatrix(originalMatrix.
data());
143 yPos < targetRect.
y() + targetRect.
height()) {
145 if (yPos + drawH * scaleY > targetRect.
y() + targetRect.
height()) {
147 if (!
qFuzzyCompare((
float)(yPos + drawH * scaleY), (
float)(targetRect.
y() + targetRect.
height())))
148 drawH = targetRect.
y() + targetRect.
height() - yPos;
150 xPos = targetRect.
x();
157 xPos < targetRect.
x() + targetRect.
width()) {
159 if (xPos + drawW * scaleX > targetRect.
x() + targetRect.
width()) {
161 if (!
qFuzzyCompare((
float)(xPos + drawW * scaleX), (
float)(targetRect.
x() + targetRect.
width())))
162 drawW = targetRect.
x() + targetRect.
width() - xPos;
164 if (round(drawW) > 0 && round(drawH) > 0) {
166 VGImage childRectImage = vgChildImage(
image, xOff, yOff, round(drawW), round(drawH));
167 vgTranslate(xPos, yPos);
168 vgScale(scaleX, scaleY);
169 vgDrawImage(childRectImage);
170 vgDestroyImage(childRectImage);
171 vgLoadMatrix(originalMatrix.
constData());
174 xPos += drawW * scaleX;
178 yPos += drawH * scaleY;
224 bottomLeftSourceRect,
229 bottomRightSourceRect,
232 double scaledWidth = 1.0;
233 double scaledHeight = 1.0;
236 VGImage topImage = vgChildImage(
image, topSourceRect.
x(), topSourceRect.
y(), topSourceRect.
width(), topSourceRect.
height());
237 scaledWidth = (topTargetRect.
width() / subSourceRect.
width()) / topSourceRect.
width();
241 vgDestroyImage(topImage);
244 VGImage bottomImage = vgChildImage(
image, bottomSourceRect.
x(), bottomSourceRect.
y(), bottomSourceRect.
width(), bottomSourceRect.
height());
245 scaledWidth = (bottomTargetRect.
width() / subSourceRect.
width()) / bottomSourceRect.
width();
249 vgDestroyImage(bottomImage);
252 VGImage leftImage = vgChildImage(
image, leftSourceRect.
x(), leftSourceRect.
y(), leftSourceRect.
width(), leftSourceRect.
height());
253 scaledHeight = (leftTargetRect.
height() / subSourceRect.
height()) / leftSourceRect.
height();
256 vgDestroyImage(leftImage);
259 VGImage rightImage = vgChildImage(
image, rightSourceRect.
x(), rightSourceRect.
y(), rightSourceRect.
width(), rightSourceRect.
height());
260 scaledHeight = (rightTargetRect.
height() / subSourceRect.
height()) / rightSourceRect.
height();
264 vgDestroyImage(rightImage);
267 VGImage centerImage = vgChildImage(
image, centerSourceRect.
x(), centerSourceRect.
y(), centerSourceRect.
width(), centerSourceRect.
height());
269 scaledWidth = (innerTargetRect.
width() / subSourceRect.
width()) / centerSourceRect.
width();
270 scaledHeight = (innerTargetRect.
height() / subSourceRect.
height()) / centerSourceRect.
height();
274 vgDestroyImage(centerImage);
280 if (sourceRect.
width() <= 0 || sourceRect.
height() <= 0)
284 vgSeti(VG_MATRIX_MODE, VG_MATRIX_IMAGE_USER_TO_SURFACE);
286 vgGetMatrix(originalMatrix.
data());
289 VGImage childRectImage = vgChildImage(
image, sourceRect.
x(), sourceRect.
y(), sourceRect.
width(), sourceRect.
height());
290 vgTranslate(destOffset.
x(), destOffset.
y());
291 vgDrawImage(childRectImage);
292 vgDestroyImage(childRectImage);
295 vgLoadMatrix(originalMatrix.
constData());
306 vgColor[3] =
a * opacity;
312 VGImageFormat vgFormat;
320 vgFormat = VG_sXRGB_8888;
323 vgFormat = VG_sARGB_8888;
326 vgFormat = VG_sARGB_8888_PRE;
329 vgFormat = VG_sRGB_565;
332 vgFormat = VG_sRGBX_8888;
335 vgFormat = VG_sRGBA_8888;
338 vgFormat = VG_sRGBA_8888_PRE;
348 vgFormat = (VGImageFormat)-1;
369 case VG_sARGB_8888_PRE:
381 case VG_sRGBA_8888_PRE:
The QColor class provides colors based on RGB, HSV or CMYK values.
Format
The following image formats are available in Qt.
@ Format_RGBA8888_Premultiplied
@ Format_ARGB32_Premultiplied
const_pointer constData() const noexcept
constexpr qreal right() const noexcept
Returns the right margin.
constexpr qreal left() const noexcept
Returns the left margin.
constexpr qreal top() const noexcept
Returns the top margin.
constexpr qreal bottom() const noexcept
Returns the bottom margin.
\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
\inmodule QtCore\reentrant
constexpr qreal bottom() const noexcept
Returns the y-coordinate of the rectangle's bottom edge.
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 qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
void qDrawBorderImage(VGImage image, const QSizeF &textureSize, const QRectF &targetRect, const QRectF &innerTargetRect, const QRectF &subSourceRect)
void qDrawTiled(VGImage image, const QSize imageSize, const QRectF &targetRect, const QPointF offset, float scaleX, float scaleY)
QImage::Format qVGImageFormatToQImageFormat(VGImageFormat format)
VGImageFormat qImageFormatToVGImageFormat(QImage::Format format)
const QVector< VGfloat > qColorToVGColor(const QColor &color, float opacity)
VGPath qPainterPathToVGPath(const QPainterPath &path)
void qDrawSubImage(VGImage image, const QRectF &sourceRect, const QPointF &destOffset)
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
int qRound(qfloat16 d) noexcept
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei const GLubyte GLsizei GLenum const void * coords
GLenum GLenum GLsizei count
GLenum GLuint GLintptr offset
GLint GLsizei GLsizei GLenum format
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
GLsizei const GLchar *const * path