• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mcallegari / qlcplus / 12611954629

04 Jan 2025 04:17PM UTC coverage: 31.468% (-0.5%) from 31.963%
12611954629

Pull #1649

github

web-flow
Merge d17d3ec9b into 3ed321c32
Pull Request #1649: Function Wizard: create Effects

2 of 53 new or added lines in 2 files covered. (3.77%)

2597 existing lines in 15 files now uncovered.

14093 of 44785 relevant lines covered (31.47%)

26791.82 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

14.0
/engine/src/rgbplain.cpp
1
/*
2
  Q Light Controller Plus
3
  rgbplain.cpp
4

5
  Copyright (c) Massimo Callegari
6

7
  Licensed under the Apache License, Version 2.0 (the "License");
8
  you may not use this file except in compliance with the License.
9
  You may obtain a copy of the License at
10

11
      http://www.apache.org/licenses/LICENSE-2.0.txt
12

13
  Unless required by applicable law or agreed to in writing, software
14
  distributed under the License is distributed on an "AS IS" BASIS,
15
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
  See the License for the specific language governing permissions and
17
  limitations under the License.
18
*/
19

20
#include <QXmlStreamReader>
21
#include <QXmlStreamWriter>
22
#include <QDebug>
23

24
#include "rgbplain.h"
25
#include "doc.h"
26

27
RGBPlain::RGBPlain(Doc * doc)
8✔
28
    : RGBAlgorithm(doc)
8✔
29
{
30
}
8✔
31

32
RGBPlain::RGBPlain(const RGBPlain& a, QObject *parent)
×
33
    : QObject(parent)
34
    , RGBAlgorithm(a.doc())
×
35
{
36
}
×
37

38
RGBPlain::~RGBPlain()
8✔
39
{
40
}
8✔
41

42
RGBAlgorithm* RGBPlain::clone() const
×
43
{
44
    RGBPlain* plain = new RGBPlain(*this);
×
45
    return static_cast<RGBAlgorithm*> (plain);
×
46
}
47

48
/****************************************************************************
49
 * RGBAlgorithm
50
 ****************************************************************************/
51

52
int RGBPlain::rgbMapStepCount(const QSize& size)
×
53
{
54
    Q_UNUSED(size);
55
    return 1;
×
56
}
57

58
void RGBPlain::rgbMapSetColors(QVector<uint> &colors)
×
59
{
60
    Q_UNUSED(colors);
61
}
×
62

UNCOV
63
QVector<uint> RGBPlain::rgbMapGetColors()
×
64
{
65
    return QVector<uint>();
×
66
}
67

UNCOV
68
void RGBPlain::rgbMap(const QSize& size, uint rgb, int step, RGBMap &map)
×
69
{
70
    Q_UNUSED(step);
UNCOV
71
    map.resize(size.height());
×
UNCOV
72
    for (int y = 0; y < size.height(); y++)
×
73
    {
74
        map[y].resize(size.width());
×
UNCOV
75
        map[y].fill(rgb);
×
76
    }
UNCOV
77
}
×
78

79
QString RGBPlain::name() const
7✔
80
{
81
    return QString("Plain Color");
7✔
82
}
83

84
QString RGBPlain::author() const
×
85
{
86
    return QString("Massimo Callegari");
×
87
}
88

89
int RGBPlain::apiVersion() const
×
90
{
91
    return 1;
×
92
}
93

94
void RGBPlain::setColors(QVector<QColor> colors)
×
95
{
96
    RGBAlgorithm::setColors(colors);
×
UNCOV
97
}
×
98

99
RGBAlgorithm::Type RGBPlain::type() const
×
100
{
101
    return RGBAlgorithm::Plain;
×
102
}
103

104
int RGBPlain::acceptColors() const
×
105
{
UNCOV
106
    return 1; // only start color is accepted
×
107
}
108

109
bool RGBPlain::loadXML(QXmlStreamReader &root)
×
110
{
UNCOV
111
    if (root.name() != KXMLQLCRGBAlgorithm)
×
112
    {
113
        qWarning() << Q_FUNC_INFO << "RGB Algorithm node not found";
×
UNCOV
114
        return false;
×
115
    }
116

UNCOV
117
    if (root.attributes().value(KXMLQLCRGBAlgorithmType).toString() != KXMLQLCRGBPlain)
×
118
    {
UNCOV
119
        qWarning() << Q_FUNC_INFO << "RGB Algorithm is not Plain";
×
UNCOV
120
        return false;
×
121
    }
122

123
    root.skipCurrentElement();
×
124

UNCOV
125
    return true;
×
126
}
127

UNCOV
128
bool RGBPlain::saveXML(QXmlStreamWriter *doc) const
×
129
{
130
    Q_ASSERT(doc != NULL);
131

UNCOV
132
    doc->writeStartElement(KXMLQLCRGBAlgorithm);
×
UNCOV
133
    doc->writeAttribute(KXMLQLCRGBAlgorithmType, KXMLQLCRGBPlain);
×
UNCOV
134
    doc->writeEndElement();
×
135

UNCOV
136
    return true;
×
137
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc