Marble

BlendingFactory.cpp
1// SPDX-FileCopyrightText: 2010 Jens-Michael Hoffmann <jmho@c-xx.com>
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4
5#include "BlendingFactory.h"
6
7#include <QDebug>
8
9#include "blendings/SunLightBlending.h"
10#include "BlendingAlgorithms.h"
11
12namespace Marble
13{
14
15void BlendingFactory::setLevelZeroLayout( int levelZeroColumns, int levelZeroRows )
16{
17 m_sunLightBlending->setLevelZeroLayout( levelZeroColumns, levelZeroRows );
18}
19
20Blending const * BlendingFactory::findBlending( QString const & name ) const
21{
22 if ( name.isEmpty() )
23 return nullptr;
24
25 Blending const * const result = m_blendings.value( name, 0 );
26 if ( !result )
27 qWarning() << "Unknown blending" << name << "specified in .dgml file. Please fix the .dgml file.";
28 return result;
29}
30
31BlendingFactory::BlendingFactory( const SunLocator *sunLocator )
32 : m_sunLightBlending( new SunLightBlending( sunLocator ) )
33{
34 m_blendings.insert( "OverpaintBlending", new OverpaintBlending );
35
36 // Neutral blendings
37 m_blendings.insert( "AllanonBlending", new AllanonBlending );
38 m_blendings.insert( "ArcusTangentBlending", new ArcusTangentBlending );
39 m_blendings.insert( "GeometricMeanBlending", new GeometricMeanBlending );
40 m_blendings.insert( "LinearLightBlending", new LinearLightBlending );
41 //m_blendings.insert( "NoiseBlending", new NoiseBlending );
42 m_blendings.insert( "OverlayBlending", new OverlayBlending );
43 //m_blendings.insert( "ParallelBlending", new ParallelBlending );
44 //m_blendings.insert( "TextureBlending", new TextureBlending );
45
46 // Darkening blendings
47 m_blendings.insert( "AlphaBlending", new OverpaintBlending ); // for backwards compatibility
48 m_blendings.insert( "ColorBurnBlending", new ColorBurnBlending );
49 m_blendings.insert( "DarkBlending", new DarkBlending );
50 m_blendings.insert( "DarkenBlending", new DarkenBlending );
51 m_blendings.insert( "DivideBlending", new DivideBlending );
52 m_blendings.insert( "GammaDarkBlending", new GammaDarkBlending );
53 m_blendings.insert( "LinearBurnBlending", new LinearBurnBlending );
54 m_blendings.insert( "MultiplyBlending", new MultiplyBlending );
55 m_blendings.insert( "SubtractiveBlending", new SubtractiveBlending );
56
57 // Lightening blendings
58 m_blendings.insert( "AdditiveBlending", new AdditiveBlending );
59 m_blendings.insert( "ColorDodgeBlending", new ColorDodgeBlending );
60 m_blendings.insert( "GammaLightBlending", new GammaLightBlending );
61 m_blendings.insert( "HardLightBlending", new HardLightBlending );
62 m_blendings.insert( "LightBlending", new LightBlending );
63 m_blendings.insert( "LightenBlending", new LightenBlending );
64 m_blendings.insert( "PinLightBlending", new PinLightBlending );
65 m_blendings.insert( "ScreenBlending", new ScreenBlending );
66 m_blendings.insert( "SoftLightBlending", new SoftLightBlending );
67 m_blendings.insert( "VividLightBlending", new VividLightBlending );
68
69 // Inverter blendings
70 //m_blendings.insert( "AdditiveSubtractiveBlending", new AdditiveSubtractiveBlending );
71 m_blendings.insert( "BleachBlending", new BleachBlending );
72 m_blendings.insert( "DifferenceBlending", new DifferenceBlending );
73 m_blendings.insert( "EquivalenceBlending", new EquivalenceBlending );
74 m_blendings.insert( "HalfDifferenceBlending", new HalfDifferenceBlending );
75
76 // Special purpose blendings
77 m_blendings.insert( "CloudsBlending", new CloudsBlending );
78 m_blendings.insert( "SunLightBlending", m_sunLightBlending );
79 m_blendings.insert( "GrayscaleBlending", new GrayscaleBlending );
80 m_blendings.insert( "InvertColorBlending", new InvertColorBlending );
81 m_blendings.insert( "InvertHueBlending", new InvertHueBlending );
82}
83
84BlendingFactory::~BlendingFactory()
85{
86 m_blendings.remove( "SunLightBlending" );
87 delete m_sunLightBlending;
88 qDeleteAll( m_blendings );
89}
90
91}
QString name(StandardAction id)
Binds a QML item to a specific geodetic location in screen coordinates.
T value(const Key &key) const const
bool isEmpty() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.