mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Added/Updated/Fixed doxygen comments
This commit is contained in:
@@ -6,32 +6,65 @@
|
||||
|
||||
namespace hyperion
|
||||
{
|
||||
///
|
||||
/// The BlackBorder processor is a wrapper around the black-border detector for keeping track of
|
||||
/// detected borders and count of the type and size of detected borders.
|
||||
///
|
||||
class BlackBorderProcessor
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructor for the BlackBorderProcessor
|
||||
/// @param unknownFrameCnt The number of frames(images) that need to contain an unknown
|
||||
/// border before the current border is set to unknown
|
||||
/// @param borderFrameCnt The number of frames(images) that need to contain a vertical or
|
||||
/// horizontal border becomes the current border
|
||||
/// @param blurRemoveCnt The size to add to a horizontal or vertical border (because the
|
||||
/// outer pixels is blurred (black and color combined))
|
||||
///
|
||||
BlackBorderProcessor(
|
||||
const unsigned unknownFrameCnt,
|
||||
const unsigned borderFrameCnt,
|
||||
const unsigned blurRemoveCnt);
|
||||
|
||||
///
|
||||
/// Return the current (detected) border
|
||||
/// @return The current border
|
||||
///
|
||||
BlackBorder getCurrentBorder() const;
|
||||
|
||||
///
|
||||
/// Processes the image. This performs detecion of black-border on the given image and
|
||||
/// updates the current border accordingly. If the current border is updated the method call
|
||||
/// will return true else false
|
||||
///
|
||||
/// @param image The image to process
|
||||
///
|
||||
/// @return True if a different border was detected than the current else false
|
||||
///
|
||||
bool process(const RgbImage& image);
|
||||
|
||||
private:
|
||||
|
||||
/// The number of unknown-borders detected before it becomes the current border
|
||||
const unsigned _unknownSwitchCnt;
|
||||
|
||||
/// The number of horizontal/vertical borders detected before it becomes the current border
|
||||
const unsigned _borderSwitchCnt;
|
||||
|
||||
/// The number of pixels to increase a detected border for removing blury pixels
|
||||
unsigned _blurRemoveCnt;
|
||||
|
||||
/// The blackborder detector
|
||||
BlackBorderDetector _detector;
|
||||
|
||||
/// The current detected border
|
||||
BlackBorder _currentBorder;
|
||||
|
||||
/// The border detected in the previous frame
|
||||
BlackBorder _previousDetectedBorder;
|
||||
|
||||
/// The number of frame the previous detected border matched the incomming border
|
||||
unsigned _consistentCnt;
|
||||
};
|
||||
} // end namespace hyperion
|
||||
|
@@ -6,14 +6,33 @@
|
||||
// Hyperion includes
|
||||
#include <hyperion/LedDevice.h>
|
||||
|
||||
///
|
||||
/// Implementation of the LedDevice that write the led-colors to an
|
||||
/// ASCII-textfile('/home/pi/LedDevice.out')
|
||||
///
|
||||
class LedDeviceTest : public LedDevice
|
||||
{
|
||||
public:
|
||||
///
|
||||
/// Constructs the test-device, which opens an output stream to the file
|
||||
///
|
||||
LedDeviceTest();
|
||||
|
||||
///
|
||||
/// Destructor of this test-device
|
||||
///
|
||||
virtual ~LedDeviceTest();
|
||||
|
||||
///
|
||||
/// Writes the given led-color values to the output stream
|
||||
///
|
||||
/// @param ledValues The color-value per led
|
||||
///
|
||||
/// @return Zero on success else negative
|
||||
///
|
||||
virtual int write(const std::vector<RgbColor> & ledValues);
|
||||
|
||||
private:
|
||||
/// The outputstream
|
||||
std::ofstream _ofs;
|
||||
};
|
||||
|
@@ -11,9 +11,7 @@
|
||||
// hyperion local includes
|
||||
#include "LedDeviceWs2801.h"
|
||||
|
||||
LedDeviceWs2801::LedDeviceWs2801(const std::string& name,
|
||||
const std::string& outputDevice,
|
||||
const unsigned interval,
|
||||
LedDeviceWs2801::LedDeviceWs2801(const std::string& outputDevice,
|
||||
const unsigned baudrate) :
|
||||
mDeviceName(outputDevice),
|
||||
mBaudRate_Hz(baudrate),
|
||||
|
@@ -9,25 +9,51 @@
|
||||
// hyperion incluse
|
||||
#include <hyperion/LedDevice.h>
|
||||
|
||||
///
|
||||
/// Implementation of the LedDevice interface for writing to Ws2801 led device.
|
||||
///
|
||||
class LedDeviceWs2801 : public LedDevice
|
||||
{
|
||||
public:
|
||||
LedDeviceWs2801(const std::string& name,
|
||||
const std::string& outputDevice,
|
||||
const unsigned interval,
|
||||
///
|
||||
/// Constructs the LedDevice for a string containing leds of the type Ws2801
|
||||
///
|
||||
/// @param outputDevice The name of the output device (eg '/etc/SpiDev.0.0')
|
||||
/// @param baudrate The used baudrate for writing to the output device
|
||||
///
|
||||
LedDeviceWs2801(const std::string& outputDevice,
|
||||
const unsigned baudrate);
|
||||
|
||||
///
|
||||
/// Destructor of the LedDevice; closes the output device if it is open
|
||||
///
|
||||
virtual ~LedDeviceWs2801();
|
||||
|
||||
///
|
||||
/// Opens and configures the output device
|
||||
///
|
||||
/// @return Zero on succes else negative
|
||||
///
|
||||
int open();
|
||||
|
||||
///
|
||||
/// Writes the led color values to the led-device
|
||||
///
|
||||
/// @param ledValues The color-value per led
|
||||
/// @return Zero on succes else negative
|
||||
///
|
||||
virtual int write(const std::vector<RgbColor> &ledValues);
|
||||
|
||||
private:
|
||||
/// The name of the output device
|
||||
const std::string mDeviceName;
|
||||
/// The used baudrate of the output device
|
||||
const int mBaudRate_Hz;
|
||||
|
||||
/// The File Identifier of the opened output device (or -1 if not opened)
|
||||
int mFid;
|
||||
/// The transfer structure for writing to the spi-device
|
||||
spi_ioc_transfer spi;
|
||||
/// The 'latch' time for latching the shifted-value into the leds
|
||||
timespec latchTime;
|
||||
};
|
||||
|
Reference in New Issue
Block a user