47 changed files with 2015 additions and 416 deletions
-
10Projects/argus/Debug/default.conf
-
2Projects/argus/argus.vpj
-
24Projects/argus/makefile
-
169Projects/custom_cam/custom_raylib.cpp
-
75Projects/custom_cam/custom_sdl.cpp
-
BINProjects/custom_cam/popo
-
2Projects/custom_cam/runtest
-
1Projects/custom_cam/start_params
-
59lib/components/base/basicEvent.cpp
-
68lib/components/base/basicEvent.h
-
27lib/components/base/basicEventHandler.h
-
4lib/components/base/basicEventHeap.cpp
-
2lib/components/base/basicEventHeap.h
-
47lib/components/base/basicFunctionality.cpp
-
102lib/components/base/basicPosition.cpp
-
62lib/components/base/basicPosition.h
-
160lib/components/object/objectSystemAnchor.cpp
-
4lib/components/object/objectSystemAnchor.h
-
2lib/data/net/netClientHandler.h
-
2lib/data/net/netServer.h
-
65lib/data/protocol/protocolKAFKA.cpp
-
5lib/data/protocol/protocolKAFKA.h
-
49lib/hardware/sensors/lrf/lrf_3d.cpp
-
3lib/hardware/sensors/lrf/lrf_3d.h
-
247lib/rgoose/rgooseCamera.cpp
-
12lib/rgoose/rgooseCamera.h
-
333lib/rgoose/rgooseDBConnector.cpp
-
88lib/rgoose/rgooseDBConnector.h
-
71lib/rgoose/rgooseIPCamera.cpp
-
34lib/rgoose/rgooseIPCamera.h
-
263lib/rgoose/rgooseKafkaModule.cpp
-
10lib/rgoose/rgooseKafkaModule.h
-
187lib/rgoose/rgooseKernel.cpp
-
16lib/rgoose/rgooseKernel.h
-
2lib/rgoose/rgooseModule.h
-
1lib/rgoose/rgooseNode.h
-
8lib/rgoose/rgooseNode2D.cpp
-
14lib/rgoose/rgooseNode2D.h
-
37lib/rgoose/rgooseNode3D.cpp
-
3lib/rgoose/rgooseNode3D.h
-
64lib/rgoose/rgooseNodeFactory.cpp
-
41lib/rgoose/rgoosePelcoCamera.cpp
-
48lib/rgoose/rgoosePelcoCamera.h
-
2lib/rgoose/rgooseServerModule.cpp
-
2lib/rgoose/rgooseServerModule.h
-
2lib/rgoose/rgooseUSBRelayModule.cpp
-
2lib/rgoose/rgooseUSBRelayModule.h
@ -0,0 +1,169 @@ |
|||
/*******************************************************************************************
|
|||
* |
|||
* raylib [textures] example - Image processing |
|||
* |
|||
* NOTE: Images are loaded in CPU memory (RAM); textures are loaded in GPU memory (VRAM) |
|||
* |
|||
* This example has been created using raylib 3.5 (www.raylib.com) |
|||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) |
|||
* |
|||
* Copyright (c) 2016 Ramon Santamaria (@raysan5) |
|||
* |
|||
********************************************************************************************/ |
|||
|
|||
#include "raylib.h"
|
|||
|
|||
#include <stdlib.h> // Required for: free()
|
|||
|
|||
#define NUM_PROCESSES 8
|
|||
|
|||
typedef enum { |
|||
NONE = 0, |
|||
COLOR_GRAYSCALE, |
|||
COLOR_TINT, |
|||
COLOR_INVERT, |
|||
COLOR_CONTRAST, |
|||
COLOR_BRIGHTNESS, |
|||
FLIP_VERTICAL, |
|||
FLIP_HORIZONTAL |
|||
} ImageProcess; |
|||
|
|||
static const char *processText[] = { |
|||
"NO PROCESSING", |
|||
"COLOR GRAYSCALE", |
|||
"COLOR TINT", |
|||
"COLOR INVERT", |
|||
"COLOR CONTRAST", |
|||
"COLOR BRIGHTNESS", |
|||
"FLIP VERTICAL", |
|||
"FLIP HORIZONTAL" |
|||
}; |
|||
|
|||
int main(void) |
|||
{ |
|||
// Initialization
|
|||
//--------------------------------------------------------------------------------------
|
|||
const int screenWidth = 800; |
|||
const int screenHeight = 450; |
|||
|
|||
InitWindow(screenWidth, screenHeight, "raylib [textures] example - image processing"); |
|||
|
|||
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
|
|||
|
|||
Image imOrigin = LoadImage("resources/parrots.png"); // Loaded in CPU memory (RAM)
|
|||
ImageFormat(&imOrigin, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8); // Format image to RGBA 32bit (required for texture update) <-- ISSUE
|
|||
Texture2D texture = LoadTextureFromImage(imOrigin); // Image converted to texture, GPU memory (VRAM)
|
|||
|
|||
Image imCopy = ImageCopy(imOrigin); |
|||
|
|||
int currentProcess = NONE; |
|||
bool textureReload = false; |
|||
|
|||
Rectangle toggleRecs[NUM_PROCESSES] = { 0 }; |
|||
int mouseHoverRec = -1; |
|||
|
|||
for (int i = 0; i < NUM_PROCESSES; i++) toggleRecs[i] = (Rectangle){ 40.0f, (float)(50 + 32*i), 150.0f, 30.0f }; |
|||
|
|||
SetTargetFPS(60); |
|||
//---------------------------------------------------------------------------------------
|
|||
|
|||
// Main game loop
|
|||
while (!WindowShouldClose()) // Detect window close button or ESC key
|
|||
{ |
|||
// Update
|
|||
//----------------------------------------------------------------------------------
|
|||
|
|||
// Mouse toggle group logic
|
|||
for (int i = 0; i < NUM_PROCESSES; i++) |
|||
{ |
|||
if (CheckCollisionPointRec(GetMousePosition(), toggleRecs[i])) |
|||
{ |
|||
mouseHoverRec = i; |
|||
|
|||
if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT)) |
|||
{ |
|||
currentProcess = i; |
|||
textureReload = true; |
|||
} |
|||
break; |
|||
} |
|||
else mouseHoverRec = -1; |
|||
} |
|||
|
|||
// Keyboard toggle group logic
|
|||
if (IsKeyPressed(KEY_DOWN)) |
|||
{ |
|||
currentProcess++; |
|||
if (currentProcess > (NUM_PROCESSES - 1)) currentProcess = 0; |
|||
textureReload = true; |
|||
} |
|||
else if (IsKeyPressed(KEY_UP)) |
|||
{ |
|||
currentProcess--; |
|||
if (currentProcess < 0) currentProcess = 7; |
|||
textureReload = true; |
|||
} |
|||
|
|||
// Reload texture when required
|
|||
if (textureReload) |
|||
{ |
|||
UnloadImage(imCopy); // Unload image-copy data
|
|||
imCopy = ImageCopy(imOrigin); // Restore image-copy from image-origin
|
|||
|
|||
// NOTE: Image processing is a costly CPU process to be done every frame,
|
|||
// If image processing is required in a frame-basis, it should be done
|
|||
// with a texture and by shaders
|
|||
switch (currentProcess) |
|||
{ |
|||
case COLOR_GRAYSCALE: ImageColorGrayscale(&imCopy); break; |
|||
case COLOR_TINT: ImageColorTint(&imCopy, GREEN); break; |
|||
case COLOR_INVERT: ImageColorInvert(&imCopy); break; |
|||
case COLOR_CONTRAST: ImageColorContrast(&imCopy, -40); break; |
|||
case COLOR_BRIGHTNESS: ImageColorBrightness(&imCopy, -80); break; |
|||
case FLIP_VERTICAL: ImageFlipVertical(&imCopy); break; |
|||
case FLIP_HORIZONTAL: ImageFlipHorizontal(&imCopy); break; |
|||
default: break; |
|||
} |
|||
|
|||
Color *pixels = LoadImageColors(imCopy); // Load pixel data from image (RGBA 32bit)
|
|||
UpdateTexture(texture, pixels); // Update texture with new image data
|
|||
UnloadImageColors(pixels); // Unload pixels data from RAM
|
|||
|
|||
textureReload = false; |
|||
} |
|||
//----------------------------------------------------------------------------------
|
|||
|
|||
// Draw
|
|||
//----------------------------------------------------------------------------------
|
|||
BeginDrawing(); |
|||
|
|||
ClearBackground(RAYWHITE); |
|||
|
|||
DrawText("IMAGE PROCESSING:", 40, 30, 10, DARKGRAY); |
|||
|
|||
// Draw rectangles
|
|||
for (int i = 0; i < NUM_PROCESSES; i++) |
|||
{ |
|||
DrawRectangleRec(toggleRecs[i], ((i == currentProcess) || (i == mouseHoverRec)) ? SKYBLUE : LIGHTGRAY); |
|||
DrawRectangleLines((int)toggleRecs[i].x, (int) toggleRecs[i].y, (int) toggleRecs[i].width, (int) toggleRecs[i].height, ((i == currentProcess) || (i == mouseHoverRec)) ? BLUE : GRAY); |
|||
DrawText( processText[i], (int)( toggleRecs[i].x + toggleRecs[i].width/2 - MeasureText(processText[i], 10)/2), (int) toggleRecs[i].y + 11, 10, ((i == currentProcess) || (i == mouseHoverRec)) ? DARKBLUE : DARKGRAY); |
|||
} |
|||
|
|||
DrawTexture(texture, screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, WHITE); |
|||
DrawRectangleLines(screenWidth - texture.width - 60, screenHeight/2 - texture.height/2, texture.width, texture.height, BLACK); |
|||
|
|||
EndDrawing(); |
|||
//----------------------------------------------------------------------------------
|
|||
} |
|||
|
|||
// De-Initialization
|
|||
//--------------------------------------------------------------------------------------
|
|||
UnloadTexture(texture); // Unload texture from VRAM
|
|||
UnloadImage(imOrigin); // Unload image-origin from RAM
|
|||
UnloadImage(imCopy); // Unload image-copy from RAM
|
|||
|
|||
CloseWindow(); // Close window and OpenGL context
|
|||
//--------------------------------------------------------------------------------------
|
|||
|
|||
return 0; |
|||
} |
|||
@ -0,0 +1,75 @@ |
|||
#include <SDL2/SDL.h>
|
|||
#include <vector>
|
|||
|
|||
int main(){ |
|||
int nVDrvNumber = 0; |
|||
//if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
|
|||
// printf( "SDL_Init Error: %s \n", SDL_GetError() );
|
|||
// return EXIT_FAILURE;
|
|||
//}
|
|||
SDL_Init( 0 ); |
|||
|
|||
std::vector< bool > drivers( SDL_GetNumVideoDrivers() ); |
|||
|
|||
for( int i = 0; i < drivers.size(); ++i ){ |
|||
drivers[ i ] = ( 0 == SDL_VideoInit( SDL_GetVideoDriver( i ) ) ); |
|||
SDL_VideoQuit(); |
|||
}; |
|||
|
|||
printf( "SDL_VIDEODRIVER usable: " ); |
|||
for( int i = 0; i < drivers.size(); ++i ){ |
|||
if( !drivers[ i ] ) continue; |
|||
printf( " %s", SDL_GetVideoDriver( i ) ); |
|||
}; |
|||
printf( "\n" ); |
|||
|
|||
nVDrvNumber = SDL_GetNumVideoDrivers(); |
|||
printf( "Number of Video Drivers: %d\n", nVDrvNumber ); |
|||
if( nVDrvNumber ){ |
|||
for( int j = 0; j < nVDrvNumber; j++ ){ |
|||
printf( "Driver[%d]:%s\n", j, SDL_GetVideoDriver( j ) ); |
|||
}; |
|||
}; |
|||
|
|||
if (SDL_GL_ExtensionSupported("GL_EXT_framebuffer_blit")) { |
|||
printf( "Use Blit\n" ); |
|||
//draw_to_the_screen_with_framebuffer_blit(); // faster!
|
|||
} else { |
|||
printf( "No Blit!\n" ); |
|||
//draw_to_the_screen_with_a_textured_quad(); // slower!
|
|||
}; |
|||
|
|||
|
|||
if( SDL_VideoInit("directfb") != 0 ){ |
|||
printf("Error initializing SDL video: %s\n", SDL_GetError()); |
|||
return 2; |
|||
}; |
|||
|
|||
static int display_in_use = 0; /* Only using first display */ |
|||
|
|||
int i, display_mode_count; |
|||
SDL_DisplayMode mode; |
|||
Uint32 f; |
|||
|
|||
SDL_Log("SDL_GetNumVideoDisplays(): %i", SDL_GetNumVideoDisplays()); |
|||
|
|||
display_mode_count = SDL_GetNumDisplayModes(display_in_use); |
|||
if (display_mode_count < 1) { |
|||
SDL_Log("SDL_GetNumDisplayModes failed: %s", SDL_GetError()); |
|||
return 1; |
|||
} |
|||
SDL_Log("SDL_GetNumDisplayModes: %i", display_mode_count); |
|||
|
|||
for (i = 0; i < display_mode_count; ++i) { |
|||
if (SDL_GetDisplayMode(display_in_use, i, &mode) != 0) { |
|||
SDL_Log("SDL_GetDisplayMode failed: %s", SDL_GetError()); |
|||
return 1; |
|||
} |
|||
f = mode.format; |
|||
|
|||
SDL_Log("Mode %i\tbpp %i\t%s\t%i x %i", i, |
|||
SDL_BITSPERPIXEL(f), SDL_GetPixelFormatName(f), mode.w, mode.h); |
|||
} |
|||
SDL_Quit(); |
|||
return 0; |
|||
}; |
|||
Binary file not shown.
@ -0,0 +1,2 @@ |
|||
g++ ./custom_sdl.cpp -o popo `pkg-config --cflags --libs sdl2` |
|||
#g++ ./custom_raylib.cpp -o popo -lGL -L/opt/vc/lib `pkg-config --cflags --libs bcm_host brcmegl raylib` |
|||
@ -0,0 +1 @@ |
|||
./popo --dfb:pixelformat=ARGB,system=fbdev,depth=16,mode=480x320 |
|||
@ -0,0 +1,8 @@ |
|||
#include "rgooseNode2D.h"
|
|||
|
|||
ARGUS_2DSensor::ARGUS_2DSensor( uint32_t id ):argusNetNode(id){ |
|||
}; |
|||
|
|||
ARGUS_2DSensor::~ARGUS_2DSensor(){ |
|||
}; |
|||
|
|||
@ -0,0 +1,41 @@ |
|||
#include "rgoosePelcoCamera.h"
|
|||
|
|||
#define LOG( X ) m_pLog->Log( "PELCO_PCAM", this, X )
|
|||
#define LOG_ERROR( X ) m_pLog->Log( "PELCO_PCAM", this, _LOG_ERROR, X )
|
|||
|
|||
ARGUS_PELCOCAM::ARGUS_PELCOCAM( uint32_t id ): ARGUS_Camera( id ){ |
|||
m_pLog = basicLogCollection::getInstance(); |
|||
}; |
|||
|
|||
ARGUS_PELCOCAM::~ARGUS_PELCOCAM(){ |
|||
}; |
|||
|
|||
bool ARGUS_PELCOCAM::startService(){ |
|||
return false; |
|||
}; |
|||
|
|||
bool ARGUS_PELCOCAM::relativeMove( float PanSPD, float TiltSPD, float ZoomSPD ){ |
|||
if( m_sCamData.online ) { |
|||
//if( m_pOnVif->ptz_ContinuousMove( m_pProfile->profiletoken, PanSPD , TiltSPD ) ){
|
|||
// return m_pOnVif->ptz_ContinuousMoveZoom( m_pProfile->profiletoken, ZoomSPD );
|
|||
//};
|
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
bool ARGUS_PELCOCAM::relativeStop(){ |
|||
if( m_sCamData.online ) { |
|||
//return m_pOnVif->ptz_Stop( m_pProfile->profiletoken, true, true );
|
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
bool ARGUS_PELCOCAM::absoluteMove( float PanPOS, float TiltPOS, float ZoomPOS ){ |
|||
if( m_sCamData.online ) { |
|||
//return m_pOnVif->ptz_AbsoluteMove( m_pProfile->profiletoken, PanPOS, TiltPOS, ZoomPOS );
|
|||
}; |
|||
return false; |
|||
}; |
|||
|
|||
#undef LOG
|
|||
#undef LOG_ERROR
|
|||
@ -0,0 +1,48 @@ |
|||
//---------------------------------------------------------------------------- |
|||
// Dr.Frucht Systems Ltd. |
|||
// Copyright © 2000-2017. All Rights Reserved. |
|||
// Version 2.0 6/11/2019 |
|||
// Last modification: 6/11/2019 |
|||
// PROJECT: |
|||
// SUBSYSTEM: |
|||
// FILE: rgooseIPCamera.h |
|||
// AUTHOR: gagua |
|||
// OVERVIEW |
|||
// ~~~~~~~~ |
|||
// Header file of rgooseIPCamera.h |
|||
//---------------------------------------------------------------------------- |
|||
// |
|||
#ifndef __ARGUS_PELCO_CAMERA_HEADER__ |
|||
#define __ARGUS_PELCO_CAMERA_HEADER__ |
|||
|
|||
#include <vector> |
|||
#include "rgooseCamera.h" |
|||
//#include "../components/base/basicThread.h" |
|||
//#include "../data/ponvif/ponvif.h" |
|||
|
|||
//https://www.ebay.com/itm/Professional-Rolling-Makeup-Case-Bulb-Mirror-Cosmetic-Artist-Dressing-Train-Case/233264525474 |
|||
|
|||
//ffmpeg -i input.mp4 -af loudnorm=I=-23:LRA=7:tp=-2:print_format=json -f null - |
|||
//ffmpeg -i input.mp4 -af loudnorm=I=-23:LRA=7:tp=-2:measured_I=-30:measured_LRA=1.1:measured_tp=-11 04:measured_thresh=-40.21:offset=-0.47 -ar 48k -y output.mp4 |
|||
|
|||
|
|||
class ARGUS_PELCOCAM: public ARGUS_Camera /*, public basicThread */{ |
|||
private: |
|||
basicLogCollection * m_pLog; |
|||
//videoSourceProfile * m_pProfile; |
|||
protected: |
|||
virtual bool relativeMove( float PanSPD, float TiltSPD, float ZoomSPD ); |
|||
virtual bool relativeStop(); |
|||
virtual bool absoluteMove( float PanPOS, float TiltPOS, float ZoomPOS ); |
|||
//void m_fThreadProc( void ); |
|||
public: |
|||
explicit ARGUS_PELCOCAM( uint32_t id ); |
|||
~ARGUS_PELCOCAM(); |
|||
//bool create( );// CSTR ip, CSTR username, CSTR password ); |
|||
//virtual void dispatchEvent( EVENT_CONTAINER *Evt ); |
|||
virtual bool startService(); |
|||
//virtual bool stopService(); |
|||
|
|||
}; |
|||
|
|||
#endif |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue