Workspace 6.21.5
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
OperationViewPixmapFactory Class Reference

#include <Workspace/Presentation/operationviewpixmapfactory.h>

Inheritance diagram for OperationViewPixmapFactory:
[legend]

Public Types

enum  PixmapRole { StandardBackground , ErrorBackground , PlaceholderBackground , PlaceholderSelectedBackground }
 

Public Member Functions

virtual ~OperationViewPixmapFactory ()
 
virtual const QPixmap & getPixmap (PixmapRole role, const DataExecution::Operation &op) const
 

Static Public Member Functions

static OperationViewPixmapFactorygetInstance ()
 
static void setDimOperations (bool val)
 

Protected Types

using IconHueRegistry = QMap< int, QPixmap >
 
using IconRegistry = QMap< PixmapRole, IconHueRegistry >
 

Protected Member Functions

 OperationViewPixmapFactory ()=default
 

Static Protected Member Functions

static QImage adjustHue (const QImage &original, int hue)
 
static QPixmap setSaturation (const QPixmap &original, int saturation)
 

Protected Attributes

IconRegistry dimmedIconRegistry
 
IconRegistry iconRegistry
 

Member Typedef Documentation

◆ IconHueRegistry

using IconHueRegistry = QMap<int, QPixmap>
protected

◆ IconRegistry

using IconRegistry = QMap<PixmapRole, IconHueRegistry>
protected

Member Enumeration Documentation

◆ PixmapRole

enum PixmapRole
Enumerator
StandardBackground 
ErrorBackground 
PlaceholderBackground 
PlaceholderSelectedBackground 

Constructor & Destructor Documentation

◆ ~OperationViewPixmapFactory()

~OperationViewPixmapFactory ( )
virtualdefault

◆ OperationViewPixmapFactory()

OperationViewPixmapFactory ( )
protecteddefault

Member Function Documentation

◆ adjustHue()

QImage adjustHue ( const QImage original,
int  hue 
)
staticprotected
Parameters
originalThe original image to adjust the hue
hueThe desired hue of the image
Returns
A hue-adjusted copy of the original input-image.

Takes the input image and adjusts the hue of it. It does this by iterating over each of the pixels in the image and setting the hue to the clamped difference between the desired hue, and the hue in the center of the image.

This obviously assumes:

  • The image size is relatively small, otherwise doing this will be very expensive since there is no parallelisation.
  • The input image's central pixel contains the matching hue value.

◆ getInstance()

OperationViewPixmapFactory & getInstance ( )
static

◆ getPixmap()

const QPixmap & getPixmap ( PixmapRole  role,
const DataExecution::Operation op 
) const
virtual

◆ setDimOperations()

void setDimOperations ( bool  val)
static

◆ setSaturation()

QPixmap setSaturation ( const QPixmap &  original,
int  saturation 
)
staticprotected

Sets the saturation of each pixel in the original image to a given level and returns the adjusted image

Parameters
originalThe original image
saturationThe new saturation level

Member Data Documentation

◆ dimmedIconRegistry

IconRegistry dimmedIconRegistry
mutableprotected

◆ iconRegistry

IconRegistry iconRegistry
mutableprotected