Envision
A visual programming IDE for object-oriented languages
List of all members | Public Member Functions | Private Attributes
Visualization::Mipmap Class Reference

Public Member Functions

bool containsImageForScale (qreal scaleFactor)
 
qreal minimalScaleFactor ()
 
bool paint (QPainter *painter, int x, int y)
 Paints a precached QPixmap using painter at the specified position. More...
 
void setImage (const QImage &image, const QPainter *painterToDetermineScaleFactor)
 
void setImage (const QImage &image, qreal scaleFactor)
 
void setImage (const QPixmap &pixmap, const QPainter *painterToDetermineScaleFactor)
 
void setImage (const QPixmap &pixmap, qreal scaleFactor)
 
void setMinimalScaleFactor (qreal factor)
 Sets the minimum scaling factor for which a QPixmap will be precomputed. More...
 

Private Attributes

qreal minimalScaleFactor_ {0.1}
 
QMap< qreal, QPixmap > scaleFactorImagesMap_
 

Member Function Documentation

◆ containsImageForScale()

bool Visualization::Mipmap::containsImageForScale ( qreal  scaleFactor)

◆ minimalScaleFactor()

qreal Visualization::Mipmap::minimalScaleFactor ( )
inline

◆ paint()

bool Visualization::Mipmap::paint ( QPainter *  painter,
int  x,
int  y 
)

Paints a precached QPixmap using painter at the specified position.

Returns true if an appropriately sized QPixmap was found and false otherwise.

◆ setImage() [1/4]

void Visualization::Mipmap::setImage ( const QImage &  image,
const QPainter *  painterToDetermineScaleFactor 
)

◆ setImage() [2/4]

void Visualization::Mipmap::setImage ( const QImage &  image,
qreal  scaleFactor 
)

◆ setImage() [3/4]

void Visualization::Mipmap::setImage ( const QPixmap &  pixmap,
const QPainter *  painterToDetermineScaleFactor 
)

◆ setImage() [4/4]

void Visualization::Mipmap::setImage ( const QPixmap &  pixmap,
qreal  scaleFactor 
)

◆ setMinimalScaleFactor()

void Visualization::Mipmap::setMinimalScaleFactor ( qreal  factor)
inline

Sets the minimum scaling factor for which a QPixmap will be precomputed.

Smaller images will be based on the smallest precomputed pixmap.

Member Data Documentation

◆ minimalScaleFactor_

qreal Visualization::Mipmap::minimalScaleFactor_ {0.1}
private

◆ scaleFactorImagesMap_

QMap<qreal, QPixmap> Visualization::Mipmap::scaleFactorImagesMap_
private