Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QGradientCache Class Reference
+ Collaboration diagram for QGradientCache:

Classes

struct  CacheInfo
 

Public Types

using QGradientColorTableHash = QMultiHash< quint64, std::shared_ptr< const CacheInfo > >
 

Public Member Functions

std::shared_ptr< const CacheInfogetBuffer (const QGradient &gradient, int opacity)
 
int paletteSize () const
 

Protected Member Functions

int maxCacheSize () const
 
void generateGradientColorTable (const QGradient &g, QRgba64 *colorTable, int size, int opacity) const
 
std::shared_ptr< const CacheInfoaddCacheElement (quint64 hash_val, const QGradient &gradient, int opacity)
 

Protected Attributes

QGradientColorTableHash cache
 
QMutex mutex
 

Detailed Description

Definition at line 4199 of file qpaintengine_raster.cpp.

Member Typedef Documentation

◆ QGradientColorTableHash

Definition at line 4213 of file qpaintengine_raster.cpp.

Member Function Documentation

◆ addCacheElement()

std::shared_ptr< const CacheInfo > QGradientCache::addCacheElement ( quint64  hash_val,
const QGradient gradient,
int  opacity 
)
inlineprotected

Definition at line 4245 of file qpaintengine_raster.cpp.

References QMultiHash< Key, T >::begin(), QRandomGenerator::bounded(), cache, QMultiHash< Key, T >::erase(), generateGradientColorTable(), QRandomGenerator::global(), GRADIENT_STOPTABLE_SIZE, i, QMultiHash< Key, T >::insert(), QGradient::interpolationMode(), maxCacheSize(), paletteSize(), QMultiHash< Key, T >::size(), and QGradient::stops().

Referenced by getBuffer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ generateGradientColorTable()

void QGradientCache::generateGradientColorTable ( const QGradient g,
QRgba64 colorTable,
int  size,
int  opacity 
) const
inlineprotected

Definition at line 4261 of file qpaintengine_raster.cpp.

References QRgba64::alpha(), QRgba64::blue(), QGradient::ColorInterpolation, combineAlpha256(), dist(), QList< T >::first(), GRADIENT_STOPTABLE_SIZE, QRgba64::green(), i, interpolate256(), QGradient::interpolationMode(), pos, Q_ASSERT, qMin(), qPremultiply(), qRgba64(), qRound(), qSwap(), QRgba64::red(), QList< T >::size(), and QGradient::stops().

Referenced by addCacheElement().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBuffer()

std::shared_ptr< const CacheInfo > QGradientCache::getBuffer ( const QGradient gradient,
int  opacity 
)
inline

Definition at line 4215 of file qpaintengine_raster.cpp.

References addCacheElement(), cache, QMultiHash< quint64, std::shared_ptr< const CacheInfo > >::const_iterator, QMultiHash< Key, T >::constEnd(), QMultiHash< Key, T >::constFind(), i, QGradient::interpolationMode(), it, lock, mutex, QList< T >::size(), and QGradient::stops().

+ Here is the call graph for this function:

◆ maxCacheSize()

int QGradientCache::maxCacheSize ( ) const
inlineprotected

Definition at line 4241 of file qpaintengine_raster.cpp.

Referenced by addCacheElement().

+ Here is the caller graph for this function:

◆ paletteSize()

int QGradientCache::paletteSize ( ) const
inline

Definition at line 4239 of file qpaintengine_raster.cpp.

References GRADIENT_STOPTABLE_SIZE.

Referenced by addCacheElement().

+ Here is the caller graph for this function:

Member Data Documentation

◆ cache

QGradientColorTableHash QGradientCache::cache
protected

Definition at line 4257 of file qpaintengine_raster.cpp.

Referenced by addCacheElement(), and getBuffer().

◆ mutex

QMutex QGradientCache::mutex
protected

Definition at line 4258 of file qpaintengine_raster.cpp.

Referenced by getBuffer().


The documentation for this class was generated from the following file: