6#include <QtGui/private/qdrawhelper_p.h>
7#include <QtGui/rhi/qrhi.h>
9#include <QtQuick/qsgtexture.h>
10#include <QtQuick/private/qsgplaintexture_p.h>
15 uint *colorTable,
int size,
float opacity)
20 const bool colorInterpolation =
true;
25 qreal fpos = 1.5 * incr;
28 while (fpos <=
s.first().first) {
29 colorTable[
pos] = colorTable[
pos - 1];
34 if (colorInterpolation)
37 const int sLast =
s.size() - 1;
38 for (
int i = 0;
i < sLast; ++
i) {
39 qreal delta = 1/(
s[
i+1].first -
s[
i].first);
41 if (colorInterpolation)
45 int dist = int(256 * ((fpos -
s[
i].
first) * delta));
46 int idist = 256 -
dist;
47 if (colorInterpolation)
54 current_color = next_color;
59 colorTable[
pos] = last_color;
61 colorTable[
size-1] = last_color;
71 static QHash<QRhi *, QSGGradientCache *>
caches;
89 static const int W = 1024;
115 m_textures[grad] = tx;
@ Format_RGBA8888_Premultiplied
bool isEmpty() const noexcept
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
void addCleanupCallback(const CleanupCallback &callback)
Registers a callback that is invoked either when the QRhi is destroyed, or when runCleanup() is calle...
QSGTexture * get(const QSGGradientCacheKey &grad)
static QSGGradientCache * cacheForRhi(QRhi *rhi)
void setImage(const QImage &image)
void setHorizontalWrapMode(WrapMode hwrap)
Sets the horizontal wrap mode to hwrap.
void setFiltering(Filtering filter)
Sets the sampling mode to filter.
void setVerticalWrapMode(WrapMode vwrap)
Sets the vertical wrap mode to vwrap.
qDeleteAll(list.begin(), list.end())
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
#define ARGB_COMBINE_ALPHA(argb, alpha)
static uint INTERPOLATE_PIXEL_256(uint x, uint a, uint y, uint b)
int qRound(qfloat16 d) noexcept
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat GLfloat alpha
static quint32 ARGB2RGBA(quint32 x)
constexpr QRgb qPremultiply(QRgb x)
static QT_BEGIN_NAMESPACE void generateGradientColorTable(const QSGGradientCacheKey &gradient, uint *colorTable, int size, float opacity)
std::uniform_real_distribution dist(1, 2.5)
[2]
QThreadStorage< QCache< QString, SomeClass > > caches
[7]