mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Pass primitive types by value (#935)
This commit is contained in:
@@ -54,7 +54,7 @@ signals:
|
||||
/// @param[in] owner Specific owner string, might be empty
|
||||
/// @param[in] smooth_cfg The smooth id to use
|
||||
///
|
||||
void registerGlobalInput(const int priority, const hyperion::Components& component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0);
|
||||
void registerGlobalInput(int priority, hyperion::Components component, const QString& origin = "External", const QString& owner = "", unsigned smooth_cfg = 0);
|
||||
|
||||
///
|
||||
/// @brief PIPE the clear command for the global priority channel over HyperionDaemon to Hyperion class
|
||||
@@ -70,7 +70,7 @@ signals:
|
||||
/// @param[in] timeout_ms The timeout in milliseconds
|
||||
/// @param clearEffect Should be true when NOT called from an effect
|
||||
///
|
||||
void setGlobalImage(const int priority, const Image<ColorRgb>& image, const int timeout_ms, const bool& clearEffect = true);
|
||||
void setGlobalImage(int priority, const Image<ColorRgb>& image, int timeout_ms, bool clearEffect = true);
|
||||
|
||||
///
|
||||
/// @brief PIPE external color message over HyperionDaemon to Hyperion class
|
||||
@@ -80,7 +80,7 @@ signals:
|
||||
/// @param[in] origin The setter
|
||||
/// @param clearEffect Should be true when NOT called from an effect
|
||||
///
|
||||
void setGlobalColor(const int priority, const std::vector<ColorRgb> &ledColor, const int timeout_ms, const QString& origin = "External" ,bool clearEffects = true);
|
||||
void setGlobalColor(int priority, const std::vector<ColorRgb> &ledColor, int timeout_ms, const QString& origin = "External" ,bool clearEffects = true);
|
||||
|
||||
///////////////////////////////////////
|
||||
//////////// FROM HYPERION ////////////
|
||||
@@ -98,6 +98,6 @@ signals:
|
||||
/// @param hyperionInd The Hyperion instance index as identifier
|
||||
/// @param listen True when listening, else false
|
||||
///
|
||||
void requestSource(const hyperion::Components& component, const int hyperionInd, const bool listen);
|
||||
void requestSource(hyperion::Components component, int hyperionInd, bool listen);
|
||||
|
||||
};
|
||||
|
@@ -15,7 +15,7 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
Image(const unsigned width, const unsigned height) :
|
||||
Image(unsigned width, unsigned height) :
|
||||
Image(width, height, Pixel_T())
|
||||
|
||||
{
|
||||
@@ -28,7 +28,7 @@ public:
|
||||
/// @param height The height of the image
|
||||
/// @param background The color of the image
|
||||
///
|
||||
Image(const unsigned width, const unsigned height, const Pixel_T background) :
|
||||
Image(unsigned width, unsigned height, const Pixel_T background) :
|
||||
_d_ptr(new ImageData<Pixel_T>(width, height, background))
|
||||
{
|
||||
}
|
||||
@@ -93,12 +93,12 @@ public:
|
||||
return _d_ptr->height();
|
||||
}
|
||||
|
||||
uint8_t red(const unsigned pixel) const
|
||||
uint8_t red(unsigned pixel) const
|
||||
{
|
||||
return _d_ptr->red(pixel);
|
||||
}
|
||||
|
||||
uint8_t green(const unsigned pixel) const
|
||||
uint8_t green(unsigned pixel) const
|
||||
{
|
||||
return _d_ptr->green(pixel);
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
///
|
||||
/// @return const reference to specified pixel
|
||||
///
|
||||
uint8_t blue(const unsigned pixel) const
|
||||
uint8_t blue(unsigned pixel) const
|
||||
{
|
||||
return _d_ptr->blue(pixel);
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
///
|
||||
/// @param x The x index
|
||||
/// @param y The y index
|
||||
const Pixel_T& operator()(const unsigned x, const unsigned y) const
|
||||
const Pixel_T& operator()(unsigned x, unsigned y) const
|
||||
{
|
||||
return _d_ptr->operator()(x, y);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ public:
|
||||
///
|
||||
/// @return reference to specified pixel
|
||||
///
|
||||
Pixel_T& operator()(const unsigned x, const unsigned y)
|
||||
Pixel_T& operator()(unsigned x, unsigned y)
|
||||
{
|
||||
return _d_ptr->operator()(x, y);
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
/// Resize the image
|
||||
/// @param width The width of the image
|
||||
/// @param height The height of the image
|
||||
void resize(const unsigned width, const unsigned height)
|
||||
void resize(unsigned width, unsigned height)
|
||||
{
|
||||
_d_ptr->resize(width, height);
|
||||
}
|
||||
@@ -198,7 +198,7 @@ private:
|
||||
///
|
||||
/// @return The index into the underlying data-vector
|
||||
///
|
||||
inline unsigned toIndex(const unsigned x, const unsigned y) const
|
||||
inline unsigned toIndex(unsigned x, unsigned y) const
|
||||
{
|
||||
return _d_ptr->toIndex(x, y);
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ class ImageData : public QSharedData
|
||||
public:
|
||||
typedef Pixel_T pixel_type;
|
||||
|
||||
ImageData(const unsigned width, const unsigned height, const Pixel_T background) :
|
||||
ImageData(unsigned width, unsigned height, const Pixel_T background) :
|
||||
_width(width),
|
||||
_height(height),
|
||||
_pixels(new Pixel_T[width * height + 1])
|
||||
@@ -84,32 +84,32 @@ public:
|
||||
return _height;
|
||||
}
|
||||
|
||||
uint8_t red(const unsigned pixel) const
|
||||
uint8_t red(unsigned pixel) const
|
||||
{
|
||||
return (_pixels + pixel)->red;
|
||||
}
|
||||
|
||||
uint8_t green(const unsigned pixel) const
|
||||
uint8_t green(unsigned pixel) const
|
||||
{
|
||||
return (_pixels + pixel)->green;
|
||||
}
|
||||
|
||||
uint8_t blue(const unsigned pixel) const
|
||||
uint8_t blue(unsigned pixel) const
|
||||
{
|
||||
return (_pixels + pixel)->blue;
|
||||
}
|
||||
|
||||
const Pixel_T& operator()(const unsigned x, const unsigned y) const
|
||||
const Pixel_T& operator()(unsigned x, unsigned y) const
|
||||
{
|
||||
return _pixels[toIndex(x,y)];
|
||||
}
|
||||
|
||||
Pixel_T& operator()(const unsigned x, const unsigned y)
|
||||
Pixel_T& operator()(unsigned x, unsigned y)
|
||||
{
|
||||
return _pixels[toIndex(x,y)];
|
||||
}
|
||||
|
||||
void resize(const unsigned width, const unsigned height)
|
||||
void resize(unsigned width, unsigned height)
|
||||
{
|
||||
if (width == _width && height == _height)
|
||||
return;
|
||||
@@ -167,7 +167,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
inline unsigned toIndex(const unsigned x, const unsigned y) const
|
||||
inline unsigned toIndex(unsigned x, unsigned y) const
|
||||
{
|
||||
return y * _width + x;
|
||||
}
|
||||
|
@@ -42,7 +42,7 @@ private slots:
|
||||
/// @param type settingyType from enum
|
||||
/// @param config configuration object
|
||||
///
|
||||
void handleSettingsUpdate(const settings::type& type, const QJsonDocument& config);
|
||||
void handleSettingsUpdate(settings::type type, const QJsonDocument& config);
|
||||
|
||||
private:
|
||||
Logger* _log;
|
||||
|
@@ -71,7 +71,7 @@ namespace hyperion {
|
||||
return RgbTransform(gammaR, gammaG, gammaB, backlightThreshold, backlightColored, brightness, brightnessComp);
|
||||
}
|
||||
|
||||
RgbChannelAdjustment createRgbChannelAdjustment(const QJsonObject& colorConfig, const QString& channelName, const int defaultR, const int defaultG, const int defaultB)
|
||||
RgbChannelAdjustment createRgbChannelAdjustment(const QJsonObject& colorConfig, const QString& channelName, int defaultR, int defaultG, int defaultB)
|
||||
{
|
||||
const QJsonArray& channelConfig = colorConfig[channelName].toArray();
|
||||
return RgbChannelAdjustment(
|
||||
@@ -101,7 +101,7 @@ namespace hyperion {
|
||||
return adjustment;
|
||||
}
|
||||
|
||||
MultiColorAdjustment * createLedColorsAdjustment(const unsigned ledCnt, const QJsonObject & colorConfig)
|
||||
MultiColorAdjustment * createLedColorsAdjustment(unsigned ledCnt, const QJsonObject & colorConfig)
|
||||
{
|
||||
// Create the result, the transforms are added to this
|
||||
MultiColorAdjustment * adjustment = new MultiColorAdjustment(ledCnt);
|
||||
|
Reference in New Issue
Block a user