Deleted all files referencing/using boblight

This commit is contained in:
T. van der Zwan
2013-08-13 10:03:00 +00:00
parent 39b98386dd
commit 2ec9f9202e
34 changed files with 1183 additions and 3291 deletions

View File

@@ -3,29 +3,7 @@
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc)
add_library(bob2hyperion SHARED
bob2hyperion.cpp)
target_link_libraries(bob2hyperion
hyperion
hyperion-utils)
add_subdirectory(hyperion)
add_subdirectory(utils)
# Find the libPNG
find_package(PNG REQUIRED QUIET)
if (PNG_FOUND)
# Add additional includes dirs
include_directories(${PNG_INCLUDE_DIR})
add_library(bob2hyperion-png SHARED
hyperion-png.cpp)
target_link_libraries(bob2hyperion-png
hyperion-png)
add_subdirectory(hyperionpng)
endif(PNG_FOUND)
add_subdirectory(hyperionpng)

View File

@@ -1,141 +0,0 @@
// SysLog includes
#include <syslog.h>
// Boblight includes
#include "boblight.h"
// JsonSchema includes
#include <utils/jsonschema/JsonFactory.h>
// Raspilight includes
#include <hyperion/Hyperion.h>
static std::ofstream sDebugStream;
inline Hyperion* rasp_cast(void* hyperion_ptr)
{
return reinterpret_cast<Hyperion*>(hyperion_ptr);
}
void* boblight_init()
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
// syslog(LOG_INFO, __PRETTY_FUNCTION__);
const char* homeDir = getenv("RASPILIGHT_HOME");
if (!homeDir)
{
homeDir = "/etc";
}
syslog(LOG_INFO, "RASPILIGHT HOME DIR: %s", homeDir);
const std::string schemaFile = std::string(homeDir) + "/hyperion.schema.json";
const std::string configFile = std::string(homeDir) + "/hyperion.config.json";
Json::Value raspiConfig;
if (JsonFactory::load(schemaFile, configFile, raspiConfig) < 0)
{
syslog(LOG_WARNING, "UNABLE TO LOAD CONFIGURATION");
return 0;
}
Hyperion* raspiLight = new Hyperion(raspiConfig);
return reinterpret_cast<void*>(raspiLight);
}
void boblight_destroy(void* hyperion_ptr)
{
syslog(LOG_INFO, __PRETTY_FUNCTION__);
Hyperion* raspiLight = rasp_cast(hyperion_ptr);
// Switch all leds to black (off)
// raspiLight->setColor(RgbColor::BLACK);
delete raspiLight;
sDebugStream.close();
}
void boblight_setscanrange(void* hyperion_ptr, int width, int height)
{
syslog(LOG_INFO, __PRETTY_FUNCTION__);
syslog(LOG_INFO, "Configuring scan range [%dx%d]", width, height);
Hyperion* raspiLight = rasp_cast(hyperion_ptr);
// raspiLight->setInputSize(width, height);
}
void boblight_addpixelxy(void* hyperion_ptr, int x, int y, int* rgb)
{
Hyperion* raspiLight = rasp_cast(hyperion_ptr);
const RgbColor color = {uint8_t(rgb[0]), uint8_t(rgb[1]), uint8_t(rgb[2])};
// raspiLight->image().setPixel(x, y, color);
}
int boblight_sendrgb(void* hyperion_ptr, int sync, int* outputused)
{
Hyperion* raspiLight = rasp_cast(hyperion_ptr);
// raspiLight->commit();
return 1;
}
int boblight_connect(void* hyperion_ptr, const char* address, int port, int usectimeout)
{
std::cout << "SUCCESFULL NO CONNECTION WITH BOBLIGHT" << std::endl;
return 1;
}
const char* boblight_geterror(void* hyperion_ptr)
{
return "ERROR";
}
int boblight_setpriority(void* hyperion_ptr, int priority)
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
int boblight_getnrlights(void* hyperion_ptr)
{
return 1;
}
const char* boblight_getlightname(void* hyperion_ptr, int lightnr)
{
return "LIGHT_NAME";
}
int boblight_getnroptions(void* hyperion_ptr)
{
return 1;
}
const char* boblight_getoptiondescript(void* hyperion_ptr, int option)
{
return "OPTION-DESCRIPTION";
}
int boblight_setoption(void* hyperion_ptr, int lightnr, const char* option)
{
return 1;
}
int boblight_getoption(void* hyperion_ptr, int lightnr, const char* option, const char** output)
{
return 1;
}
int boblight_addpixel(void* hyperion_ptr, int lightnr, int* rgb)
{
return 1;
}
int boblight_ping(void* hyperion_ptr, int* outputused)
{
return 1;
}

View File

@@ -1,174 +0,0 @@
// STL includes
#include <fstream>
#include <sstream>
#include <iostream>
// Boblight includes
#include <boblight.h>
// PNGWriter includes
#define NO_FREETYPE
#include "hyperionpng/pngwriter.h"
struct RaspiPng
{
pngwriter writer;
unsigned long fileIndex;
unsigned frameCnt;
std::ofstream logFile;
};
void* boblight_init()
{
RaspiPng* raspiPng = new RaspiPng();
raspiPng->writer.pngwriter_rename("/home/pi/RASPI_0000.png");
raspiPng->fileIndex = 0;
raspiPng->frameCnt = 0;
raspiPng->logFile.open("/home/pi/raspipng.log");
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return reinterpret_cast<void*>(raspiPng);
}
void boblight_destroy(void* vpboblight)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
raspiPng->logFile.close();
delete raspiPng;
}
void boblight_setscanrange(void* vpboblight, int width, int height)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << "(" << width << ", " << height << ")" << std::endl;
raspiPng->writer.resize(width, height);
}
void boblight_addpixelxy(void* vpboblight, int x, int y, int* rgb)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
if (raspiPng->frameCnt%50 == 0)
{
// NB libpngwriter uses a one-based indexing scheme
raspiPng->writer.plot(x+1,y+1, rgb[0]/255.0, rgb[1]/255.0, rgb[2]/255.0);
}
}
int boblight_sendrgb(void* vpboblight, int sync, int* outputused)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << "(" << sync << ", outputused) FRAME " << raspiPng->frameCnt++ << std::endl;
if (raspiPng->frameCnt%50 == 0)
{
// Write-out the current frame and prepare for the next
raspiPng->writer.write_png();
++raspiPng->fileIndex;
char filename[64];
sprintf(filename, "/home/pi/RASPI_%04ld.png", raspiPng->fileIndex);
raspiPng->writer.pngwriter_rename(filename);
}
return 1;
}
int boblight_connect(void* vpboblight, const char* address, int port, int usectimeout)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
int boblight_setpriority(void* vpboblight, int priority)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
const char* boblight_geterror(void* vpboblight)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return "ERROR";
}
int boblight_getnrlights(void* vpboblight)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 50;
}
const char* boblight_getlightname(void* vpboblight, int lightnr)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return "LIGHT";
}
int boblight_getnroptions(void* vpboblight)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
const char* boblight_getoptiondescript(void* vpboblight, int option)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return "";
}
int boblight_setoption(void* vpboblight, int lightnr, const char* option)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
int boblight_getoption(void* vpboblight, int lightnr, const char* option, const char** output)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
int boblight_addpixel(void* vpboblight, int lightnr, int* rgb)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}
int boblight_ping(void* vpboblight, int* outputused)
{
RaspiPng* raspiPng = reinterpret_cast<RaspiPng*>(vpboblight);
raspiPng->logFile << __PRETTY_FUNCTION__ << std::endl;
return 1;
}

View File

@@ -7,14 +7,18 @@ include_directories(${BCM_INCLUDE_DIRS})
SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/hyperion)
SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/hyperion)
# Group the headers that go through the MOC compiler
SET(Hyperion_QT_HEADERS
${CURRENT_HEADER_DIR}/DispmanxWrapper.h
)
SET(Hyperion_HEADERS
${CURRENT_HEADER_DIR}/LedString.h
${CURRENT_HEADER_DIR}/Hyperion.h
${CURRENT_HEADER_DIR}/LedDevice.h
${CURRENT_HEADER_DIR}/LedString.h
${CURRENT_HEADER_DIR}/ImageProcessor.h
${CURRENT_HEADER_DIR}/ImageProcessorFactory.h
${CURRENT_HEADER_DIR}/PriorityMuxer.h
${CURRENT_HEADER_DIR}/DispmanxWrapper.h
${CURRENT_SOURCE_DIR}/DispmanxFrameGrabber.h
@@ -38,10 +42,11 @@ SET(Hyperion_SOURCES
${CURRENT_SOURCE_DIR}/ColorTransform.cpp
)
QT4_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_HEADERS})
QT4_WRAP_CPP(Hyperion_HEADERS_MOC ${Hyperion_QT_HEADERS})
add_library(hyperion
${Hyperion_HEADERS}
${Hyperion_QT_HEADERS}
${Hyperion_HEADERS_MOC}
${Hyperion_SOURCES}
)

View File

@@ -13,6 +13,8 @@ DispmanxFrameGrabber::DispmanxFrameGrabber(const unsigned width, const unsigned
// Open the connection to the displaydisplay
_display = vc_dispmanx_display_open(0);
int ret = vc_dispmanx_display_get_info(_display, &_info);
// Make the compiler (in release mode) happy by 'using' ret
(void)ret;
assert(ret == 0);
// Create the resources for capturing image

View File

@@ -1,6 +1,7 @@
#pragma once
// BCM includes
#pragma GCC system_header
#include <bcm_host.h>
// STL includes

View File

@@ -5,6 +5,7 @@
// Hyperion includes
#include <hyperion/DispmanxWrapper.h>
#include <hyperion/ImageProcessorFactory.h>
#include <hyperion/ImageProcessor.h>
// Local-Hyperion includes
@@ -12,19 +13,21 @@
DispmanxWrapper::DispmanxWrapper() :
_timer(),
_processor(ImageProcessorFactory::getInstance().newImageProcessor()),
_frameGrabber(new DispmanxFrameGrabber(64, 64))
_frameGrabber(new DispmanxFrameGrabber(64, 64)),
_processor(ImageProcessorFactory::getInstance().newImageProcessor())
{
_timer.setInterval(100);
_timer.setSingleShot(false);
_processor->setSize(64, 64);
QObject::connect(&_timer, SIGNAL(timeout()), this, SLOT(action()));
}
DispmanxWrapper::~DispmanxWrapper()
{
delete _frameGrabber;
delete _processor;
delete _frameGrabber;
}
void DispmanxWrapper::start()

File diff suppressed because it is too large Load Diff