2013-08-13 11:10:45 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
// STL includes
|
|
|
|
#include <memory>
|
|
|
|
|
2016-09-25 21:59:31 +02:00
|
|
|
// QT includes
|
|
|
|
#include <QJsonObject>
|
|
|
|
|
2013-08-13 11:10:45 +02:00
|
|
|
#include <hyperion/LedString.h>
|
|
|
|
|
|
|
|
// Forward class declaration
|
|
|
|
class ImageProcessor;
|
|
|
|
|
2013-09-06 21:26:58 +02:00
|
|
|
///
|
|
|
|
/// The ImageProcessor is a singleton factor for creating ImageProcessors that translate images to
|
|
|
|
/// led color values.
|
|
|
|
///
|
2013-08-13 11:10:45 +02:00
|
|
|
class ImageProcessorFactory
|
|
|
|
{
|
|
|
|
public:
|
2013-09-06 21:26:58 +02:00
|
|
|
///
|
|
|
|
/// Returns the 'singleton' instance (creates the singleton if it does not exist)
|
|
|
|
///
|
|
|
|
/// @return The singleton instance of the ImageProcessorFactory
|
|
|
|
///
|
2013-08-13 11:10:45 +02:00
|
|
|
static ImageProcessorFactory& getInstance();
|
|
|
|
|
|
|
|
public:
|
2013-09-06 21:26:58 +02:00
|
|
|
///
|
|
|
|
/// Initialises this factory with the given led-configuration
|
|
|
|
///
|
|
|
|
/// @param[in] ledString The led configuration
|
2016-10-11 19:51:20 +02:00
|
|
|
/// @param[in] blackborderConfig Contains the blackborder configuration
|
2013-09-06 21:26:58 +02:00
|
|
|
///
|
2016-12-19 23:59:50 +01:00
|
|
|
void init(const LedString& ledString, const QJsonObject &blackborderConfig, int mappingType);
|
2013-08-13 11:10:45 +02:00
|
|
|
|
2013-09-06 21:26:58 +02:00
|
|
|
///
|
|
|
|
/// Creates a new ImageProcessor. The onwership of the processor is transferred to the caller.
|
|
|
|
///
|
|
|
|
/// @return The newly created ImageProcessor
|
|
|
|
///
|
2013-08-13 11:10:45 +02:00
|
|
|
ImageProcessor* newImageProcessor() const;
|
|
|
|
|
|
|
|
private:
|
2013-09-06 21:26:58 +02:00
|
|
|
/// The Led-string specification
|
2013-08-13 11:10:45 +02:00
|
|
|
LedString _ledString;
|
2013-10-20 22:27:05 +02:00
|
|
|
|
2016-12-19 23:59:50 +01:00
|
|
|
/// Reference to the blackborder json configuration values
|
2016-09-25 21:59:31 +02:00
|
|
|
QJsonObject _blackborderConfig;
|
2016-12-19 23:59:50 +01:00
|
|
|
|
|
|
|
// image 2 led mapping type
|
|
|
|
int _mappingType;
|
2013-08-13 11:10:45 +02:00
|
|
|
};
|