├── logo.icns
├── addons.make
├── bin
└── data
│ ├── settings
│ ├── brushes
│ │ └── brush.png
│ ├── media
│ │ └── warp
│ │ │ └── grid-2k.png
│ └── shaders
│ │ ├── hap.vert
│ │ ├── vdome.vert
│ │ ├── hap.frag
│ │ └── vdome.frag
│ └── settings.xml
├── src
├── vdome
│ ├── input
│ │ ├── spout
│ │ │ ├── SpoutSDK
│ │ │ │ ├── SpoutGLDXinterop.cpp
│ │ │ │ ├── readme.txt
│ │ │ │ ├── Spout.h
│ │ │ │ ├── SpoutCommon.h
│ │ │ │ ├── SpoutSharedMemory.h
│ │ │ │ ├── SpoutSender.h
│ │ │ │ ├── SpoutReceiver.h
│ │ │ │ ├── SpoutDirectX.h
│ │ │ │ ├── SpoutMemoryShare.h
│ │ │ │ ├── SpoutSharedMemory.cpp
│ │ │ │ ├── SpoutSender.cpp
│ │ │ │ ├── SpoutReceiver.cpp
│ │ │ │ ├── SpoutSenderNames.h
│ │ │ │ ├── SpoutGLDXinterop.h
│ │ │ │ └── SpoutSDK.h
│ │ │ ├── spoutR.h
│ │ │ └── spoutR.cpp
│ │ ├── media
│ │ │ ├── image.h
│ │ │ ├── image.cpp
│ │ │ ├── video
│ │ │ │ ├── videoDS.h
│ │ │ │ ├── videoWin.h
│ │ │ │ ├── videoWMF.h
│ │ │ │ ├── videoWMF.cpp
│ │ │ │ └── videoWin.cpp
│ │ │ ├── video.h
│ │ │ ├── media.h
│ │ │ ├── video.cpp
│ │ │ └── media.cpp
│ │ ├── color.h
│ │ ├── capture.h
│ │ ├── color.cpp
│ │ ├── capture.cpp
│ │ ├── input.h
│ │ └── input.cpp
│ ├── menu
│ │ ├── command.h
│ │ ├── socket.h
│ │ ├── saveThread.h
│ │ ├── command.cpp
│ │ ├── menu.h
│ │ ├── socket.cpp
│ │ └── commands.h
│ ├── renderer
│ │ ├── projector
│ │ │ ├── curves.h
│ │ │ ├── mask.h
│ │ │ ├── plane.h
│ │ │ ├── cornerpin.h
│ │ │ ├── projector.h
│ │ │ ├── curves.cpp
│ │ │ ├── mask.cpp
│ │ │ └── plane.cpp
│ │ ├── model.h
│ │ ├── window.h
│ │ ├── model.cpp
│ │ └── window.cpp
│ └── vdome.h
└── main.cpp
├── vDome.xcodeproj
├── project.xcworkspace
│ └── contents.xcworkspacedata
├── xcuserdata
│ └── Charles.xcuserdatad
│ │ └── xcschemes
│ │ └── xcschememanagement.plist
└── xcshareddata
│ └── xcschemes
│ ├── vdome Debug.xcscheme
│ └── vdome Release.xcscheme
├── icon.rc
├── Makefile
├── vDome.workspace
├── .gitignore
├── vDome.user
├── Project.xcconfig
├── openFrameworks-Info.plist
├── vDome.vcxproj.user
├── vDome.sln
├── README.md
└── config.make
/logo.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/charlesveasey/vDome/HEAD/logo.icns
--------------------------------------------------------------------------------
/addons.make:
--------------------------------------------------------------------------------
1 | ofxBezierSurface
2 | ofxCurvesTool
3 | ofxOpenCv
4 | ofxOsc
5 | ofxWMFVideoPlayer
6 |
--------------------------------------------------------------------------------
/bin/data/settings/brushes/brush.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/charlesveasey/vDome/HEAD/bin/data/settings/brushes/brush.png
--------------------------------------------------------------------------------
/bin/data/settings/media/warp/grid-2k.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/charlesveasey/vDome/HEAD/bin/data/settings/media/warp/grid-2k.png
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutGLDXinterop.cpp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/charlesveasey/vDome/HEAD/src/vdome/input/spout/SpoutSDK/SpoutGLDXinterop.cpp
--------------------------------------------------------------------------------
/vDome.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/bin/data/settings/shaders/hap.vert:
--------------------------------------------------------------------------------
1 | #version 150
2 | uniform mat4 modelViewProjectionMatrix;
3 | in vec4 position;
4 | in vec2 texcoord;
5 | out vec2 vtexcoord;
6 | void main(){
7 | gl_Position = modelViewProjectionMatrix * position;
8 | vtexcoord = texcoord;
9 | }
--------------------------------------------------------------------------------
/icon.rc:
--------------------------------------------------------------------------------
1 | // Icon Resource Definition
2 | #define MAIN_ICON 102
3 |
4 | #if defined(_DEBUG)
5 | MAIN_ICON ICON "icon_debug.ico"
6 | #else
7 | MAIN_ICON ICON "icon.ico"
8 | #endif
9 |
--------------------------------------------------------------------------------
/bin/data/settings/shaders/vdome.vert:
--------------------------------------------------------------------------------
1 | #version 150
2 |
3 | uniform mat4 modelViewProjectionMatrix;
4 |
5 | in vec4 position;
6 | in vec2 texcoord;
7 |
8 | out vec2 vtexcoord;
9 |
10 | void main() {
11 | gl_Position = modelViewProjectionMatrix * position;
12 | vtexcoord = texcoord;
13 | }
--------------------------------------------------------------------------------
/Makefile:
--------------------------------------------------------------------------------
1 | # Attempt to load a config.make file.
2 | # If none is found, project defaults in config.project.make will be used.
3 | ifneq ($(wildcard config.make),)
4 | include config.make
5 | endif
6 |
7 | # make sure the the OF_ROOT location is defined
8 | ifndef OF_ROOT
9 | OF_ROOT=../../..
10 | endif
11 |
12 | # call the project makefile!
13 | include $(OF_ROOT)/libs/openFrameworksCompiled/project/makefileCommon/compile.project.mk
14 |
--------------------------------------------------------------------------------
/vDome.workspace:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/vdome/input/media/image.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | namespace vd{
4 |
5 | class Image {
6 |
7 | public:
8 | Image();
9 |
10 | void open(string filepath);
11 | void close();
12 | bool isLoaded();
13 | float getWidth();
14 | float getHeight();
15 |
16 | void bind();
17 | void unbind();
18 |
19 | ofPixels& getPixels();
20 |
21 | private:
22 | bool bLoaded;
23 | ofImage img;
24 | };
25 | }
--------------------------------------------------------------------------------
/src/vdome/input/color.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | namespace vd{
4 |
5 | class Color {
6 |
7 | public:
8 | Color();
9 | void setup();
10 | void fill(int r, int g, int b);
11 | void fillBlack();
12 | void fillWhite();
13 | void fillGrey();
14 | void close();
15 | void setResolution(int r);
16 | void bind();
17 | void unbind();
18 |
19 | ofPixels& getPixels();
20 |
21 | private:
22 | ofImage image;
23 | int resolution;
24 | };
25 | }
--------------------------------------------------------------------------------
/bin/data/settings/shaders/hap.frag:
--------------------------------------------------------------------------------
1 | #version 150
2 | in vec2 vtexcoord;
3 | out vec4 outputColor;
4 | uniform sampler2D cocgsy_src;
5 | const vec4 offsets = vec4(-0.50196078431373, -0.50196078431373, 0.0, 0.0);
6 |
7 | void main()
8 | {
9 | vec4 CoCgSY = texture(cocgsy_src, vtexcoord);
10 |
11 | CoCgSY += offsets;
12 | float scale = ( CoCgSY.z * ( 255.0 / 8.0 ) ) + 1.0;
13 | float Co = CoCgSY.x / scale;
14 | float Cg = CoCgSY.y / scale;
15 | float Y = CoCgSY.w;
16 | vec4 rgba = vec4(Y + Co - Cg, Y + Cg, Y - Co - Cg, 1.0);
17 | outputColor = rgba;
18 | }
--------------------------------------------------------------------------------
/src/main.cpp:
--------------------------------------------------------------------------------
1 | #include "ofMain.h"
2 | #include "vdome.h"
3 |
4 | //#define VDOME_DEBUG // define for debug console
5 |
6 | int main( ){
7 |
8 | #ifdef VDOME_DEBUG
9 | ofSetLogLevel(OF_LOG_VERBOSE);
10 | #else
11 | ofSetLogLevel(OF_LOG_SILENT);
12 | #endif
13 |
14 | // hide console window
15 | #ifdef TARGET_WIN32
16 | #ifndef VDOME_DEBUG
17 | HWND handleWindow;
18 | AllocConsole();
19 | handleWindow = FindWindowA("ConsoleWindowClass", NULL);
20 | ShowWindow(handleWindow, 0);
21 | #endif
22 | #endif
23 |
24 | vd::vdome vdome;
25 | vdome.setup();
26 | }
27 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/spoutR.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include ".\SpoutSDK\Spout.h" // Spout SDK
4 |
5 | class SpoutR {
6 |
7 | public:
8 | void setup();
9 | void update();
10 | void bind();
11 | void unbind();
12 | void exit();
13 |
14 | SpoutReceiver *spoutreceiver; // A Spout receiver object
15 | bool bInitialized; // Initialization result
16 | ofTexture texture; // Texture used for texture share transfers
17 | char SenderName[256]; // Sender name used by a receiver
18 | int g_Width, g_Height; // Used for checking sender size change
19 | };
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Files
2 | *.slo
3 | *.lo
4 | *.o
5 | *.so
6 | *.dylib
7 | *.lai
8 | *.la
9 | *.a
10 | *.suo
11 | *.sdf
12 | *.xcuserstate
13 | *.plist
14 | *.xcbkptlist
15 | *.DS_Store
16 | *.gitkeep
17 | *.dll
18 | *.ilk
19 | *.lib
20 | *.pdb
21 | *.exe
22 | *.opensdf
23 | *.exp
24 | *.xccheckout
25 | *.xcsettings
26 | *.ply
27 | *.layout
28 |
29 | # Bin
30 | vDome.app
31 | vDomeDebug.app
32 | vDome.exe
33 | vDome_debug.exe
34 | vDome_debug.exp
35 | bin/vDome
36 |
37 | # Folders
38 | obj/
39 | bin/data/media/video
40 | bin/data/settings/masks
41 | bin/data/settings/warp
42 | bin/data/settings/color
43 | vdome.xcodeproj/xcuserdata
44 | bin/vDome_debug
45 |
--------------------------------------------------------------------------------
/src/vdome/input/capture.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofVideoGrabber.h"
3 | namespace vd{
4 | class Capture {
5 |
6 | public:
7 | Capture();
8 | void open();
9 | void update();
10 | void play();
11 | void stop();
12 | void close();
13 | bool isOpen();
14 | void setResolution(int r);
15 | void setFramerate(int frate);
16 | float getRealWidth();
17 | float getRealHeight();
18 |
19 | ofPixels & getPixels();
20 |
21 | void bind();
22 | void unbind();
23 |
24 | private:
25 | ofVideoGrabber grabber;
26 | int resolution;
27 | };
28 | }
--------------------------------------------------------------------------------
/vDome.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(ProjectDir)/bin
5 | WindowsLocalDebugger
6 |
7 |
8 | $(ProjectDir)/bin
9 | WindowsLocalDebugger
10 |
11 |
--------------------------------------------------------------------------------
/bin/data/settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Project.xcconfig:
--------------------------------------------------------------------------------
1 | //THE PATH TO THE ROOT OF OUR OF PATH RELATIVE TO THIS PROJECT.
2 | //THIS NEEDS TO BE DEFINED BEFORE CoreOF.xcconfig IS INCLUDED
3 | OF_PATH = ../../..
4 |
5 | //THIS HAS ALL THE HEADER AND LIBS FOR OF CORE
6 | #include "../../../libs/openFrameworksCompiled/project/osx/CoreOF.xcconfig"
7 |
8 | //ICONS - NEW IN 0072
9 | ICON_NAME_DEBUG = icon-debug.icns
10 | ICON_NAME_RELEASE = icon.icns
11 | ICON_FILE_PATH = $(OF_PATH)/libs/openFrameworksCompiled/project/osx/
12 |
13 | //IF YOU WANT AN APP TO HAVE A CUSTOM ICON - PUT THEM IN YOUR DATA FOLDER AND CHANGE ICON_FILE_PATH to:
14 | //ICON_FILE_PATH = bin/data/
15 |
16 | OTHER_LDFLAGS = $(OF_CORE_LIBS) $(OF_CORE_FRAMEWORKS)
17 | HEADER_SEARCH_PATHS = $(OF_CORE_HEADERS)
18 |
--------------------------------------------------------------------------------
/src/vdome/menu/command.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 | #include
4 | using namespace std;
5 | namespace vd {
6 |
7 | class Command {
8 | public:
9 | virtual ~Command();
10 | virtual void execute() = 0;
11 | virtual void undo() = 0;
12 | virtual void redo() = 0;
13 | };
14 |
15 | class CommandHistory {
16 | public :
17 | CommandHistory();
18 | ~CommandHistory();
19 |
20 | void execute(Command* command);
21 | void undo();
22 | void redo();
23 | int getIndex();
24 | int getLastCommand();
25 | int getSize();
26 |
27 | private :
28 | vector history;
29 |
30 | int index;
31 | int lastCommand; // 0 = exec, 1 = undo, 2 = redo
32 | };
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/openFrameworks-Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | ${EXECUTABLE_NAME}
9 | CFBundleIdentifier
10 | cc.openFrameworks.ofapp
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundlePackageType
14 | APPL
15 | CFBundleSignature
16 | ????
17 | CFBundleVersion
18 | 1.0
19 | CFBundleIconFile
20 | ${ICON}
21 |
22 |
23 |
--------------------------------------------------------------------------------
/src/vdome/input/media/image.cpp:
--------------------------------------------------------------------------------
1 | #include "image.h"
2 | using namespace vd;
3 |
4 | Image::Image() {
5 | bLoaded = false;
6 | }
7 |
8 | void Image::open(string filepath){
9 | img.clear();
10 | bLoaded = img.load(filepath);
11 | }
12 |
13 | void Image::close(){
14 | img.clear();
15 | bLoaded = false;
16 | }
17 |
18 | bool Image::isLoaded(){
19 | return bLoaded;
20 | }
21 |
22 | float Image::getWidth(){
23 | return img.getWidth();
24 | }
25 |
26 | float Image::getHeight(){
27 | return img.getHeight();
28 | }
29 |
30 | ofPixels& Image::getPixels(){
31 | return img.getPixels();
32 | }
33 |
34 | void Image::bind(){
35 | img.getTexture().setTextureWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_BORDER);
36 | img.getTexture().bind();
37 | }
38 |
39 | void Image::unbind() {
40 | img.getTexture().unbind();
41 | }
--------------------------------------------------------------------------------
/src/vdome/input/media/video/videoDS.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofVideoPlayer.h"
3 | namespace vd {
4 |
5 | class Video {
6 |
7 | public:
8 | Video();
9 |
10 | bool open(string filepath);
11 | void update();
12 |
13 | void play();
14 | void stop();
15 | void close();
16 | void seek(float f);
17 |
18 | bool isPlaying();
19 | bool isLoaded();
20 | void setLoop(bool lp);
21 | float getPosition();
22 | float getDuration();
23 | bool getIsMovieDone();
24 | void setVolume(float v);
25 | float getWidth();
26 | float getHeight();
27 |
28 | ofVideoPlayer player;
29 | ofPixels pixels;
30 | ofEvent endEvent;
31 | ofPixels& getPixels();
32 | ofTexture& getTexture();
33 |
34 | private:
35 | bool bEnded;
36 | ofLoopType loopT;
37 | };
38 | }
--------------------------------------------------------------------------------
/src/vdome/input/media/video.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofVideoPlayer.h"
3 | namespace vd{
4 |
5 | class Video{
6 |
7 | public:
8 | Video();
9 |
10 | bool open(string filepath);
11 | void update();
12 |
13 | void play();
14 | void stop();
15 | void close();
16 | void seek(float f);
17 |
18 | bool isPlaying();
19 | bool isLoaded();
20 | void setLoop(bool lp);
21 | float getPosition();
22 | float getDuration();
23 | bool getIsMovieDone();
24 | void setVolume(float v);
25 | float getWidth();
26 | float getHeight();
27 |
28 | void bind();
29 | void unbind();
30 |
31 | ofEvent endEvent;
32 | ofPixels& getPixels();
33 |
34 | private:
35 | ofVideoPlayer player;
36 | bool bEnded;
37 | ofLoopType loopT;
38 | };
39 | }
--------------------------------------------------------------------------------
/src/vdome/menu/socket.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include "ofxOsc.h"
4 | #include "input.h"
5 | #include "model.h"
6 | namespace vd {
7 | class Input;
8 | class Model;
9 |
10 | class Socket {
11 |
12 | public:
13 | Socket();
14 | void setup();
15 | void update();
16 | void sendDuration();
17 | void sendEnd();
18 | void loadXML(ofXml &xml);
19 | void saveXML(ofXml &xml);
20 |
21 | string host;
22 | int send;
23 | int receive;
24 | bool enabled;
25 | Input *input;
26 | Model *model;
27 |
28 | static ofEvent sourceEvent;
29 | static ofEvent formatEvent;
30 |
31 | private:
32 | ofxOscSender oscSender;
33 | ofxOscReceiver oscReceiver;
34 | ofxOscMessage sMsg;
35 | ofxOscMessage rMsg;
36 |
37 | float lastInputPosition;
38 | };
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/src/vdome/menu/saveThread.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 |
4 | class SaveThread : public ofThread{
5 |
6 | public:
7 | SaveThread(){
8 | saved = false;
9 | }
10 |
11 | void save(){
12 | saved = false;
13 | startThread();
14 | }
15 |
16 | void threadedFunction(){
17 | while( isThreadRunning() != 0 ){
18 | if( lock() ){
19 | for (int i=0; i save(files[i]);
21 | }
22 | for (int i=0; i save(imageFiles[i]);
24 | }
25 | saved = true;
26 | unlock();
27 | stopThread();
28 | }
29 | }
30 | }
31 |
32 | bool saved;
33 | vector xml;
34 | vector files;
35 | vector image;
36 | vector imageFiles;
37 | };
38 |
--------------------------------------------------------------------------------
/src/vdome/input/color.cpp:
--------------------------------------------------------------------------------
1 | #include "color.h"
2 | using namespace vd;
3 |
4 | Color::Color() {
5 | resolution = 2048;
6 | }
7 |
8 | void Color::setup(){
9 | image.setUseTexture(true);
10 | image.allocate(resolution, resolution, OF_IMAGE_COLOR);
11 | }
12 |
13 | void Color::fill(int r, int g, int b){
14 | image.setColor(ofColor(r,g,b));
15 | image.update();
16 | }
17 |
18 | void Color::fillBlack(){
19 | fill(0,0,0);
20 | }
21 |
22 | void Color::fillWhite(){
23 | fill(255,255,255);
24 | }
25 |
26 | void Color::fillGrey(){
27 | fill(127,127,127);
28 | }
29 |
30 | void Color::close(){
31 | image.clear();
32 | }
33 |
34 | void Color::setResolution(int r){
35 | resolution = r;
36 | }
37 |
38 | void Color::bind() {
39 | image.getTexture().setTextureWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_BORDER);
40 | image.getTexture().bind();
41 | }
42 |
43 | void Color::unbind() {
44 | image.getTexture().unbind();
45 | }
46 |
47 | ofPixels & Color::getPixels(){
48 | return image.getPixels();
49 | }
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/src/vdome/input/media/video/videoWin.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "videoWMF.h"
3 | #include "../video.h"
4 | namespace vd{
5 |
6 | class VideoWin {
7 |
8 | public:
9 | VideoWin();
10 |
11 | void open(string filepath);
12 | void update();
13 | void play();
14 | void stop();
15 | void close();
16 | void seek(float f);
17 | bool isPlaying();
18 | void setLoop(bool lp);
19 | float getPosition();
20 | float getDuration();
21 | bool getIsMovieDone();
22 | void setVolume(float v);
23 | bool isLoaded();
24 | float getWidth();
25 | float getHeight();
26 |
27 | void bind();
28 | void unbind();
29 |
30 | ofPixels& getPixels();
31 |
32 | enum VideoTypes {WMF,DS};
33 | string forceVideoRenderer;
34 | ofEvent endEvent;
35 |
36 | private:
37 | VideoTypes parseForceRenderer(string renderer);
38 | VideoTypes vType;
39 |
40 | VideoWMF vWMF;
41 | Video vDS;
42 |
43 | bool bLoop;
44 | bool bEnd;
45 | string fPath;
46 | bool bLoaded;
47 | };
48 | }
--------------------------------------------------------------------------------
/vDome.xcodeproj/xcuserdata/Charles.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | vDome Debug.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | vDome Release.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 2
16 |
17 | vdome Debug.xcscheme_^#shared#^_
18 |
19 | orderHint
20 | 0
21 |
22 | vdome Release.xcscheme_^#shared#^_
23 |
24 | orderHint
25 | 1
26 |
27 |
28 | SuppressBuildableAutocreation
29 |
30 | E4B69B5A0A3A1756003C02F2
31 |
32 | primary
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/vdome/input/media/video/videoWMF.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofxWMFVideoPlayer.h"
3 | namespace vd{
4 |
5 | class VideoWMF{
6 |
7 | public:
8 | VideoWMF();
9 |
10 | bool open(string filepath);
11 | void update();
12 | void play();
13 | void stop();
14 | void close();
15 | void seek(float f);
16 | bool isPlaying();
17 | void setLoop(bool lp);
18 | float getPosition();
19 | float getDuration();
20 | bool getIsMovieDone();
21 | bool isSupported();
22 | bool isLoaded();
23 | void setVolume(float v);
24 | float getWidth();
25 | float getHeight();
26 | void bind();
27 | void unbind();
28 |
29 | ofPixels& getPixels();
30 |
31 | private:
32 | void videoLoaded(bool &success);
33 |
34 | bool bLoop;
35 | bool bLoaded;
36 | bool bSupported;
37 | bool bEnded;
38 | bool markEnd;
39 | float positionRequest;
40 | int positionRequestFrameCnt;
41 | float storePositionFix;
42 | int storePositionFrameCnt;
43 | float seekPositionStore;
44 | int seekPositionFrameCnt;
45 | bool bPaused;
46 |
47 | ofxWMFVideoPlayer player;
48 |
49 | };
50 | }
--------------------------------------------------------------------------------
/src/vdome/input/capture.cpp:
--------------------------------------------------------------------------------
1 | #include "capture.h"
2 | using namespace vd;
3 |
4 | Capture::Capture() {
5 | resolution = 2048;
6 | }
7 |
8 | void Capture::open(){
9 | grabber.setUseTexture(true);
10 | grabber.initGrabber(resolution, resolution);
11 | }
12 |
13 | void Capture::update(){
14 | if (isOpen()){
15 | grabber.update();
16 | }
17 | }
18 |
19 | void Capture::close(){
20 | if (isOpen()){
21 | grabber.close();
22 | }
23 | }
24 |
25 | bool Capture::isOpen(){
26 | return grabber.isInitialized();
27 | }
28 |
29 | void Capture::setResolution(int r){
30 | resolution = r;
31 | }
32 |
33 | void Capture::setFramerate(int frate){
34 | close();
35 | grabber.setDesiredFrameRate(frate);
36 | close();
37 | }
38 |
39 | float Capture::getRealWidth(){
40 | return grabber.getWidth();
41 | }
42 |
43 | float Capture::getRealHeight(){
44 | return grabber.getHeight();
45 | }
46 |
47 | ofPixels& Capture::getPixels(){
48 | return grabber.getPixels();
49 | }
50 |
51 | void Capture::bind(){
52 | grabber.getTexture().bind();
53 | }
54 |
55 | void Capture::unbind(){
56 | grabber.getTexture().unbind();
57 | }
58 |
59 |
--------------------------------------------------------------------------------
/vDome.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(ProjectDir)/bin
5 | WindowsLocalDebugger
6 |
7 |
8 | $(ProjectDir)/bin
9 | WindowsLocalDebugger
10 |
11 |
12 | $(ProjectDir)/bin
13 | WindowsLocalDebugger
14 |
15 |
16 | $(ProjectDir)/bin
17 | WindowsLocalDebugger
18 |
19 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/curves.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | #include "ofMain.h"
4 | #include "ofxCurvesTool.h"
5 | namespace vd {
6 |
7 | class Curves {
8 | public:
9 | Curves();
10 | void init(int i);
11 | void setup();
12 | void update();
13 | void draw(int x, int y);
14 | void keyPressed(int key);
15 |
16 | void incrementPoint(float inc);
17 | void setLabelPosition();
18 | void setLabelPosition(int x, int y);
19 |
20 | void save(int projectorStartingIndex);
21 | void load(int projectorStartingIndex);
22 |
23 | bool show;
24 | bool enabled;
25 |
26 | int getCurrentHover();
27 | void setCurrentHover(int i);
28 |
29 | void setPoint(int i, ofPoint p);
30 |
31 | void nextPoint();
32 | void prevPoint();
33 |
34 | void setActive(bool);
35 |
36 | int getColorMode();
37 | void setColorMode(int i);
38 |
39 | ofTexture& colorlutTextureRef();
40 |
41 | enum colors {GREY,RED,GREEN,BLUE};
42 | ofImage colorlut;
43 |
44 | private:
45 | bool active;
46 | int curveCnt;
47 | int lutRes;
48 | int index;
49 | int colorMode;
50 |
51 | vector curvesTools;
52 | ofXml *xml;
53 | };
54 |
55 | }
--------------------------------------------------------------------------------
/src/vdome/vdome.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "window.h"
3 | #include "socket.h"
4 | #include "saveThread.h"
5 |
6 | namespace vd {
7 |
8 | class vdome {
9 |
10 | public:
11 | vdome();
12 | void setup();
13 | void update(ofEventArgs & args);
14 |
15 | private:
16 | void loadXML();
17 | void saveXML();
18 | void createWindow(ofXml &xml);
19 | void setupInput();
20 | void updateInputFormat();
21 | void updateInputTransform();
22 | void exit();
23 | void onColorEvent(ofVec3f &color);
24 | void onSourceEvent(int &s);
25 | void onFormatEvent(int &s);
26 | void onSourceColorEvent(int &s);
27 | void keyPressed(int &key);
28 | void keyReleased(int &key);
29 |
30 | #ifdef TARGET_OSX
31 | void updateSyphonInputTransform();
32 | #endif
33 |
34 | Socket socket;
35 | Input input;
36 |
37 | ofXml xml;
38 | string xmlPath;
39 | SaveThread saveThread;
40 |
41 | bool vsync;
42 | int framerate;
43 | int cKey;
44 |
45 | vector> windows;
46 | vector> baseWindows;
47 |
48 | };
49 |
50 | }
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/readme.txt:
--------------------------------------------------------------------------------
1 | The Spout SDK files can either be included directly in your project
2 | or compiled as a dll.
3 |
4 | The Spout applications and examples have been compiled with the SDK
5 | files included in the projects and so are not dependent on a Spout dll.
6 |
7 | The installation folders are set up correctly for building the project.
8 | However, building from within the installation folder is not recommended.
9 | Copy the distribution "SPOUTSDK" folder elsewhere before compilation.
10 | Open the "SpoutSDK" solution, change to "Release" and build the project.
11 | Spout.dll and Spout.lib will be in the Win32\Release folder.
12 |
13 | To use the .dll created from this project, in your code define
14 | SPOUT_IMPORT_DLL in your preprocessor compilation defines.
15 |
16 | Thanks and credit to Malcolm Bechard for creating the dll project.
17 |
18 | https://github.com/mbechard
19 |
20 | COMPATIBILITY
21 |
22 | The dll created from this project has the advantage that all the functions
23 | in the Spout SDK classes are available. However, it is only suitable for
24 | use with Visual Studio compilers. For other compilers, see the C compatible
25 | dll in the SPOUTDSK\SPOUTDLL folder.
26 |
27 |
--------------------------------------------------------------------------------
/src/vdome/renderer/model.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | namespace vd {
4 |
5 | class Model {
6 |
7 | public:
8 | Model();
9 | void setup();
10 | void update();
11 | void draw();
12 | void keyPressed(int key);
13 |
14 | void loadXML(ofXml &xml);
15 | void saveXML(ofXml &xml);
16 | void saveMesh(string file);
17 |
18 | bool getTextureFlip();
19 | void setTextureFlip(bool b);
20 |
21 | float getTextureRotate();
22 | void setTextureRotate(float f);
23 |
24 | float getTextureTilt();
25 | void setTextureTilt(float f);
26 |
27 | float getTextureScale();
28 | void setTextureScale(float f);
29 |
30 | int editMode;
31 | enum editModes{NONE, T_FLIP, T_ROTATE, T_TILT, T_SCALE};
32 |
33 | float value;
34 | bool textureFlipInternal;
35 | float textureTiltInternal;
36 | float textureScaleInternal;
37 | float textureScaleInternalW;
38 | float textureScaleInternalH;
39 |
40 | private:
41 | ofVboMesh vbo;
42 | int N;
43 | double radius;
44 | float textureScale;
45 | bool textureFlip;
46 | float textureRotate;
47 | float textureTilt;
48 | };
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/vdome/menu/command.cpp:
--------------------------------------------------------------------------------
1 | #include "command.h"
2 | namespace vd {
3 |
4 | extern int maxHistory;
5 |
6 | Command::~Command() {}
7 |
8 | CommandHistory::CommandHistory() : index(0) {
9 | lastCommand = 0;
10 | }
11 |
12 | CommandHistory::~CommandHistory() {}
13 |
14 | void CommandHistory::execute(Command* command) {
15 | if (history.size() >= maxHistory)
16 | history.erase(history.begin());
17 | if (history.size() > 1 && index < history.size()-1)
18 | history.erase(history.begin() + index, history.end());
19 | history.push_back(command);
20 | command->execute();
21 | index = history.size()-1;
22 | lastCommand = 0;
23 | }
24 |
25 | void CommandHistory::undo() {
26 | if (lastCommand == 1) {
27 | if (index > 0)
28 | index--;
29 | }
30 | if (history.size() >= 1) {
31 | history[index]->undo();
32 | lastCommand = 1;
33 | }
34 | }
35 |
36 | void CommandHistory::redo() {
37 | if (lastCommand != 1) {
38 | if (index < history.size()-1)
39 | index++;
40 | }
41 | history[index]->redo();
42 | lastCommand = 2;
43 | }
44 |
45 | int CommandHistory::getIndex() {
46 | return index;
47 | }
48 |
49 | int CommandHistory::getLastCommand() {
50 | return lastCommand;
51 | }
52 |
53 | int CommandHistory::getSize() {
54 | return history.size();
55 | }
56 |
57 | }
58 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/mask.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | namespace vd {
4 |
5 | class Mask {
6 | public:
7 | Mask();
8 |
9 | void init(int i);
10 | void setup();
11 | void draw();
12 | void save(int projectorStartingIndex);
13 | void load(int projectorStartingIndex);
14 | int store(int fIndex);
15 | void recall(int fIndex);
16 | void reset();
17 |
18 | void mousePressed(ofMouseEventArgs& mouseArgs);
19 | void mouseDragged(ofMouseEventArgs& mouseArgs);
20 | void mouseReleased(ofMouseEventArgs& mouseArgs);
21 |
22 | void keyPressed(int key);
23 | void keyReleased(int key);
24 |
25 | ofImage brushImage;
26 | ofMesh brush;
27 | ofFbo maskFbo;
28 |
29 | float brushOpacity;
30 | float brushScale;
31 |
32 | int mouseX;
33 | int mouseY;
34 | float hIndex;
35 |
36 | int tx;
37 | int ty;
38 |
39 | ofImage *maskFboImage;
40 |
41 | int width;
42 | int height;
43 |
44 | private:
45 | void write(string filename);
46 | void read(string filename);
47 |
48 | ofPixels hPixels;
49 | ofPixels maskFboPixels;
50 |
51 | int brushWidth;
52 | int brushHeight;
53 | bool mouseDown;
54 | bool erase;
55 | int pIndex;
56 | bool bufferAllocated;
57 | string filename;
58 |
59 | };
60 | }
61 |
--------------------------------------------------------------------------------
/src/vdome/input/media/media.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "image.h"
3 |
4 | #ifdef TARGET_WIN32
5 | #define USE_WMF // windows only, undefine to use direct show
6 | #endif
7 |
8 | #ifdef USE_WMF
9 | #include "videoWMF.h"
10 | #else
11 | #include "video.h"
12 | #endif
13 |
14 | namespace vd{
15 |
16 | class Media{
17 |
18 | public:
19 | Media();
20 |
21 | void open(string filepath);
22 | void update();
23 | void play();
24 | void stop();
25 | void close();
26 | void seek(float f);
27 |
28 | void setLoop(bool lp);
29 | bool isPlaying();
30 | float getPosition();
31 | float getDuration();
32 | bool getLoop();
33 | string getFilepath();
34 | void setVolume(float v);
35 | void setResolution(int w, int h);
36 | bool isLoaded();
37 | float getRealWidth();
38 | float getRealHeight();
39 |
40 | void bind();
41 | void unbind();
42 |
43 | ofPixels& getPixels();
44 |
45 | enum MediaTypes {IMAGE,VIDEO};
46 | MediaTypes mType;
47 |
48 | ofEvent endEvent;
49 |
50 |
51 | private:
52 | string parseFile(string filepath);
53 | void videoEnd(bool &end);
54 | bool isImageFile(string ext);
55 |
56 | int width;
57 | int height;
58 | bool bLoop;
59 | string fpath;
60 | bool bEnded;
61 | float vol;
62 |
63 | Image image;
64 |
65 | #ifdef USE_WMF
66 | VideoWMF video;
67 | #else
68 | Video video;
69 | #endif
70 |
71 | string ImageTypes[29] =
72 | {"BMP","DDS","EXR","GIF","HDR","ICO","IFF","JBIG","JNG", "JPG",
73 | "JPEG","JIF","KOALA","MNG","PCX","PBM","PFM","PNG","PICT",
74 | "PSD","RAW","RAS","SGI","TARGA","TIFF","WBMP","WEBP","XBM","XPM"};
75 | };
76 | }
77 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/plane.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include "cornerpin.h"
4 | #include "ofxBezierSurface.h"
5 | namespace vd {
6 |
7 | class Plane {
8 |
9 | public:
10 | Plane();
11 |
12 | int width;
13 | int height;
14 |
15 | void setup(int i);
16 | void update();
17 | void draw();
18 | void drawConfig();
19 |
20 | void resetCornerpin();
21 | void resetGrid();
22 |
23 | void keyPressed(int key);
24 | void keyReleased(int key);
25 | void onMouseDragged(ofMouseEventArgs& mouseArgs);
26 | void onMousePressed(ofMouseEventArgs& mouseArgs);
27 | void onMouseReleased(ofMouseEventArgs& mouseArgs);
28 |
29 | void load(ofXml &xml, int projectorStartingIndex);
30 | void save(ofXml &xml);
31 |
32 | void setCornerpinPoints(vector pts);
33 | void setGridPoints(vector v);
34 |
35 | vector getGridPoints();
36 |
37 | ofXml *wXml;
38 | float value;
39 |
40 | ofMatrix4x4 lm;
41 | bool bfirst;
42 |
43 | QuadWarp cornerpin;
44 | ofxBezierSurface grid;
45 |
46 | bool cornerpinActive;
47 | bool gridActive;
48 | vector cornerpinValues;
49 | vector getCornerpinPoints();
50 | vector position;
51 |
52 |
53 | private:
54 | float index;
55 | bool shift;
56 | ofPoint lastM;
57 | bool group;
58 | bool drawBox;
59 | ofPoint boxOrigin;
60 | ofPoint boxUpdate;
61 | int xRes;
62 | int yRes;
63 | int pointIndex;
64 |
65 | map sel;
66 | vector cornerpinPoints;
67 | };
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/Spout.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Spout.h
4 |
5 | The main Spout include file for the SDK
6 |
7 | Copyright (c) 2014-1015, Lynn Jarvis. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without modification,
10 | are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright notice,
16 | this list of conditions and the following disclaimer in the documentation
17 | and/or other materials provided with the distribution.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
30 | */
31 | #pragma once
32 |
33 | #ifndef __Spout__
34 | #define __Spout__
35 |
36 | #include "SpoutSender.h"
37 | #include "SpoutReceiver.h"
38 |
39 | // All documentation in the SDK pdf = SpoutSDK.pdf
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/src/vdome/renderer/window.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "model.h"
3 | #include "projector.h"
4 | #include "menu.h"
5 |
6 | #ifdef TARGET_OSX
7 | #include "ofxSyphon.h"
8 | #endif
9 |
10 | #ifdef TARGET_WIN32
11 | #include "spoutR.h"
12 | #endif
13 |
14 | #include "input.h"
15 |
16 | namespace vd {
17 | class vdome;
18 |
19 | class Window : public ofBaseApp {
20 |
21 | public:
22 | Window();
23 |
24 | void init();
25 | void setup();
26 | void update();
27 | void draw();
28 |
29 | void loadXML(ofXml &xml);
30 | void saveXML(ofXml &xml);
31 |
32 | void keyPressed(int key);
33 | void keyReleased(int key);
34 |
35 | void mousePressed(ofMouseEventArgs& mouseArgs);
36 | void mouseDragged(ofMouseEventArgs& mouseArgs);
37 | void mouseReleased(ofMouseEventArgs& mouseArgs);
38 |
39 | ofPoint getPosition();
40 | void setPosition(int x, int y);
41 |
42 | ofPoint getResolution();
43 | void setResolution(int w, int h);
44 |
45 | void setVSync(bool val);
46 | void setFrameRate(int val);
47 |
48 | int index;
49 | Input *input;
50 | Menu menu;
51 | Model model;
52 | int projectorStartingIndex;
53 |
54 | enum sources {MEDIA, CAPTURE, SYPHON, SPOUT, GRID, BLACK, WHITE, GREY, COLOR};
55 |
56 | static ofEvent keyPressEvent;
57 | static ofEvent keyReleaseEvent;
58 |
59 | vector projectors;
60 |
61 | #ifdef TARGET_OSX
62 | ofxSyphonClient syphon;
63 | #endif
64 |
65 | #ifdef TARGET_WIN32
66 | SpoutR spout;
67 | #endif
68 |
69 | private:
70 | int x;
71 | int y;
72 | int width;
73 | int height;
74 | bool fullscreen;
75 |
76 | float ratio;
77 | int maxHistory;
78 |
79 | ofShader shader;
80 | };
81 |
82 | }
83 |
--------------------------------------------------------------------------------
/src/vdome/input/media/video.cpp:
--------------------------------------------------------------------------------
1 | #include "video.h"
2 | using namespace vd;
3 |
4 | Video::Video() {
5 | bEnded = false;
6 | }
7 |
8 | bool Video::open(string filepath){
9 | if (!player.load(filepath)){
10 | return false;
11 | }
12 | player.setUseTexture(true);
13 | player.play();
14 | player.setLoopState(loopT);
15 | return true;
16 | }
17 |
18 | void Video::update(){
19 | player.update();
20 |
21 | if (getIsMovieDone()) {
22 | bEnded = true;
23 | ofNotifyEvent(endEvent,bEnded,this);
24 | }
25 | }
26 |
27 | void Video::play(){
28 | player.play();
29 | }
30 |
31 | void Video::stop(){
32 | player.stop();
33 | }
34 |
35 | void Video::close(){
36 | player.stop();
37 | player.close();
38 | }
39 |
40 | void Video::seek(float f){
41 | player.setPosition(f);
42 | }
43 |
44 | bool Video::isPlaying(){
45 | return player.isPlaying();
46 | }
47 |
48 | bool Video::isLoaded(){
49 | return player.isLoaded();;
50 | }
51 |
52 | void Video::setLoop(bool lp){
53 | loopT = (lp ? OF_LOOP_NORMAL : OF_LOOP_NONE);
54 | player.setLoopState(loopT);
55 | }
56 |
57 | float Video::getPosition(){
58 | return player.getPosition();
59 | }
60 |
61 | float Video::getDuration(){
62 | return player.getDuration();
63 | }
64 |
65 | bool Video::getIsMovieDone(){
66 | return player.getIsMovieDone();
67 | }
68 |
69 | void Video::setVolume(float v){
70 | player.setVolume(v);
71 | }
72 |
73 | float Video::getWidth(){
74 | return player.getWidth();
75 | }
76 |
77 | float Video::getHeight(){
78 | return player.getHeight();
79 | }
80 |
81 | ofPixels& Video::getPixels(){
82 | return player.getPixels();
83 | }
84 |
85 | void Video::bind(){
86 | player.getTexture().setTextureWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_BORDER);
87 | player.getTexture().bind();
88 | }
89 |
90 | void Video::unbind() {
91 | player.getTexture().unbind();
92 | }
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutCommon.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | Spout.h
4 |
5 | The main Spout include file for the SDK
6 |
7 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
8 |
9 | Redistribution and use in source and binary forms, with or without modification,
10 | are permitted provided that the following conditions are met:
11 |
12 | 1. Redistributions of source code must retain the above copyright notice,
13 | this list of conditions and the following disclaimer.
14 |
15 | 2. Redistributions in binary form must reproduce the above copyright notice,
16 | this list of conditions and the following disclaimer in the documentation
17 | and/or other materials provided with the distribution.
18 |
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 |
29 |
30 | */
31 | #pragma once
32 |
33 | #ifndef __SpoutCommon__
34 | #define __SpoutCommon__
35 |
36 | #if defined(_MSC_VER)
37 | #if defined(SPOUT_BUILD_DLL)
38 | #define SPOUT_DLLEXP __declspec(dllexport)
39 | #elif defined(SPOUT_IMPORT_DLL)
40 | #define SPOUT_DLLEXP __declspec(dllimport)
41 | #else
42 | #define SPOUT_DLLEXP
43 | #endif
44 | #else // _MSC_VER
45 | #define SPOUT_DLLEXP
46 | #endif // _MSC_VERR
47 |
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/vDome.sln:
--------------------------------------------------------------------------------
1 | Microsoft Visual Studio Solution File, Format Version 12.00
2 | # Visual Studio 14
3 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vDome", "vDome.vcxproj", "{7FD42DF7-442E-479A-BA76-D0022F99702A}"
4 | EndProject
5 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "openframeworksLib", "..\..\..\libs\openFrameworksCompiled\project\vs\openframeworksLib.vcxproj", "{5837595D-ACA9-485C-8E76-729040CE4B0B}"
6 | EndProject
7 | Global
8 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
9 | Debug|Win32 = Debug|Win32
10 | Debug|x64 = Debug|x64
11 | Release|Win32 = Release|Win32
12 | Release|x64 = Release|x64
13 | EndGlobalSection
14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
15 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.ActiveCfg = Debug|Win32
16 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|Win32.Build.0 = Debug|Win32
17 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.ActiveCfg = Debug|x64
18 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Debug|x64.Build.0 = Debug|x64
19 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.ActiveCfg = Release|Win32
20 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|Win32.Build.0 = Release|Win32
21 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.ActiveCfg = Release|x64
22 | {7FD42DF7-442E-479A-BA76-D0022F99702A}.Release|x64.Build.0 = Release|x64
23 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.ActiveCfg = Debug|Win32
24 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|Win32.Build.0 = Debug|Win32
25 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.ActiveCfg = Debug|x64
26 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Debug|x64.Build.0 = Debug|x64
27 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.ActiveCfg = Release|Win32
28 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|Win32.Build.0 = Release|Win32
29 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.ActiveCfg = Release|x64
30 | {5837595D-ACA9-485C-8E76-729040CE4B0B}.Release|x64.Build.0 = Release|x64
31 | EndGlobalSection
32 | GlobalSection(SolutionProperties) = preSolution
33 | HideSolutionNode = FALSE
34 | EndGlobalSection
35 | EndGlobal
36 |
--------------------------------------------------------------------------------
/src/vdome/input/input.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include "socket.h"
4 | #include "media.h"
5 | #include "capture.h"
6 | #include "color.h"
7 | #include "model.h"
8 |
9 | #ifdef TARGET_WIN32
10 | #include "spoutR.h"
11 | #endif
12 |
13 | #ifdef TARGET_OSX
14 | #include "ofxSyphon.h"
15 | #endif
16 |
17 | namespace vd {
18 | class Socket;
19 |
20 | class Input {
21 |
22 | public:
23 | Input();
24 |
25 | void setup();
26 | void update();
27 |
28 | void play();
29 | void stop();
30 | void close();
31 | void seek(float f);
32 | bool isPlaying();
33 |
34 | void loadXML(ofXml &xml);
35 | void saveXML(ofXml &xml);
36 |
37 | void setLoop(bool b);
38 | bool getLoop();
39 |
40 | string getSource();
41 | int getSourceInt();
42 | void setSourceInt(int i);
43 | int convertSourceString(string s);
44 |
45 | void setFormatInt(int i);
46 | void setFormat();
47 | int getFormatInt();
48 | int convertFormatString(string s);
49 |
50 | float getPosition();
51 | float getDuration();
52 |
53 | void setResolution(int r);
54 | string getFilepath();
55 |
56 | void setVolume(float v);
57 | void setColor(int r, int g, int b);
58 |
59 | void openFile(string file);
60 | void setFile(string file);
61 | void keyPressed(int key);
62 | void setFramerate(int frate);
63 |
64 | void bind();
65 | void unbind();
66 |
67 | ofPixels& getPixels();
68 |
69 | int source;
70 | enum sources {MEDIA, CAPTURE, SYPHON, SPOUT, GRID, BLACK, WHITE, GREY, COLOR};
71 |
72 | int format;
73 | enum format {DOMEMASTER, HD};
74 |
75 | Media media;
76 | Capture capture;
77 | Color color;
78 | Socket *socket;
79 |
80 | float ratio;
81 | bool durationSent;
82 |
83 | private:
84 | void mediaEnd(bool &end);
85 |
86 | string filepath;
87 | bool loop;
88 | bool endSent;
89 | int framerate;
90 | bool isVideo;
91 | int resolution;
92 |
93 | ofColor cColor;
94 | };
95 |
96 | }
97 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/cornerpin.h:
--------------------------------------------------------------------------------
1 | //
2 | // QuadWarp.h
3 | // Created by lukasz karluk on 19/06/11.
4 | //
5 |
6 | // modified by Charles Veasey
7 | // - mouse position is now delta
8 |
9 | #pragma once
10 |
11 | #include "ofMain.h"
12 | #include "ofxOpenCv.h"
13 | namespace vd {
14 |
15 | class QuadWarp
16 | {
17 | public:
18 | QuadWarp();
19 | ~QuadWarp();
20 |
21 | void setup();
22 |
23 | void setPosition(float x, float y);
24 | void setAnchorSize(float w, float h);
25 |
26 | void setSourceRect(ofRectangle rect);
27 | void setSourcePoints(vector points);
28 | ofPoint* getSourcePoints();
29 | void setTargetRect(ofRectangle rect);
30 | void setTargetPoints(vector points);
31 | ofPoint* getTargetPoints();
32 | void setMatrix(ofMatrix4x4 matrix);
33 |
34 | void enable();
35 | void disable();
36 |
37 | void update();
38 | void reset();
39 |
40 | ofMatrix4x4 getMatrix();
41 | ofMatrix4x4 getMatrixInverse();
42 | ofMatrix4x4 getMatrix(ofPoint * srcPoints, ofPoint * dstPoints);
43 |
44 | void setCorners(vector corners);
45 | void setCorner(ofPoint p, int cornerIndex);
46 | void setTopLeftCornerPosition(ofPoint p);
47 | void setTopRightCornerPosition(ofPoint p);
48 | void setBottomRightCornerPosition(ofPoint p);
49 | void setBottomLeftCornerPosition(ofPoint p);
50 |
51 | void onMousePressed(ofMouseEventArgs& mouseArgs);
52 | void onMouseDragged(ofMouseEventArgs &mouseArgs);
53 | void onMouseReleased(ofMouseEventArgs& mouseArgs);
54 | void keyPressed(ofKeyEventArgs& keyArgs);
55 | void keyReleased(ofKeyEventArgs& keyArgs);
56 |
57 | void show();
58 | void hide();
59 | void toggleShow();
60 |
61 | void draw();
62 | void drawCorners();
63 | void drawQuadOutline();
64 |
65 | void loadPoints();
66 | void savePoints();
67 |
68 | ofPoint srcPoints[4];
69 | ofPoint dstPoints[4];
70 | bool bShow;
71 | bool isCornerSelected(int cornerIndex) { return selectedCornerIndex == cornerIndex; }
72 |
73 | float value;
74 |
75 | protected:
76 | ofPoint position;
77 | ofPoint anchorSize;
78 | ofPoint anchorSizeHalf;
79 | int selectedCornerIndex;
80 | bool bEnabled;
81 | ofPoint lastMouse;
82 | int cKey;
83 | };
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/bin/data/settings/shaders/vdome.frag:
--------------------------------------------------------------------------------
1 | #version 150
2 |
3 | // TEXTURE INPUT
4 | uniform sampler2DRect texsampler;
5 | in vec2 vtexcoord;
6 | vec4 t;
7 |
8 | // contrast, saturation, brightness
9 | uniform float brightness;
10 | uniform float contrast;
11 | uniform float saturation;
12 | vec3 cCSB;
13 | const float AvgLumR = 0.5;
14 | const float AvgLumG = 0.5;
15 | const float AvgLumB = 0.5;
16 | const vec3 LumCoeff = vec3 (0.2125, 0.7154, 0.0721);
17 |
18 | /// COLOR: CURVES
19 | uniform sampler2DRect colorlut;
20 | uniform int interp;
21 | uniform float mapdim;
22 | uniform float amt;
23 | vec4 set;
24 | float rout;
25 | float gout;
26 | float bout;
27 | vec4 mapped;
28 | vec4 t2;
29 |
30 | // MASK
31 | uniform sampler2DRect maskTex;
32 |
33 | // TEXTURE OUTPUT
34 | out vec4 outputColor;
35 |
36 | /*
37 | ** Contrast, saturation, brightness
38 | ** Code of this function is from TGM's shader pack
39 | ** http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=21057
40 | */
41 |
42 | // For all settings: 1.0 = 100% 0.5=50% 1.5 = 150%
43 | vec3 ContrastSaturationBrightness(vec3 color, float brt, float sat, float con) {
44 | vec3 AvgLumin = vec3(AvgLumR, AvgLumG, AvgLumB);
45 | vec3 brtColor = color * brt;
46 | vec3 intensity = vec3(dot(brtColor, LumCoeff));
47 | vec3 satColor = mix(intensity, brtColor, sat);
48 | vec3 conColor = mix(AvgLumin, satColor, con);
49 | return conColor;
50 | }
51 |
52 | void main() {
53 | //input
54 | t = texture(texsampler, vtexcoord);
55 |
56 | cCSB = ContrastSaturationBrightness(t.rgb, brightness, saturation, contrast);
57 |
58 | t2 = vec4(cCSB.rgb, t.a);
59 |
60 | // grey curve
61 | set = mix(floor(t2*mapdim),t2*mapdim,float(interp)); //multiply color value for LUT range
62 | rout = float (texture(colorlut, vec2(set.r,0.)).a); //look up red
63 | gout = float (texture(colorlut, vec2(set.g,0.)).a); //look up green
64 | bout = float (texture(colorlut, vec2(set.b,0.)).a); //look up blue
65 | mapped = vec4 (rout, gout, bout,t2.a);
66 | t2 = mix(t2, mapped, amt);
67 |
68 | // color curves
69 | set = mix(floor(t2*mapdim),t2*mapdim,float(interp)); //multiply color value for LUT range
70 | rout = float (texture(colorlut, vec2(set.r,0.)).r); //look up red
71 | gout = float (texture(colorlut, vec2(set.g,0.)).g); //look up green
72 | bout = float (texture(colorlut, vec2(set.b,0.)).b); //look up blue
73 | mapped = vec4 (rout, gout, bout,t2.a);
74 | t2 = mix(t2, mapped, amt);
75 |
76 | // mask
77 | float mask = texture(maskTex, vtexcoord).a;
78 |
79 | // output
80 | outputColor = vec4(t2.rgb, 1-mask);
81 | }
82 |
83 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutSharedMemory.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | spoutSharedMemory.h
4 |
5 | Thanks and credit to Malcolm Bechard the author of this class
6 |
7 | https://github.com/mbechard
8 |
9 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
10 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
11 |
12 | Redistribution and use in source and binary forms, with or without modification,
13 | are permitted provided that the following conditions are met:
14 |
15 | 1. Redistributions of source code must retain the above copyright notice,
16 | this list of conditions and the following disclaimer.
17 |
18 | 2. Redistributions in binary form must reproduce the above copyright notice,
19 | this list of conditions and the following disclaimer in the documentation
20 | and/or other materials provided with the distribution.
21 |
22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
23 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
24 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 | */
33 | #pragma once
34 |
35 | #ifndef __SpoutSharedMemory_ // standard way as well
36 | #define __SpoutSharedMemory_
37 |
38 | #include "SpoutCommon.h"
39 | #include
40 | #include
41 | #include
42 |
43 | enum SpoutCreateResult
44 | {
45 | SPOUT_CREATE_FAILED = 0,
46 | SPOUT_CREATE_SUCCESS,
47 | SPOUT_ALREADY_EXISTS,
48 | SPOUT_ALREADY_CREATED,
49 | };
50 |
51 | class SPOUT_DLLEXP SpoutSharedMemory {
52 | public:
53 | SpoutSharedMemory();
54 | ~SpoutSharedMemory();
55 |
56 |
57 | // Create a new memory segment, or attachs to an existing one
58 | SpoutCreateResult Create(const char* name, int size);
59 |
60 | // Opens an existing one
61 | bool Open(const char* name);
62 | void Close();
63 |
64 | // Returns the buffer
65 | char* Lock();
66 | void Unlock();
67 |
68 | void Debug();
69 | private:
70 | char* m_pBuffer;
71 | HANDLE m_hMap;
72 | HANDLE m_hMutex;
73 |
74 | int m_lockCount;
75 |
76 | const char* m_pName;
77 | int m_size;
78 | };
79 |
80 | #endif
81 |
--------------------------------------------------------------------------------
/src/vdome/input/media/video/videoWMF.cpp:
--------------------------------------------------------------------------------
1 | #include "videoWMF.h"
2 | using namespace vd;
3 |
4 | VideoWMF::VideoWMF() {
5 | bLoop = false;
6 | markEnd = false;
7 | positionRequestFrameCnt = 0;
8 | positionRequest = -1;
9 | storePositionFix =-1;
10 | seekPositionFrameCnt = 0;
11 | ofAddListener(player.videoLoadEvent, this, &VideoWMF::videoLoaded);
12 | }
13 |
14 | bool VideoWMF::open(string filepath){
15 | bLoaded = false;
16 | bSupported = false;
17 | bEnded = false;
18 | markEnd = false;
19 | positionRequestFrameCnt = 0;
20 | storePositionFrameCnt = 0;
21 | positionRequest = -1;
22 | storePositionFix = -1;
23 | player.loadMovie(filepath);
24 | play();
25 | player.setLoop(bLoop);
26 | return true;
27 | }
28 |
29 | void VideoWMF::update(){
30 |
31 | player.update();
32 |
33 | if (markEnd){
34 | bEnded = true;
35 | markEnd = false;
36 | }
37 |
38 | if (player.getPosition() > 0.99){
39 | markEnd = true;
40 | }else {
41 | markEnd = false;
42 | }
43 |
44 | if (positionRequest >= 0){
45 | positionRequestFrameCnt++;
46 | }
47 | if (positionRequestFrameCnt > 20){
48 | positionRequestFrameCnt = -1;
49 | player.setPosition(positionRequest);
50 | if (bPaused) stop();
51 | positionRequest = -1;
52 | storePositionFix = -1;
53 | }
54 |
55 | if (seekPositionFrameCnt > 40)
56 | seekPositionFrameCnt = 0;
57 |
58 | if (seekPositionFrameCnt > 0)
59 | seekPositionFrameCnt++;
60 | }
61 |
62 | void VideoWMF::play(){
63 | bPaused = false;
64 | player.play();
65 | }
66 |
67 | void VideoWMF::stop(){
68 | bPaused = true;
69 | player.pause();
70 | }
71 |
72 | void VideoWMF::close(){
73 | player.stop();
74 | //player.close();
75 | //player.forceExit();
76 | }
77 |
78 | void VideoWMF::seek(float f){
79 | seekPositionStore = f;
80 | seekPositionFrameCnt = 1;
81 | storePositionFrameCnt = 0;
82 | positionRequest = f;
83 | storePositionFix = positionRequest;
84 | }
85 |
86 | bool VideoWMF::isPlaying(){
87 | return player.isPlaying();
88 | }
89 |
90 | void VideoWMF::setLoop(bool lp){
91 | bLoop = lp;
92 | player.setLoop(lp);
93 | }
94 |
95 | float VideoWMF::getPosition(){
96 | if ( seekPositionFrameCnt > 0 ) {
97 | return seekPositionStore;
98 | }
99 | return player.getPosition();
100 | }
101 |
102 | float VideoWMF::getDuration(){
103 | return player.getDuration();
104 | }
105 |
106 | bool VideoWMF::getIsMovieDone(){
107 | return bEnded;
108 | }
109 |
110 | void VideoWMF::videoLoaded(bool &success){
111 | bLoaded = true;
112 | bSupported = success;
113 | }
114 |
115 | bool VideoWMF::isLoaded(){
116 | return bLoaded;
117 | }
118 |
119 | bool VideoWMF::isSupported(){
120 | return bSupported;
121 | }
122 |
123 | void VideoWMF::setVolume(float v){
124 | player.setVolume(v);
125 | }
126 |
127 | float VideoWMF::getWidth(){
128 | return player.getWidth();
129 | }
130 |
131 | float VideoWMF::getHeight(){
132 | return player.getHeight();
133 | }
134 |
135 | void VideoWMF::bind() {
136 | return player.bind();
137 | }
138 |
139 | void VideoWMF::unbind() {
140 | return player.unbind();
141 | }
142 |
143 | ofPixels& VideoWMF::getPixels() {
144 | //fix: WMF doesn't return pixels
145 | ofPixels pixels;
146 | return pixels;
147 | }
--------------------------------------------------------------------------------
/vDome.xcodeproj/xcshareddata/xcschemes/vdome Debug.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/vDome.xcodeproj/xcshareddata/xcschemes/vdome Release.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
51 |
52 |
58 |
59 |
60 |
61 |
62 |
63 |
69 |
70 |
76 |
77 |
78 |
79 |
81 |
82 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutSender.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | SpoutSender.h
4 |
5 |
6 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
7 |
8 | Redistribution and use in source and binary forms, with or without modification,
9 | are permitted provided that the following conditions are met:
10 |
11 | 1. Redistributions of source code must retain the above copyright notice,
12 | this list of conditions and the following disclaimer.
13 |
14 | 2. Redistributions in binary form must reproduce the above copyright notice,
15 | this list of conditions and the following disclaimer in the documentation
16 | and/or other materials provided with the distribution.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
19 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 |
28 | */
29 | #pragma once
30 |
31 | #ifndef __SpoutSender__
32 | #define __SpoutSender__
33 |
34 | #include "spoutSDK.h"
35 |
36 | class SPOUT_DLLEXP SpoutSender {
37 |
38 | public:
39 |
40 | SpoutSender();
41 | ~SpoutSender();
42 |
43 | bool CreateSender(char *Sendername, unsigned int width, unsigned int height, DWORD dwFormat = 0);
44 | bool UpdateSender(char *Sendername, unsigned int width, unsigned int height);
45 | void ReleaseSender(DWORD dwMsec = 0);
46 |
47 | bool SendImage(unsigned char* pixels, unsigned int width, unsigned int height, GLenum glFormat = GL_RGBA, bool bAlignment = true, bool bInvert=true);
48 | bool SendTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, bool bInvert=true, GLuint HostFBO = 0);
49 | bool DrawToSharedTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, float max_x = 1.0, float max_y = 1.0, float aspect = 1.0, bool bInvert = true, GLuint HostFBO = 0);
50 |
51 | bool SelectSenderPanel(const char* message = NULL);
52 |
53 | bool SetMemoryShareMode(bool bMemoryMode = true);
54 | bool GetMemoryShareMode();
55 |
56 | bool SetDX9(bool bDX9 = true); // set to use DirectX 9 (default is DirectX 11)
57 | bool GetDX9();
58 |
59 | void SetDX9compatible(bool bCompatible = true); // DirectX 11 format compatible with DirectX 9
60 | bool GetDX9compatible();
61 |
62 | int GetNumAdapters(); // Get the number of graphics adapters in the system
63 | bool GetAdapterName(int index, char *adaptername, int maxchars); // Get an adapter name
64 | bool SetAdapter(int index = 0); // Set required graphics adapter for output
65 | int GetAdapter(); // Get the current adapter index
66 |
67 | bool SetVerticalSync(bool bSync = true);
68 | int GetVerticalSync();
69 |
70 |
71 | bool SenderDebug(char *Sendername, int size);
72 |
73 | Spout spout; // LJ DEBUG - for testing
74 |
75 | protected :
76 |
77 | // Spout spout;
78 |
79 | };
80 |
81 | #endif
82 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutReceiver.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | SpoutReceiver.h
4 |
5 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without modification,
8 | are permitted provided that the following conditions are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright notice,
11 | this list of conditions and the following disclaimer.
12 |
13 | 2. Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
18 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
22 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 |
27 | */
28 | #pragma once
29 |
30 | #ifndef __SpoutReceiver__
31 | #define __SpoutReceiver__
32 |
33 | #include "spoutSDK.h"
34 |
35 | class SPOUT_DLLEXP SpoutReceiver {
36 |
37 | public:
38 |
39 | SpoutReceiver();
40 | ~SpoutReceiver();
41 |
42 | bool CreateReceiver(char* Sendername, unsigned int &width, unsigned int &height, bool bUseActive = false);
43 | bool ReceiveTexture(char* Sendername, unsigned int &width, unsigned int &height, GLuint TextureID = 0, GLuint TextureTarget = 0, bool bInvert = false, GLuint HostFBO = 0);
44 | bool ReceiveImage (char* Sendername, unsigned int &width, unsigned int &height, unsigned char * pixels, GLenum glFormat = GL_RGBA, GLuint HostFBO = 0);
45 | bool GetImageSize (char* Sendername, unsigned int &width, unsigned int &height, bool &bMemoryMode);
46 | void ReleaseReceiver();
47 |
48 | bool BindSharedTexture();
49 | bool UnBindSharedTexture();
50 | bool DrawSharedTexture(float max_x = 1.0, float max_y = 1.0, float aspect = 1.0, bool bInvert = true);
51 |
52 | int GetSenderCount();
53 | bool GetSenderName(int index, char* Sendername, int MaxSize = 256);
54 | bool GetSenderInfo(const char* Sendername, unsigned int &width, unsigned int &height, HANDLE &dxShareHandle, DWORD &dwFormat);
55 |
56 | bool GetActiveSender(char* Sendername);
57 | bool SetActiveSender(char* Sendername);
58 |
59 | bool SelectSenderPanel(const char* message = NULL);
60 |
61 | bool GetMemoryShareMode();
62 | bool SetMemoryShareMode(bool bMemory = true);
63 |
64 | bool SetDX9(bool bDX9 = true); // set to use DirectX 9 (default is DirectX 11)
65 | bool GetDX9();
66 |
67 | void SetDX9compatible(bool bCompatible = true);
68 | bool GetDX9compatible();
69 |
70 | int GetNumAdapters(); // Get the number of graphics adapters in the system
71 | bool GetAdapterName(int index, char *adaptername, int maxchars); // Get an adapter name
72 | bool SetAdapter(int index = 0); // Set required graphics adapter for output
73 | int GetAdapter(); // Get the current adapter index
74 |
75 | bool SetVerticalSync(bool bSync = true);
76 | int GetVerticalSync();
77 |
78 | Spout spout; // for debug
79 |
80 | protected :
81 |
82 | // Spout spout;
83 |
84 | };
85 |
86 | #endif
87 |
--------------------------------------------------------------------------------
/src/vdome/input/media/media.cpp:
--------------------------------------------------------------------------------
1 | #include "media.h"
2 | using namespace vd;
3 |
4 | Media::Media() {
5 | width = 2048;
6 | height = 2048;
7 | bEnded = false;
8 | vol = 1;
9 | }
10 |
11 | void Media::open(string filepath){
12 | fpath = filepath;
13 | stop();
14 | close();
15 | bEnded = false;
16 |
17 | string mString = parseFile(filepath);
18 | if (mString == "image"){
19 | mType = IMAGE;
20 | image.open(filepath);
21 | }
22 | else if (mString == "video"){
23 | mType = VIDEO;
24 | video.setLoop(bLoop);
25 | video.open(filepath);
26 | video.setVolume(vol);
27 | }
28 | }
29 |
30 | void Media::update(){
31 | switch (mType) {
32 | case IMAGE: break;
33 | case VIDEO:
34 | video.update();
35 | if (video.getIsMovieDone()) {
36 | bool end = true;
37 | videoEnd(end);
38 | }
39 | break;
40 | }
41 | }
42 |
43 | void Media::play(){
44 | switch (mType) {
45 | case IMAGE: break;
46 | case VIDEO: video.play(); break;
47 | }
48 | }
49 |
50 | void Media::stop(){
51 | switch (mType) {
52 | case IMAGE: break;
53 | case VIDEO: video.stop(); break;
54 | }
55 | }
56 |
57 | void Media::close(){
58 | switch (mType) {
59 | case IMAGE: image.close(); break;
60 | case VIDEO: video.close(); break;
61 | }
62 | }
63 |
64 | void Media::seek(float f){
65 | switch (mType) {
66 | case IMAGE: break;
67 | case VIDEO: video.seek(f); break;
68 | }
69 | }
70 |
71 | void Media::setLoop(bool lp){
72 | bLoop = lp;
73 | video.setLoop(lp);
74 | }
75 |
76 | bool Media::getLoop(){
77 | return bLoop;
78 | }
79 |
80 | bool Media::isPlaying(){
81 | return video.isPlaying();
82 | }
83 |
84 | float Media::getPosition(){
85 | if (mType == VIDEO)
86 | return video.getPosition();
87 | return 0;
88 | }
89 |
90 | float Media::getDuration(){
91 | if (mType == VIDEO)
92 | return video.getDuration();
93 | return 0;
94 | }
95 |
96 | void Media::setResolution(int w, int h){
97 | width = w;
98 | height = h;
99 | }
100 |
101 | void Media::videoEnd(bool &end){
102 | bEnded = true;
103 | ofNotifyEvent(endEvent,bEnded,this);
104 | }
105 |
106 | string Media::getFilepath(){
107 | return fpath;
108 | }
109 |
110 | void Media::setVolume(float v){
111 | vol = v;
112 | video.setVolume(v);
113 | }
114 |
115 | string Media::parseFile(string filepath){
116 | ofFile oFile;
117 | oFile.open(filepath);
118 | string mString = "";
119 | string extension = ofToUpper(oFile.getExtension());
120 | if (isImageFile(extension))
121 | mString = "image";
122 | else
123 | mString = "video";
124 | oFile.close();
125 | return mString;
126 | }
127 |
128 | bool Media::isLoaded(){
129 | switch (mType) {
130 | case IMAGE: return image.isLoaded(); break;
131 | case VIDEO: return video.isLoaded(); break;
132 | }
133 | }
134 |
135 | float Media::getRealWidth(){
136 | switch (mType) {
137 | case IMAGE: return image.getWidth(); break;
138 | case VIDEO: return video.getWidth(); break;
139 | }
140 | }
141 |
142 | float Media::getRealHeight(){
143 | switch (mType) {
144 | case IMAGE: return image.getHeight(); break;
145 | case VIDEO: return video.getHeight(); break;
146 | }
147 | }
148 |
149 | ofPixels & Media::getPixels(){
150 | switch (mType) {
151 | case IMAGE: return image.getPixels(); break;
152 | case VIDEO: return video.getPixels(); break;
153 | }
154 | }
155 |
156 | void Media::bind() {
157 | switch (mType) {
158 | case IMAGE: image.bind(); break;
159 | case VIDEO: video.bind(); break;
160 | }
161 | }
162 |
163 | void Media::unbind() {
164 | switch (mType) {
165 | case IMAGE: image.unbind(); break;
166 | case VIDEO: video.unbind(); break;
167 | }
168 | }
169 |
170 | bool Media::isImageFile(string ext){
171 | for (auto i : ImageTypes){
172 | if (i == ext)
173 | return true;
174 | }
175 | return false;
176 | }
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutDirectX.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | spoutDirectX.h
4 |
5 | DirectX functions to manage DirectX 11 texture sharing
6 |
7 |
8 | Copyright (c) 2014 - 2015, Lynn Jarvis. All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without modification,
11 | are permitted provided that the following conditions are met:
12 |
13 | 1. Redistributions of source code must retain the above copyright notice,
14 | this list of conditions and the following disclaimer.
15 |
16 | 2. Redistributions in binary form must reproduce the above copyright notice,
17 | this list of conditions and the following disclaimer in the documentation
18 | and/or other materials provided with the distribution.
19 |
20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
21 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 |
30 | */
31 | #pragma once
32 | #ifndef __spoutDirectX__
33 | #define __spoutDirectX__
34 |
35 | #include "SpoutCommon.h"
36 | #include
37 | #include
38 | #include
39 | #include // LJ DEBUG
40 | #include
41 | #include
42 |
43 | #pragma comment (lib, "d3d9.lib")
44 | #pragma comment (lib, "d3d11.lib")
45 | #pragma comment (lib, "DXGI.lib")
46 |
47 | using namespace std;
48 |
49 | class SPOUT_DLLEXP spoutDirectX {
50 |
51 | public:
52 |
53 | spoutDirectX();
54 | ~spoutDirectX();
55 |
56 | // DX9
57 | IDirect3D9Ex* CreateDX9object(); // Create a DirectX9 object
58 | IDirect3DDevice9Ex* CreateDX9device(IDirect3D9Ex* pD3D, HWND hWnd); // Create a DirectX9 device
59 | bool CreateSharedDX9Texture(IDirect3DDevice9Ex* pDevice, unsigned int width, unsigned int height, D3DFORMAT format, LPDIRECT3DTEXTURE9 &dxTexture, HANDLE &dxShareHandle);
60 |
61 | // DX11
62 | ID3D11Device* CreateDX11device(); // Create a DX11 device
63 | bool CreateSharedDX11Texture(ID3D11Device* pDevice, unsigned int width, unsigned int height, DXGI_FORMAT format, ID3D11Texture2D** pSharedTexture, HANDLE &dxShareHandle);
64 | bool OpenDX11shareHandle(ID3D11Device* pDevice, ID3D11Texture2D** ppSharedTexture, HANDLE dxShareHandle);
65 | void CloseDX11();
66 | bool DX11available(); // Verify that the operating system supports DirectX 11
67 |
68 | // Output adapter selection
69 | int GetNumAdapters(); // Get the number of graphics adapters in the system
70 | bool GetAdapterName(int index, char *adaptername, int maxchars); // Get an adapter name
71 | bool SetAdapter(int index); // Set required graphics adapter for output
72 | int GetAdapter(); // Get the current adapter index
73 |
74 | // Mutex locks for DirectX 9 shared texture access
75 | bool CreateAccessMutex(const char *name, HANDLE &hAccessMutex);
76 | void CloseAccessMutex(HANDLE &hAccessMutex);
77 | bool CheckAccess(HANDLE hAccessMutex, ID3D11Texture2D* pSharedTexture = NULL);
78 | void AllowAccess(HANDLE hAccessMutex, ID3D11Texture2D* pSharedTexture = NULL);
79 |
80 | // For debugging only - to toggle texture access locks disable/enable
81 | bool bUseAccessLocks;
82 |
83 | protected:
84 |
85 | IDXGIAdapter* GetAdapterPointer(int index); // Get adapter pointer for DirectX 11
86 | int g_AdapterIndex; // Used for DX9
87 | IDXGIAdapter* g_pAdapterDX11;
88 | ID3D11DeviceContext* g_pImmediateContext;
89 | D3D_DRIVER_TYPE g_driverType;
90 | D3D_FEATURE_LEVEL g_featureLevel;
91 |
92 | };
93 |
94 | #endif
95 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/projector.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include "plane.h"
4 | #include "mask.h"
5 | #include "curves.h"
6 |
7 | namespace vd {
8 | class Command;
9 | class Projector {
10 |
11 | public:
12 | void init(int i, int pStartingIndex);
13 | void setup();
14 | void begin();
15 | void end();
16 | void bind();
17 | void unbind();
18 | void draw();
19 |
20 | void drawPlaneConfig();
21 | void drawKeystone();
22 | void drawCurves(int x, int y);
23 |
24 | void mousePressed(ofMouseEventArgs& mouseArgs);
25 | void mouseDragged(ofMouseEventArgs& mouseArgs);
26 | void mouseReleased(ofMouseEventArgs& mouseArgs);
27 |
28 | void keyPressed(int key);
29 | void keyReleased(int key);
30 |
31 | void loadXML(ofXml &xml);
32 | void loadXML2(ofXml &xml);
33 | void saveXML(ofXml &xml);
34 |
35 | Command* execute(float v);
36 | Command* executeBrush();
37 | Command* reset();
38 |
39 | // plane
40 | ofVec2f getPlanePosition();
41 | void setPlanePosition(float x, float y);
42 |
43 | ofVec2f getPlaneDimensions();
44 | void setPlaneDimensions(float w, float h);
45 |
46 | // keystone
47 | bool getKeystoneActive();
48 | void setKeystoneActive(bool v);
49 |
50 | vector getKeystonePoints();
51 | void setKeystonePoints(vector pts);
52 |
53 | // grid
54 | bool getGridActive();
55 | void setGridActive(bool v);
56 |
57 | vector getGridPoints();
58 | void setGridPoints(vector v);
59 |
60 | // camera
61 | void setCameraTransform();
62 |
63 | ofVec3f getCameraPosition();
64 | void setCameraPosition(float azi, float ele, float dis);
65 |
66 | ofVec3f getCameraOrientation();
67 | void setCameraOrientation(float roll, float tilt, float pan);
68 |
69 | float getCameraFov();
70 | void setCameraFov(float v);
71 |
72 | ofVec2f getCameraOffset();
73 | void setCameraOffset(float x, float y);
74 |
75 | ofVec2f getCameraScale();
76 | void setCameraScale(float x, float y);
77 |
78 | vector getCameraShear();
79 | void setCameraShear(vector);
80 | ofTexture& getTextureReference();
81 |
82 | int index;
83 | bool keyboard;
84 | bool mouse;
85 | bool active;
86 | bool enable;
87 | int editMode;
88 | bool mod;
89 | bool all;
90 | void setValue(float v);
91 | Mask mask;
92 | ofFbo renderFbo;
93 |
94 | ofVboMesh renderPlane;
95 |
96 | // intensity
97 | float brightness;
98 | float contrast;
99 |
100 | // color
101 | float hue;
102 | float saturation;
103 | float lightness;
104 |
105 | Plane plane;
106 |
107 | vector lastKey;
108 | vector lastGrid;
109 |
110 | int width, height;
111 |
112 | // color curves
113 | Curves curves;
114 |
115 | int projectorStartingIndex;
116 |
117 | enum editModes{
118 | BRIGHTNESS,CONTRAST,SATURATION,
119 | CURVES,
120 | CORNERPIN, GRID,
121 | AZIMUTH, ELEVATION, DISTANCE,
122 | ROLL, TILT, PAN,
123 | FOV, OFFSET_X, OFFSET_Y,
124 | NONE, BRUSH_SCALE, BRUSH_OPACITY, WHITE, BLACK, ENABLE};
125 |
126 | private:
127 | ofVec3f sphToCar(ofVec3f t);
128 | float round(float d);
129 | float roundTo(float val, float n);
130 |
131 | ofCamera camera;
132 | ofFbo fbo;
133 | ofRectangle view;
134 |
135 | float value;
136 | int fboSample;
137 | string xmlPrefix;
138 |
139 | // plane
140 | ofVec2f planePosition;
141 |
142 | // camera
143 | ofVec3f cameraPosition;
144 | ofVec3f cameraOrientation;
145 | float cameraFov;
146 | ofVec2f cameraOffset;
147 | ofVec2f cameraScale;
148 | vector cameraShear;
149 |
150 | ofMatrix4x4 transform;
151 | };
152 |
153 |
154 |
155 | }
156 |
--------------------------------------------------------------------------------
/src/vdome/menu/menu.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "ofMain.h"
3 | #include "projector.h"
4 |
5 | namespace vd {
6 |
7 | class Item {
8 | public:
9 | string str;
10 | bool isParent;
11 | Item(string s){
12 | str = s;
13 | isParent = false;
14 | }
15 | Item(string s, bool p){
16 | str = s;
17 | isParent = p;
18 | }
19 | };
20 |
21 |
22 | class Menu {
23 | public:
24 | Menu();
25 |
26 | void setup();
27 | void update();
28 |
29 | // draw methods
30 | void draw(int i, int labelIndex);
31 | void drawMain(int i);
32 |
33 | void drawProjector(int i);
34 | void drawFPS(int i);
35 | void drawHighlight();
36 | void drawBackground();
37 | void drawSaved();
38 | void drawActive(int i);
39 | void drawWarp(int i);
40 | void drawCurves(int i);
41 |
42 | // navigation
43 | void select();
44 | void back();
45 | void setEditMode();
46 |
47 | // mouse methods
48 | void mousePressed(ofMouseEventArgs& mouseArgs);
49 | void mouseDragged(ofMouseEventArgs& mouseArgs);
50 | void mouseReleased(ofMouseEventArgs& mouseArgs);
51 |
52 | // keyboard methods
53 | void keyPressed(int key);
54 | void keyReleased(int key);
55 |
56 | // utils
57 | void toggle();
58 | float roundTo(float val, float n);
59 | float round(float d);
60 |
61 | // menu item
62 | struct MenuItem {
63 | int currentItem;
64 | vector- items;
65 | int menuId;
66 | MenuItem **parent;
67 | };
68 |
69 | // menu objects
70 | MenuItem *menuMain;
71 | MenuItem *menuInput;
72 | MenuItem *menuInputVideo;
73 | MenuItem *menuInputTransform;
74 | MenuItem *menuWarp;
75 | MenuItem *menuBlend;
76 | MenuItem *menuBrush;
77 | MenuItem *menuColor;
78 | MenuItem *menuCurves;
79 | MenuItem *menuCurvesGrey;
80 | MenuItem *menuCurvesRed;
81 | MenuItem *menuCurvesGreen;
82 | MenuItem *menuCurvesBlue;
83 | MenuItem *menuSetup;
84 | MenuItem *menuPosition;
85 | MenuItem *menuOrientation;
86 | MenuItem *menuFov;
87 | MenuItem *menuLens;
88 | MenuItem *menuScale;
89 | MenuItem *menuShear;
90 | MenuItem **currentMenu;
91 |
92 | // menu types
93 | enum menus {MAIN, WARP, BLEND, COLOR,
94 | CURVES, CURVES_GREY, CURVES_RED, CURVES_GREEN, CURVES_BLUE,
95 | SETUP, POSITION, ORIENTATION, FIELD_OF_VIEW, LENS, BRUSH};
96 |
97 | // menu item types
98 | enum mainItems {ENABLE};
99 | enum warpItems {CORNERPIN, GRID};
100 | enum blendItems {B_BRUSH};
101 | enum brushItems {BRUSH_SCALE, BRUSH_OPACITY};
102 | enum colorItems {BRIGHTNESS, CONTRAST, SATURATION, COLOR_CURVES};
103 | enum posItems {AZIMUTH, ELEVATION, DISTANCE};
104 | enum orienItems {TILT, ROLL, PAN};
105 | enum fovItems {FOV};
106 | enum lensItems {OFFSET_X, OFFSET_Y};
107 |
108 | // layout
109 | int px;
110 | int py;
111 | int pw;
112 | int ph;
113 | int padx;
114 | int pady;
115 |
116 | // keyboard
117 | bool all;
118 | int cKey;
119 |
120 | // value
121 | float value;
122 | float orgValue;
123 | float ctrlValue;
124 | float altValue;
125 |
126 | // projector
127 | vector *projectors; // list of projectors
128 | int projCount; // projector count
129 | int projectorStartingIndex; // first projector index within the window
130 |
131 | // input sources
132 | int inputSource;
133 | enum inputSources {SOURCE_MEDIA, SOURCE_CAPTURE, SOURCE_SYPHON, SOURCE_SPOUT, SOURCE_GRID, SOURCE_BLACK, SOURCE_WHITE, SOURCE_GREY, SOURCE_COLOR};
134 |
135 | // menu states
136 | int frameCnt; // frame cout for saved items
137 | bool saved; // saved state
138 | bool active; // active state
139 | int pActive; // projector active state
140 | int storedSource; // stored source, used for input overrides
141 | ofVec3f currentColor; // current color, used for color overrides
142 |
143 | static ofEvent sourceColorEvent; // event for
144 | static ofEvent colorEvent;
145 |
146 | private:
147 | ofVec3f updateColorFromCurve(int pointIndex, bool forceGrey);
148 | void changeColorCurveMode(int i);
149 | int curvePointIndex;
150 | bool newCurvePointIndex;
151 | };
152 |
153 | }
154 |
--------------------------------------------------------------------------------
/src/vdome/input/media/video/videoWin.cpp:
--------------------------------------------------------------------------------
1 | #include "videoWin.h"
2 | using namespace vd;
3 |
4 | VideoWin::VideoWin() {
5 | forceVideoRenderer = "";
6 | bLoop = false;
7 | bLoaded = false;
8 | fPath = "";
9 | }
10 |
11 | void VideoWin::open(string filepath){
12 | bEnd = false;
13 | fPath = filepath;
14 | bLoaded = false;
15 | if (forceVideoRenderer.length() > 0){
16 | vType = parseForceRenderer(forceVideoRenderer);
17 | switch (vType) {
18 | case WMF: vWMF.open(filepath); break;
19 | case DS: bLoaded = vDS.open(filepath); break;
20 | }
21 | }
22 | else{
23 | vType = WMF;
24 | vWMF.open(filepath);
25 | }
26 | }
27 |
28 | void VideoWin::update(){
29 | switch (vType) {
30 | case WMF:
31 | if (vWMF.isLoaded()){
32 | if (vWMF.isSupported()){
33 | bLoaded = true;
34 | }
35 | else if (parseForceRenderer(forceVideoRenderer) != WMF){
36 | vType = DS;
37 | bLoaded = vDS.open(fPath);
38 | return;
39 | }
40 | }
41 | vWMF.update(); break;
42 | case DS: vDS.update(); break;
43 | }
44 | if (getIsMovieDone()) {
45 | bEnd = true;
46 | ofNotifyEvent(endEvent,bEnd,this);
47 | }
48 | }
49 |
50 | void VideoWin::play(){
51 | switch (vType) {
52 | case WMF: vWMF.play(); break;
53 | case DS: vDS.play(); break;
54 | }
55 | }
56 |
57 | void VideoWin::stop(){
58 | switch (vType) {
59 | case WMF: vWMF.stop(); break;
60 | case DS: vDS.stop(); break;
61 | }
62 | }
63 |
64 | void VideoWin::close(){
65 | switch (vType) {
66 | case WMF: vWMF.close(); break;
67 | case DS: vDS.close(); break;
68 | }
69 | }
70 |
71 | void VideoWin::seek(float f){
72 | switch (vType) {
73 | case WMF: vWMF.seek(f); break;
74 | case DS: vDS.seek(f); break;
75 | }
76 | }
77 |
78 | bool VideoWin::isPlaying(){
79 | bool val;
80 | switch (vType) {
81 | case WMF: val = vWMF.isPlaying(); break;
82 | case DS: val = vDS.isPlaying(); break;
83 | }
84 | return val;
85 | }
86 |
87 | void VideoWin::setLoop(bool lp){
88 | bLoop = lp;
89 | vWMF.setLoop(lp);
90 | vDS.setLoop(lp);
91 | }
92 |
93 | float VideoWin::getPosition(){
94 | float val;
95 | switch (vType) {
96 | case WMF: val = vWMF.getPosition(); break;
97 | case DS: val = vDS.getPosition(); break;
98 | }
99 | return val;
100 | }
101 |
102 | float VideoWin::getDuration(){
103 | float val;
104 | switch (vType) {
105 | case WMF: val = vWMF.getDuration(); break;
106 | case DS: val = vDS.getDuration(); break;
107 | }
108 | return val;
109 | }
110 |
111 | bool VideoWin::getIsMovieDone(){
112 | bool val;
113 | switch (vType) {
114 | case WMF: val = vWMF.getIsMovieDone(); break;
115 | case DS: val = vDS.getIsMovieDone(); break;
116 | }
117 | return val;
118 | }
119 |
120 | void VideoWin::setVolume(float v){
121 | switch (vType) {
122 | case WMF: vWMF.setVolume(v); break;
123 | case DS: vDS.setVolume(v); break;
124 | }
125 | }
126 |
127 | bool VideoWin::isLoaded(){
128 | return bLoaded;
129 | }
130 |
131 | VideoWin::VideoTypes VideoWin::parseForceRenderer(string renderer){
132 | VideoTypes type;
133 | renderer = ofToLower(renderer);
134 | if (renderer == "wmf")
135 | type = WMF;
136 | else
137 | type = DS;
138 | return type;
139 | }
140 |
141 | float VideoWin::getWidth(){
142 | float val;
143 | switch (vType) {
144 | case WMF: val = vWMF.getWidth(); break;
145 | case DS: val = vDS.getWidth(); break;
146 | }
147 | return val;
148 | }
149 |
150 | float VideoWin::getHeight(){
151 | float val;
152 | switch (vType) {
153 | case WMF: val = vWMF.getHeight(); break;
154 | case DS: val = vDS.getHeight(); break;
155 | }
156 | return val;
157 | }
158 |
159 | ofPixels& VideoWin::getPixels() {
160 | switch (vType) {
161 | //case WMF: return vWMF.getPixels(); //fix
162 | case DS: return vDS.getPixels();
163 | }
164 | }
165 |
166 | void VideoWin::bind() {
167 | switch (vType) {
168 | case WMF: return vWMF.bind();
169 | case DS: return vDS.bind();
170 | }
171 | }
172 |
173 | void VideoWin::unbind() {
174 | switch (vType) {
175 | case WMF: return vWMF.unbind();
176 | case DS: return vDS.unbind();
177 | }
178 | }
179 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutMemoryShare.h:
--------------------------------------------------------------------------------
1 | /*
2 | spoutMemoryShare.h
3 |
4 | Class used for Spout inter-process communication
5 |
6 | Semaphore single reader/writer version
7 |
8 | Last modifed : 11.02.14
9 |
10 | The purpose is to establish a fixed shared memory map for an RGB image the size of the desktop (1920x1080)
11 | and semaphores to control read/write access for sharing a bitmap image between sender and receiver
12 | Only one sender and receiver is assumed.
13 |
14 | bool Initialize();
15 | Initialize memory map and read/write semaphores
16 |
17 | void DeInitialize();
18 | Close memory map and semaphore handles
19 |
20 | void CreateSenderMutex();
21 | // Create a mutex by the sender which is checked by a receiver
22 |
23 | void ReleaseSenderMutex();
24 | // for a sender to release its mutex on close
25 |
26 | bool CheckSenderMutex();
27 | // for a receiver to check the presence of a sender
28 | // If the mutex does not exist, the semaphore read wait is skipped
29 |
30 | bool ReadFromMemory(unsigned char *buffer, int numBytes, int offset = 0);
31 | // Read from shared memory
32 | // Offset is useful for example when reading a bitmap to skip the bitmap header
33 |
34 | bool WriteToMemory(unsigned char *buffer, int numBytes);
35 | // Write to shared memory
36 |
37 | void setSharedMemoryName(char* sharedMemoryName);
38 | // to set names of mapping and semaphores externally
39 | // otherwise a default name is used
40 |
41 |
42 | Copyright (c) 2014>, Lynn Jarvis. All rights reserved.
43 |
44 | Redistribution and use in source and binary forms, with or without modification,
45 | are permitted provided that the following conditions are met:
46 |
47 | 1. Redistributions of source code must retain the above copyright notice,
48 | this list of conditions and the following disclaimer.
49 |
50 | 2. Redistributions in binary form must reproduce the above copyright notice,
51 | this list of conditions and the following disclaimer in the documentation
52 | and/or other materials provided with the distribution.
53 |
54 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
55 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
56 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
57 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
58 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
59 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
60 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
61 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
62 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 |
64 | */
65 |
66 | #ifndef __spoutMemoryShare__
67 | #define __spoutMemoryShare__
68 |
69 | // #define CONSOLE_DEBUG // to activate debug console messages
70 |
71 | #include "SpoutCommon.h"
72 | #include
73 | #include
74 |
75 | class SPOUT_DLLEXP spoutMemoryShare {
76 |
77 | public:
78 |
79 | spoutMemoryShare();
80 | ~spoutMemoryShare();
81 | bool Initialize();
82 | void DeInitialize();
83 | // Create a mutex by the sender which is checked by a receiver
84 | // If the mutex does not exist, the semaphore read wait is skipped
85 | void CreateSenderMutex(); // for a sender to set a mutex for a receiver to test
86 | void ReleaseSenderMutex(); // for a receiver to release the mutex if a sender is present
87 | bool CheckSenderMutex(); // for a receiver to check the presence of a sender
88 | bool GetImageSizeFromSharedMemory(unsigned int &width, unsigned int &height);
89 | bool ReadFromMemory(unsigned char *buffer, int numBytes, int offset = 0);
90 | bool WriteToMemory(unsigned char *buffer, int numBytes);
91 | void setSharedMemoryName(char* sharedMemoryName); // to set names of mapping and semaphores externally
92 | char szShareMemoryName[256]; // name of the shared memory (made public for FFGL plugins)
93 |
94 | protected:
95 |
96 | LPTSTR pBuffer; // shared memory pointer
97 | HANDLE hSharedMemory; // handle to shared memory
98 | HANDLE hReadSemaphore;
99 | HANDLE hWriteSemaphore;
100 | HANDLE hSenderMutex; // Mutex that gets set by a sender
101 | char szReadSemaphoreName[256]; // name of the read semaphore
102 | char szWriteSemaphoreName[256]; // name of the read semaphore
103 |
104 |
105 | };
106 |
107 | #endif
108 |
109 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/spoutR.cpp:
--------------------------------------------------------------------------------
1 | #include "spoutR.h"
2 |
3 | /******************************************
4 |
5 | SETUP
6 |
7 | ********************************************/
8 |
9 | void SpoutR::setup(){
10 | spoutreceiver = new SpoutReceiver; // Create a Spout receiver object
11 | bInitialized = false; // Spout receiver initialization
12 | SenderName[0] = 0; // the name will be filled when the receiver connects to a sender
13 |
14 | // Allocate a texture for shared texture transfers
15 | // An openFrameWorks texture is used so that it can be drawn.
16 | g_Width = ofGetWidth();
17 | g_Height = ofGetHeight();
18 |
19 | if (texture.getWidth() != g_Width && texture.getHeight() != g_Height)
20 | texture.allocate(g_Width, g_Height, GL_RGBA); // Allocate a texture for shared texture transfers
21 | }
22 |
23 | /******************************************
24 |
25 | UPDATE
26 |
27 | ********************************************/
28 |
29 | void SpoutR::update() {
30 | char str[256];
31 | ofSetColor(255);
32 | unsigned int width, height;
33 | char tempname[256]; // temp name
34 |
35 | // A render window must be available for Spout initialization
36 | // and might not be available in "update", so do it now
37 | // when there is definitely a render window.
38 | //
39 | // INITIALIZE A RECEIVER
40 | //
41 | // The receiver will attempt to connect to the name it is sent.
42 | // Alternatively set the optional bUseActive flag to attempt to connect to the active sender.
43 | // If the sender name is not initialized it will attempt to find the active sender
44 | // If the receiver does not find any senders the initialization will fail
45 | // and "CreateReceiver" can be called repeatedly until a sender is found.
46 | // "CreateReceiver" will update the passed name, and dimensions.
47 | if (!bInitialized) {
48 | // Create the receiver and specify true to attempt to connect to the active sender
49 | if (spoutreceiver->CreateReceiver(SenderName, width, height, true)) {
50 |
51 | // Is the size of the detected sender different ?
52 | if (width != g_Width || height != g_Height) {
53 | // The sender dimensions have changed so update the global width and height
54 | g_Width = width;
55 | g_Height = height;
56 | // Update the local texture to receive the new dimensions
57 | texture.allocate(g_Width, g_Height, GL_RGBA);
58 | }
59 | bInitialized = true;
60 | return; // quit for next round
61 | } // receiver was initialized
62 | else {
63 | sprintf(str, "No sender detected");
64 | ofDrawBitmapString(str, 20, 20);
65 | }
66 | } // end initialization
67 |
68 | // The receiver has initialized so OK to draw
69 | if (bInitialized) {
70 |
71 | // Save current global width and height - they will be changed
72 | // by ReceiveTexture if the sender changes dimensions
73 | width = g_Width;
74 | height = g_Height;
75 |
76 | // Try to receive into the local the texture at the current size
77 | // NOTE: If a host calls ReceiveTexture with a framebuffer object bound,
78 | // include the FBO id in the ReceiveTexture call so that the binding is restored
79 | // afterwards because Spout makes use of its own FBO for intermediate rendering.
80 | if (spoutreceiver->ReceiveTexture(SenderName, width, height, texture.getTextureData().textureID, texture.getTextureData().textureTarget)) {
81 |
82 | // If the width and height are changed, the local texture has to be resized.
83 | if (width != g_Width || height != g_Height) {
84 | // Update the global width and height
85 | g_Width = width;
86 | g_Height = height;
87 | // Update the local texture to receive the new dimensions
88 | texture.allocate(g_Width, g_Height, GL_RGBA);
89 | return; // quit for next round
90 | }
91 |
92 | }
93 | else {
94 | // A texture read failure might happen if the sender
95 | // is closed. Release the receiver and start again.
96 | spoutreceiver->ReleaseReceiver();
97 | bInitialized = false;
98 | return;
99 | }
100 | }
101 | }
102 |
103 | /******************************************
104 |
105 | BIND
106 |
107 | ********************************************/
108 |
109 | void SpoutR::bind() {
110 | texture.bind();
111 | }
112 |
113 | void SpoutR::unbind() {
114 | texture.unbind();
115 | }
116 |
117 | /******************************************
118 |
119 | EXIT
120 |
121 | ********************************************/
122 |
123 | void SpoutR::exit() {
124 | spoutreceiver->ReleaseReceiver(); // Release the receiver
125 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | vDome
2 | =====
3 |
4 | Multi-channel projection software designed for domes. Provides real-time warping and slicing for domemaster input.
5 | Developed by Charles Veasey for the Institute of American Indian Arts (IAIA).
6 |
7 | Windows Builds:
8 | https://drive.google.com/drive/folders/0B4gYtwXbgYOhZXlMSUlkV1lCUEU
9 |
10 | v0.1) The version that matches the [manual](https://docs.google.com/document/d/1EHPpExjznFF6X0YTY5acLS0MNkEbtVFsLBCoJ2HHQlQ).
11 |
12 | v0.2) The unfinished version including the media player.
13 |
14 | Note: this project is no longer active. You may want to check out this actively developed software:
15 | https://github.com/paperManu/splash
16 |
17 |
18 | ## Overview
19 |
20 | vDome is an application designed to calibrate multiple projectors on a hemispherical dome surface and display a domemaster formatted video, image, or interactive application. vDome also supports the playback of HD video files. vDome is generally used in two ways: 1) as a media player and 2) as a background process that listens to hardware/software input streams such as cameras, capture cards, and inter-application protocols such as Syphon, Spout, and Video4Linux.
21 |
22 | As a media player vDome utilizes native os media libraries and accepts most common file formats and codecs of the operating system. In general:
23 | - Mac OS X: QuickTime, AV Foundation, HAP
24 | - Win 7/8: Windows Media Foundation, DirectShow, QuickTime, HAP
25 | - Linux: GStreamer
26 |
27 | For optimized video playback, use the following codecs:
28 | - OS X: ProRes 422 and H.264
29 | - Windows 8.1: H.264 and WMF
30 | - Linux Ubuntu: H.264
31 |
32 | To assist in media playback and creating playlists check out the vDome Player interface:
33 | https://github.com/charlesveasey/vDome-player
34 |
35 | Capture and camera inputs are hardware video stream solutions. A capture card is a flexible solution that allows one to run any application on the dome by sending the video output of one computer into another machine running vDome. With this, vDome essentially becomes the 2nd monitor on your production machine. Drag the After Effects or Unity preview window onto the dome and edit in real-time, play videos through your favorite media player: Quicktime, VLC, etc.
36 |
37 | Syphon is a graphic interapplication protocol for OS X:
38 | http://syphon.v002.info
39 |
40 | Spout is a graphic interapplication protocol for Windows:
41 | http://spout.zeal.co
42 |
43 | Video4Linux is a graphic interapplication protocol for Linux:
44 | http://en.wikipedia.org/wiki/Video4Linux
45 |
46 | ## Compiling
47 | #### All
48 | - Download the latest version of openFrameworks (currently v0.8.4): http://www.openframeworks.cc/download/
49 | - Clone this (vDome) repository to openFrameworks/apps/myApps
50 | - Clone to: openFrameworks/addons:
51 | - https://github.com/charlesveasey/ofxBezierSurface
52 | - https://github.com/charlesveasey/ofxCurvesTool
53 |
54 | #### Mac
55 | - Suggested IDE: Xcode v5.1.1
56 | - Syphon needs to be copied to Frameworks
57 | - Under target, add a Copy Files Build Phase. Drag the Syphon.framework into this phase.
58 | - Clone to: openFrameworks/addons:
59 | - https://github.com/astellato/ofxSyphon
60 |
61 | #### Win
62 | - Suggested IDE: Microsoft Visual Studio Express 2012
63 | - ofxWMFPLayer requries updated GLEW library, follow instructions on its repository
64 | - Clone to: openFrameworks/addons:
65 | - https://github.com/charlesveasey/ofxWMFVideoPlayer
66 |
67 | #### Linux
68 | - Install openFrameworks dependencies, see INSTALL.md in openFrameworks linux package
69 | - Suggested IDE: Code::Blocks 10.04
70 | - Can also run make in root directory
71 |
72 | ## Installation
73 | #### Mac
74 | - To use the HAP codec:
75 | - https://github.com/vidvox/hap-qt-codec
76 |
77 | #### Win
78 | - To use Spout, copy the Spout32.dll to your build directory:
79 | - http://spout.zeal.co/
80 | - To allow QuickTime video playback install the K-Lite Mega Codec Pack 10.2:
81 | - http://www.free-codecs.com/download/k_lite_mega_codec_pack.htm
82 |
83 | #### Linux
84 | - Install gstreamer codecs, see INSTALL.md in openFrameworks linux package
85 | - To use Video4Linux:
86 | - https://github.com/umlaeute/v4l2loopback
87 |
88 | ## Setup and Calibration
89 | Initial setup is done in XML (setting resolution, number of projectors, and input type). Calibration is done directly on the dome. For more information see the manual:
90 | https://docs.google.com/document/d/1EHPpExjznFF6X0YTY5acLS0MNkEbtVFsLBCoJ2HHQlQ/
91 |
92 | ---
93 | Funding provided by the United States Department of Defense. Based on prior research from the University of New Mexico (UNM) and IAIA with funding provided by the National Science Foundation.
94 |
95 | Thanks to research by the ARTS Labs at UNM and Paul Bourke at the University of Western Australia.
96 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/curves.cpp:
--------------------------------------------------------------------------------
1 | #include "Curves.h"
2 | namespace vd {
3 |
4 | extern int cCurveIndex;
5 |
6 | Curves::Curves() {
7 | curveCnt = 4;
8 | lutRes = 256;
9 | show = true;
10 | enabled = false;
11 | index = 0;
12 | colorMode = GREY;
13 | xml = new ofXml;
14 | }
15 |
16 | void Curves::init(int i) {
17 | index = i;
18 | }
19 |
20 | void Curves::setup() {
21 |
22 | for(int i = 0; i < curveCnt; i++) {
23 | curvesTools.push_back(new ofxCurvesTool);
24 | curvesTools.at(i)->setup();
25 | curvesTools.at(i)->mouseAddsPoint = false;
26 | curvesTools.at(i)->useKey(false);
27 | curvesTools.at(i)->keepFocus = true;
28 | curvesTools.at(i)->mouseMovesPoint = false;
29 |
30 | for(int j = 1; j < 8; j++) {
31 | curvesTools.at(i)->add(ofVec2f(ofClamp(j*lutRes/8, 0, lutRes-1),ofClamp(j*lutRes/8, 0, lutRes-1)));
32 | }
33 | }
34 |
35 | colorlut.allocate(lutRes, lutRes, OF_IMAGE_COLOR_ALPHA);
36 |
37 | for(int x = 0; x < 256; x++) {
38 | for(int y = 0; y < 256; y++) {
39 | colorlut.setColor(x, y, ofColor(x,x,x,x));
40 | }
41 | }
42 |
43 | setCurrentHover(0);
44 | update();
45 |
46 | setActive(false);
47 | }
48 |
49 | void Curves::update() {
50 | if (!curvesTools.size()) return;
51 |
52 | bool n = curvesTools.at(colorMode)->isLutNew();
53 |
54 | for(int x = 0; x < lutRes; x++) {
55 | for(int y = 0; y < lutRes; y++) {
56 | if (n){
57 | colorlut.setColor(x, y, ofColor(
58 | ofClamp(curvesTools.at(1)->getLut(x), 0, lutRes-1),
59 | ofClamp(curvesTools.at(2)->getLut(x), 0, lutRes-1),
60 | ofClamp(curvesTools.at(3)->getLut(x), 0, lutRes-1),
61 | ofClamp(curvesTools.at(0)->getLut(x), 0, lutRes-1)));
62 | }
63 | }
64 | }
65 |
66 | colorlut.update();
67 | }
68 |
69 | void Curves::draw(int x, int y) {
70 | if(show || enabled) {
71 | curvesTools.at(colorMode)->draw(x,y);
72 | }
73 | }
74 |
75 | void Curves::keyPressed(int key) {
76 |
77 | if(key == OF_KEY_UP) {
78 | incrementPoint(1);
79 | }
80 | else if(key == OF_KEY_DOWN) {
81 | incrementPoint(-1);
82 | }
83 |
84 | update();
85 | }
86 |
87 | void Curves::incrementPoint(float inc) {
88 | int cpnt = curvesTools.at(colorMode)->getCurrentHover();
89 | curvesTools.at(colorMode)->set(cpnt,
90 | ofVec2f( curvesTools.at(colorMode)->getPoint(cpnt).x,
91 | curvesTools.at(colorMode)->getPoint(cpnt).y + inc));
92 | }
93 |
94 | void Curves::prevPoint() {
95 | curvesTools.at(colorMode)->prevPoint();
96 | }
97 |
98 | void Curves::nextPoint() {
99 | curvesTools.at(colorMode)->nextPoint();
100 | }
101 |
102 | void Curves::load(int projectorStartingIndex) {
103 | xml->clear();
104 | xml->load("settings/color/color-"+ofToString(index+1+projectorStartingIndex)+".xml");
105 |
106 | xml->setTo("projector");
107 |
108 | int n = xml->getNumChildren();
109 |
110 | for(int i = 0; i < n; i++) {
111 | xml->setToChild(i);
112 | curvesTools.at(i)->clear();
113 |
114 | int nn = xml->getNumChildren();
115 |
116 | for(int j = 0; j < nn; j++) {
117 | if (xml->exists("point["+ofToString(j)+"][@xy]")) {
118 | string str = xml->getAttribute("point["+ofToString(j)+"][@xy]");
119 | int x = ofToInt(ofSplitString(str, ",")[0]);
120 | int y = ofToInt(ofSplitString(str, ",")[1]);
121 | curvesTools.at(i)->add(ofVec2f(x,y));
122 | }
123 | }
124 | xml->setToParent();
125 | }
126 |
127 | update();
128 | }
129 |
130 | void Curves::save(int projectorStartingIndex) {
131 | xml->clear();
132 | xml->addChild("projector");
133 | xml->setTo("projector");
134 |
135 | for(int i = 0; i < 4; i++) {
136 | xml->addChild("curve");
137 | xml->setToChild(i);
138 |
139 | if (i == GREY)
140 | xml->setAttribute("color", "grey");
141 | if (i == RED)
142 | xml->setAttribute("color", "red");
143 | if (i == GREEN)
144 | xml->setAttribute("color", "green");
145 | if (i == BLUE)
146 | xml->setAttribute("color", "blue");
147 |
148 | vector pnts = curvesTools.at(i)->getControlPoints();
149 |
150 | for(int j = 0; j < pnts.size(); j++) {
151 | xml->addChild("point");
152 | xml->setToChild(j);
153 | xml->setAttribute("xy", ofToString(pnts[j].x) + "," + ofToString(pnts[j].y));
154 | xml->setToParent();
155 | }
156 | xml->setToParent();
157 | }
158 | xml->setToParent();
159 |
160 | xml->save("settings/color/color-"+ofToString(index+1+projectorStartingIndex)+".xml");
161 | }
162 |
163 | int Curves::getCurrentHover() {
164 | return curvesTools.at(colorMode)->getCurrentHover();
165 | }
166 |
167 | void Curves::setCurrentHover(int i) {
168 | curvesTools.at(colorMode)->setCurrentHover(i);
169 | }
170 |
171 | int Curves::getColorMode() {
172 | return colorMode;
173 | }
174 | void Curves::setColorMode(int i) {
175 | colorMode = i;
176 | }
177 |
178 | ofTexture & Curves::colorlutTextureRef() {
179 | return colorlut.getTexture();
180 | }
181 |
182 | void Curves::setLabelPosition() {
183 | curvesTools.at(colorMode)->setLabelPosition();
184 | }
185 | void Curves::setLabelPosition(int x, int y) {
186 | curvesTools.at(colorMode)->setLabelPosition(x,y);
187 | }
188 |
189 | void Curves::setActive(bool b) {
190 | active = b;
191 | }
192 |
193 | void Curves::setPoint(int i, ofPoint p){
194 | curvesTools.at(colorMode)->set(i,p);
195 | }
196 |
197 | }
--------------------------------------------------------------------------------
/src/vdome/menu/socket.cpp:
--------------------------------------------------------------------------------
1 | #include "socket.h"
2 | namespace vd {
3 | ofEvent Socket::sourceEvent = ofEvent();
4 | ofEvent Socket::formatEvent = ofEvent();
5 |
6 | /******************************************
7 |
8 | CONSTRUCTOR
9 |
10 | ********************************************/
11 |
12 | Socket::Socket(){
13 | enabled = true;
14 | host = "localhost";
15 | send = 3333;
16 | receive = 3334;
17 | }
18 |
19 | /******************************************
20 |
21 | SETUP
22 |
23 | ********************************************/
24 |
25 | void Socket::setup(){
26 | oscSender.setup(host,send);
27 | oscReceiver.setup(receive);
28 | }
29 |
30 | /******************************************
31 |
32 | UPDATE
33 |
34 | ********************************************/
35 |
36 | void Socket::update(){
37 |
38 | // receive
39 | while(oscReceiver.hasWaitingMessages()){
40 | rMsg.clear();
41 | oscReceiver.getNextMessage(&rMsg);
42 |
43 | if (rMsg.getAddress() == "/input/"){
44 | if (rMsg.getArgAsString(0) == "play")
45 | input->play();
46 | else if (rMsg.getArgAsString(0) == "stop")
47 | input->stop();
48 | }
49 | else if (rMsg.getAddress() == "/input/loop/") {
50 | if (rMsg.getArgAsString(0) == "on")
51 | input->setLoop(true);
52 | else
53 | input->setLoop(false);
54 | }
55 | else if (rMsg.getAddress() == "/input/seek/") {
56 | input->seek(ofToFloat(rMsg.getArgAsString(0)));
57 | }
58 | else if (rMsg.getAddress() == "/input/source/") {
59 | int s = input->convertSourceString(rMsg.getArgAsString(0));
60 | ofNotifyEvent(sourceEvent,s,this);
61 | }
62 | else if (rMsg.getAddress() == "/input/file/") {
63 | ofFile oFile;
64 | oFile.open(rMsg.getArgAsString(0));
65 | string file = oFile.getAbsolutePath();
66 | input->openFile(file);
67 | }
68 | else if (rMsg.getAddress() == "/input/volume/") {
69 | input->setVolume(ofToFloat(rMsg.getArgAsString(0)));
70 | }
71 | else if (rMsg.getAddress() == "/input/format/") {
72 | int s = input->convertFormatString(rMsg.getArgAsString(0));
73 | ofNotifyEvent(formatEvent,s,this);
74 | }
75 |
76 | // transform
77 | else if (rMsg.getAddress() == "/input/flip/") {
78 | string s = rMsg.getArgAsString(0);
79 |
80 | if (rMsg.getArgAsString(0) == "on")
81 | model->setTextureFlip(true);
82 | else
83 | model->setTextureFlip(false);
84 | }
85 | else if (rMsg.getAddress() == "/input/scale/") {
86 | float f = ofToFloat(rMsg.getArgAsString(0));
87 | model->setTextureScale(f);
88 | }
89 | else if (rMsg.getAddress() == "/input/rotate/") {
90 | float f = ofToFloat(rMsg.getArgAsString(0));
91 | model->setTextureRotate(f);
92 | }
93 | else if (rMsg.getAddress() == "/input/tilt/") {
94 | float f = ofToFloat(rMsg.getArgAsString(0));
95 | model->setTextureTilt(f);
96 | }
97 | }
98 |
99 | // send
100 | sMsg.clear();
101 | if (input->getSourceInt() == input->MEDIA) {
102 | if (lastInputPosition != input->getPosition()){
103 | sMsg.setAddress("/input/position");
104 | sMsg.addStringArg(ofToString( input->getPosition() ));
105 | oscSender.sendMessage(sMsg);
106 | }
107 | lastInputPosition = input->getPosition();
108 | }
109 |
110 | }
111 |
112 |
113 | /******************************************
114 |
115 | SEND
116 |
117 | ********************************************/
118 |
119 | void Socket::sendDuration(){
120 | sMsg.clear();
121 | sMsg.setAddress("/input/duration");
122 | sMsg.addStringArg(input->getFilepath() + "," + ofToString( input->getDuration() ));
123 | oscSender.sendMessage(sMsg);
124 | }
125 |
126 | void Socket::sendEnd(){
127 | sMsg.clear();
128 | sMsg.setAddress("/input/");
129 | sMsg.addStringArg("end");
130 | oscSender.sendMessage(sMsg);
131 | }
132 |
133 | /******************************************
134 |
135 | SETTINGS
136 |
137 | ********************************************/
138 |
139 | void Socket::loadXML(ofXml &xml) {
140 | if (xml.exists("socket[@enabled]")) {
141 | string str = ofToString(xml.getAttribute("socket[@enabled]"));
142 | if (str == "on") enabled = true;
143 | else enabled = false;
144 | }
145 |
146 | if (xml.exists("socket[@host]"))
147 | host = ofToString( xml.getAttribute("socket[@host]") );
148 | if (xml.exists("socket[@send]"))
149 | send = ofToInt( xml.getAttribute("socket[@send]") );
150 | if (xml.exists("socket[@receive]"))
151 | receive = ofToInt( xml.getAttribute("socket[@receive]") );
152 |
153 | if (enabled)
154 | setup();
155 | }
156 |
157 | void Socket::saveXML(ofXml &xml) {
158 | xml.setTo("socket");
159 |
160 | if (enabled) xml.setAttribute("enabled", "on");
161 | else xml.setAttribute("enabled", "off");
162 |
163 | xml.setAttribute("host", ofToString(host));
164 | xml.setAttribute("send", ofToString(send));
165 | xml.setAttribute("receive", ofToString(receive));
166 |
167 | xml.setToParent();
168 | }
169 |
170 | }
171 |
--------------------------------------------------------------------------------
/src/vdome/renderer/projector/mask.cpp:
--------------------------------------------------------------------------------
1 | #include "mask.h"
2 | namespace vd {
3 |
4 | extern int maxHistory;
5 | extern vector maskHistory;
6 |
7 | /******************************************
8 |
9 | CONSTRUCTOR
10 |
11 | ********************************************/
12 |
13 | Mask::Mask(){
14 | erase = false;
15 |
16 | mouseX = 0;
17 | mouseY = 0;
18 |
19 | tx = 0;
20 | ty = 0;
21 |
22 | mouseDown = false;
23 | maskFboImage = new ofImage();
24 | brushImage.setUseTexture(true);
25 | brushImage.setImageType(OF_IMAGE_COLOR_ALPHA);
26 | brushImage.load("settings/brushes/brush.png");
27 | brushWidth = brushImage.getWidth();
28 | brushHeight = brushImage.getHeight();
29 | brushScale = 1;
30 | brushOpacity = 50;
31 |
32 | brush = ofMesh::plane(brushWidth, brushHeight, 2, 2, OF_PRIMITIVE_TRIANGLES);
33 |
34 | hIndex = 0;
35 | bufferAllocated = false;
36 | }
37 |
38 | /******************************************
39 |
40 | INIT
41 |
42 | ********************************************/
43 |
44 | void Mask::init(int i){
45 | pIndex = i;
46 | }
47 |
48 | /******************************************
49 |
50 | SETUP
51 |
52 | ********************************************/
53 |
54 | void Mask::setup(){
55 |
56 | if (maskFbo.getWidth() != width || maskFbo.getHeight() != height)
57 | maskFbo.allocate(width, height, GL_RGBA32F_ARB);
58 |
59 | maskFbo.begin();
60 | ofClear(255,255,255,0);
61 | maskFbo.end();
62 |
63 | if (maskFboImage->isAllocated()) {
64 | ofDisableAlphaBlending();
65 | ofDisableNormalizedTexCoords();
66 | maskFbo.begin();
67 | ofSetColor(255, 255, 255, 255);
68 | maskFboImage->draw(0,0, width, height);
69 | maskFbo.end();
70 | ofEnableNormalizedTexCoords();
71 | ofEnableAlphaBlending();
72 | }
73 | }
74 |
75 | /******************************************
76 |
77 | DRAW
78 |
79 | ********************************************/
80 |
81 | void Mask::draw(){
82 | if (mouseDown) {
83 |
84 | if (erase)
85 | ofEnableBlendMode(OF_BLENDMODE_SUBTRACT);
86 | else
87 | ofEnableBlendMode(OF_BLENDMODE_SCREEN);
88 |
89 | maskFbo.begin();
90 | brushImage.bind();
91 | ofSetColor(brushOpacity, brushOpacity, brushOpacity, brushOpacity);
92 | ofPushMatrix();
93 | ofTranslate(mouseX-tx, mouseY);
94 | ofScale(brushScale, brushScale);
95 | brush.draw();
96 | ofPopMatrix();
97 | brushImage.unbind();
98 | maskFbo.end();
99 |
100 | ofDisableBlendMode();
101 | ofEnableBlendMode(OF_BLENDMODE_ALPHA);
102 | }
103 | }
104 |
105 | /******************************************
106 |
107 | MOUSE
108 |
109 | ********************************************/
110 |
111 | void Mask::mousePressed(ofMouseEventArgs& mouseArgs){
112 | mouseDown = true;
113 | mouseX = mouseArgs.x;
114 | mouseY = mouseArgs.y;
115 | if (hIndex >= (maxHistory+2) )
116 | hIndex = 0;
117 | store(hIndex);
118 | }
119 |
120 | void Mask::mouseDragged(ofMouseEventArgs& mouseArgs){
121 | mouseX = mouseArgs.x;
122 | mouseY = mouseArgs.y;
123 | }
124 |
125 | void Mask::mouseReleased(ofMouseEventArgs& mouseArgs){
126 | mouseDown = false;
127 | }
128 |
129 | /******************************************
130 |
131 | KEYBOARD
132 |
133 | ********************************************/
134 |
135 | void Mask::keyPressed(int key){
136 | if (key == OF_KEY_CONTROL || key == OF_KEY_COMMAND) {
137 | erase = true;
138 | }
139 | }
140 |
141 | void Mask::keyReleased(int key){
142 | if (key == OF_KEY_CONTROL || key == OF_KEY_COMMAND) {
143 | erase = false;
144 | }
145 | }
146 |
147 | /******************************************
148 |
149 | SETTINGS
150 |
151 | ********************************************/
152 |
153 | void Mask::load(int projectorStartingIndex){
154 | string filename;
155 | filename = "settings/masks/mask-" + ofToString(pIndex+1+projectorStartingIndex) + ".png";
156 | read(filename);
157 | }
158 |
159 | void Mask::save(int projectorStartingIndex){
160 | string filename;
161 | filename = "settings/masks/mask-" + ofToString(pIndex+1+projectorStartingIndex) + ".png";
162 | write(filename);
163 | }
164 |
165 | void Mask::write(string filename){
166 | maskFboPixels.clear();
167 | maskFbo.readToPixels(maskFboPixels);
168 | maskFboImage->setFromPixels(maskFboPixels);
169 | }
170 |
171 | void Mask::read(string filename){
172 | maskFboImage->clear();
173 | if (maskFboImage->load(filename))
174 | setup();
175 | }
176 |
177 | int Mask::store(int fIndex) {
178 | hIndex = fIndex;
179 | hPixels.clear();
180 | maskFbo.readToPixels(hPixels);
181 | hPixels.pasteInto(maskHistory[fIndex], 0, 0);
182 | return fIndex;
183 | }
184 |
185 | void Mask::recall(int fIndex) {
186 | maskFboImage->clear();
187 | maskFboImage->setFromPixels(maskHistory[fIndex]);
188 | setup();
189 | }
190 |
191 | /******************************************
192 |
193 | RESET
194 |
195 | ********************************************/
196 |
197 | void Mask::reset(){
198 | maskFbo.begin();
199 | ofClear(255,255,255,0);
200 | maskFbo.end();
201 | }
202 |
203 | }
204 |
--------------------------------------------------------------------------------
/src/vdome/renderer/model.cpp:
--------------------------------------------------------------------------------
1 | #include "model.h"
2 | #include
3 | #include
4 | #include
5 | #include "commands.h"
6 |
7 | namespace vd {
8 |
9 | extern int maxHistory;
10 | extern CommandHistory history;
11 | extern vector maskHistory;
12 |
13 | /******************************************
14 |
15 | CONSTRUCTOR
16 |
17 | ********************************************/
18 |
19 | Model::Model(){
20 | radius = 10;
21 | N = 128; // Mesh resolution, must be multiple of 4
22 | textureScale = 1;
23 | textureFlip = false;
24 | textureRotate = 0;
25 | textureTilt = 0;
26 | textureFlipInternal = false;
27 | textureScaleInternal = 1;
28 | textureTiltInternal = 0;
29 | textureScaleInternalW = 1;
30 | textureScaleInternalH = 1;
31 | }
32 |
33 | /******************************************
34 |
35 | SETUP
36 |
37 | ********************************************/
38 |
39 | void Model::setup(){
40 | int i,j,index = 0;
41 | int i1,i2,i3,i4;
42 | double theta,phi,r;
43 | double len;
44 | double x;
45 | double y;
46 | double z;
47 | double nx;
48 | double ny;
49 | double nz;
50 | double u;
51 | double v;
52 | vbo.clear();
53 | vbo.enableTextures();
54 | vbo.enableNormals();
55 |
56 | vbo.addVertex(ofVec3f(0,0,0));
57 | vbo.addNormal(ofVec3f(0,0,0));
58 | vbo.addTexCoord(ofVec2f(0,0));
59 |
60 | for (j=0;j<=N/4;j++) {
61 | for (i=0;i<=N;i++) {
62 | theta = i * 2 * PI / N;
63 | phi = PI/2 - PI/2 * j / (N/4);
64 | x = radius * cos(phi) * cos(theta);
65 | y = radius * cos(phi) * sin(theta);
66 | z = radius * sin(phi);
67 | vbo.addVertex(ofVec3f(x,y,z));
68 |
69 | len = sqrt(x*x + y*y + z*z);
70 | nx = x/len;
71 | ny = y/len;
72 | nz = z/len;
73 | vbo.addNormal(ofVec3f(nx,ny,nz));
74 |
75 | phi = atan2(sqrt(x*x+y*y),z); // 0 ... pi/2
76 | theta = atan2(y,x); // -pi ... pi
77 | r = phi / PI/2 * 4 / (textureScale*textureScaleInternal*textureScaleInternalW*textureScaleInternalH); // 0 ... 1 --->
78 | u = 0.5 * (r*textureScaleInternalH * cos(theta) + 1);
79 | v = 0.5 * (r*textureScaleInternalW * sin(theta) + 1);
80 |
81 | if (textureFlipInternal){
82 | if (textureFlip)
83 | vbo.addTexCoord(ofVec2f(u,1-v));
84 | else
85 | vbo.addTexCoord(ofVec2f(u,v));
86 | }
87 | else {
88 | if (textureFlip)
89 | vbo.addTexCoord(ofVec2f(u,v));
90 | else
91 | vbo.addTexCoord(ofVec2f(u,1-v)); // reverse
92 | }
93 | index++;
94 | }
95 | }
96 |
97 | for (j=0;j
39 | #include
40 |
41 | SpoutSharedMemory::SpoutSharedMemory()
42 | {
43 | m_pBuffer = NULL;
44 | m_hMutex = NULL;
45 | m_hMap = NULL;
46 | m_pName = NULL;
47 | m_size = 0;
48 | m_lockCount = 0;
49 | }
50 |
51 | SpoutSharedMemory::~SpoutSharedMemory()
52 | {
53 | Close();
54 | }
55 |
56 | SpoutCreateResult SpoutSharedMemory::Create(const char* name, int size)
57 | {
58 | DWORD err;
59 |
60 | // Don't call open twice on the same object without a Close()
61 | assert(name);
62 | assert(size);
63 |
64 | if (m_hMap)
65 | {
66 | assert(strcmp(name, m_pName) == 0);
67 | assert(m_pBuffer && m_hMutex);
68 | return SPOUT_ALREADY_CREATED;
69 | }
70 |
71 | m_hMap = CreateFileMappingA ( INVALID_HANDLE_VALUE,
72 | NULL,
73 | PAGE_READWRITE,
74 | 0,
75 | size,
76 | (LPCSTR)name);
77 |
78 | if (m_hMap == NULL)
79 | {
80 | return SPOUT_CREATE_FAILED;
81 | }
82 |
83 |
84 | err = GetLastError();
85 |
86 | bool alreadyExists = false;
87 | if (err == ERROR_ALREADY_EXISTS)
88 | {
89 | alreadyExists = true;
90 | // We should ensure the already existing mapping is at least
91 | // the size we expect
92 | // LJ - GetFileSizeEx and GetFileSize do not work
93 | }
94 |
95 | m_pBuffer = (char*)MapViewOfFile(m_hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
96 |
97 |
98 | if (!m_pBuffer)
99 | {
100 | Close();
101 | return SPOUT_CREATE_FAILED;
102 | }
103 |
104 | std::string mutexName;
105 | mutexName = name;
106 | mutexName += "_mutex";
107 |
108 | m_hMutex = CreateMutexA(NULL, FALSE, mutexName.c_str());
109 |
110 | if (!m_hMutex)
111 | {
112 | Close();
113 | return SPOUT_CREATE_FAILED;
114 | }
115 |
116 | // m_pName = strdup(name);
117 | m_pName = _strdup(name);
118 | m_size = size;
119 |
120 | return alreadyExists ? SPOUT_ALREADY_EXISTS : SPOUT_CREATE_SUCCESS;
121 |
122 | }
123 |
124 |
125 | bool SpoutSharedMemory::Open(const char* name)
126 | {
127 | // Don't call open twice on the same object without a Close()
128 | assert(name);
129 |
130 | if (m_hMap)
131 | {
132 | assert(strcmp(name, m_pName) == 0);
133 | assert(m_pBuffer && m_hMutex);
134 | return true;
135 | }
136 |
137 | m_hMap = OpenFileMappingA ( FILE_MAP_ALL_ACCESS,
138 | FALSE,
139 | (LPCSTR)name);
140 |
141 | if (m_hMap == NULL)
142 | {
143 | return false;
144 | }
145 |
146 |
147 | DWORD err = GetLastError();
148 |
149 | if (err == ERROR_ALREADY_EXISTS)
150 | {
151 | // We should ensure the already existing mapping is at least
152 | // the size we expect
153 | }
154 |
155 | m_pBuffer = (char*)MapViewOfFile(m_hMap, FILE_MAP_ALL_ACCESS, 0, 0, 0);
156 |
157 |
158 | if (!m_pBuffer)
159 | {
160 | Close();
161 | return false;
162 | }
163 |
164 | std::string mutexName;
165 | mutexName = name;
166 | mutexName += "_mutex";
167 |
168 | m_hMutex = CreateMutexA(NULL, FALSE, mutexName.c_str());
169 |
170 | if (!m_hMutex)
171 | {
172 | Close();
173 | return false;
174 | }
175 |
176 | // m_pName = strdup(name);
177 | m_pName = _strdup(name);
178 | m_size = 0;
179 |
180 | return true;
181 |
182 | }
183 |
184 | void
185 | SpoutSharedMemory::Close()
186 | {
187 | if (m_hMutex)
188 | {
189 | CloseHandle(m_hMutex);
190 | m_hMutex = NULL;
191 | }
192 |
193 | if (m_pBuffer)
194 | {
195 | UnmapViewOfFile((LPCVOID)m_pBuffer);
196 | m_pBuffer = NULL;
197 | }
198 |
199 | if (m_hMap)
200 | {
201 | CloseHandle(m_hMap);
202 | m_hMap = NULL;
203 | }
204 | if (m_pName)
205 | {
206 | free((void*)m_pName);
207 | m_pName = NULL;
208 | }
209 | m_size = 0;
210 | m_lockCount = 0;
211 | }
212 |
213 | char* SpoutSharedMemory::Lock()
214 | {
215 |
216 | // ------------------------------
217 | // LJ DEBUG - disable for testing
218 | // assert(m_pBuffer);
219 | // return m_pBuffer;
220 | // ------------------------------
221 |
222 | assert(m_lockCount >= 0);
223 |
224 | assert(m_hMutex);
225 | if (m_lockCount > 0)
226 | {
227 | assert(m_pBuffer);
228 | m_lockCount++;
229 | return m_pBuffer;
230 | }
231 |
232 | DWORD waitResult = WaitForSingleObject(m_hMutex, 67);
233 |
234 | if (waitResult != WAIT_OBJECT_0)
235 | {
236 | return NULL;
237 | }
238 |
239 | m_lockCount++;
240 | assert(m_pBuffer);
241 | return m_pBuffer;
242 | }
243 |
244 | void SpoutSharedMemory::Unlock()
245 | {
246 | // ------------------------------
247 | // LJ DEBUG - disable for testing
248 | // return;
249 | // ------------------------------
250 |
251 | assert(m_hMutex);
252 |
253 | m_lockCount--;
254 | assert(m_lockCount >= 0);
255 |
256 | if (m_lockCount == 0)
257 | {
258 | ReleaseMutex(m_hMutex);
259 | }
260 | }
261 |
262 |
263 | void SpoutSharedMemory::Debug()
264 | {
265 | /*
266 | if (m_pName) {
267 | printf("(%s) m_hMap = [%x], m_pBuffer = [%x]\n", m_pName, m_hMap, m_pBuffer);
268 | }
269 | else {
270 | printf("Shared Memory Map is not open\n");
271 | }
272 | */
273 | }
274 |
--------------------------------------------------------------------------------
/config.make:
--------------------------------------------------------------------------------
1 | ################################################################################
2 | # CONFIGURE PROJECT MAKEFILE (optional)
3 | # This file is where we make project specific configurations.
4 | ################################################################################
5 |
6 | ################################################################################
7 | # OF ROOT
8 | # The location of your root openFrameworks installation
9 | # (default) OF_ROOT = ../../..
10 | ################################################################################
11 | # OF_ROOT = ../../..
12 |
13 | ################################################################################
14 | # PROJECT ROOT
15 | # The location of the project - a starting place for searching for files
16 | # (default) PROJECT_ROOT = . (this directory)
17 | #
18 | ################################################################################
19 | # PROJECT_ROOT = .
20 |
21 | ################################################################################
22 | # PROJECT SPECIFIC CHECKS
23 | # This is a project defined section to create internal makefile flags to
24 | # conditionally enable or disable the addition of various features within
25 | # this makefile. For instance, if you want to make changes based on whether
26 | # GTK is installed, one might test that here and create a variable to check.
27 | ################################################################################
28 | # None
29 |
30 | ################################################################################
31 | # PROJECT EXTERNAL SOURCE PATHS
32 | # These are fully qualified paths that are not within the PROJECT_ROOT folder.
33 | # Like source folders in the PROJECT_ROOT, these paths are subject to
34 | # exlclusion via the PROJECT_EXLCUSIONS list.
35 | #
36 | # (default) PROJECT_EXTERNAL_SOURCE_PATHS = (blank)
37 | #
38 | # Note: Leave a leading space when adding list items with the += operator
39 | ################################################################################
40 | # PROJECT_EXTERNAL_SOURCE_PATHS =
41 |
42 | ################################################################################
43 | # PROJECT EXCLUSIONS
44 | # These makefiles assume that all folders in your current project directory
45 | # and any listed in the PROJECT_EXTERNAL_SOURCH_PATHS are are valid locations
46 | # to look for source code. The any folders or files that match any of the
47 | # items in the PROJECT_EXCLUSIONS list below will be ignored.
48 | #
49 | # Each item in the PROJECT_EXCLUSIONS list will be treated as a complete
50 | # string unless teh user adds a wildcard (%) operator to match subdirectories.
51 | # GNU make only allows one wildcard for matching. The second wildcard (%) is
52 | # treated literally.
53 | #
54 | # (default) PROJECT_EXCLUSIONS = (blank)
55 | #
56 | # Will automatically exclude the following:
57 | #
58 | # $(PROJECT_ROOT)/bin%
59 | # $(PROJECT_ROOT)/obj%
60 | # $(PROJECT_ROOT)/%.xcodeproj
61 | #
62 | # Note: Leave a leading space when adding list items with the += operator
63 | ################################################################################
64 | # PROJECT_EXCLUSIONS =
65 |
66 | ################################################################################
67 | # PROJECT LINKER FLAGS
68 | # These flags will be sent to the linker when compiling the executable.
69 | #
70 | # (default) PROJECT_LDFLAGS = -Wl,-rpath=./libs
71 | #
72 | # Note: Leave a leading space when adding list items with the += operator
73 | ################################################################################
74 |
75 | # Currently, shared libraries that are needed are copied to the
76 | # $(PROJECT_ROOT)/bin/libs directory. The following LDFLAGS tell the linker to
77 | # add a runtime path to search for those shared libraries, since they aren't
78 | # incorporated directly into the final executable application binary.
79 | # TODO: should this be a default setting?
80 | # PROJECT_LDFLAGS=-Wl,-rpath=./libs
81 |
82 | ################################################################################
83 | # PROJECT DEFINES
84 | # Create a space-delimited list of DEFINES. The list will be converted into
85 | # CFLAGS with the "-D" flag later in the makefile.
86 | #
87 | # (default) PROJECT_DEFINES = (blank)
88 | #
89 | # Note: Leave a leading space when adding list items with the += operator
90 | ################################################################################
91 | # PROJECT_DEFINES =
92 |
93 | ################################################################################
94 | # PROJECT CFLAGS
95 | # This is a list of fully qualified CFLAGS required when compiling for this
96 | # project. These CFLAGS will be used IN ADDITION TO the PLATFORM_CFLAGS
97 | # defined in your platform specific core configuration files. These flags are
98 | # presented to the compiler BEFORE the PROJECT_OPTIMIZATION_CFLAGS below.
99 | #
100 | # (default) PROJECT_CFLAGS = (blank)
101 | #
102 | # Note: Before adding PROJECT_CFLAGS, note that the PLATFORM_CFLAGS defined in
103 | # your platform specific configuration file will be applied by default and
104 | # further flags here may not be needed.
105 | #
106 | # Note: Leave a leading space when adding list items with the += operator
107 | ################################################################################
108 | # PROJECT_CFLAGS =
109 |
110 | ################################################################################
111 | # PROJECT OPTIMIZATION CFLAGS
112 | # These are lists of CFLAGS that are target-specific. While any flags could
113 | # be conditionally added, they are usually limited to optimization flags.
114 | # These flags are added BEFORE the PROJECT_CFLAGS.
115 | #
116 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE flags are only applied to RELEASE targets.
117 | #
118 | # (default) PROJECT_OPTIMIZATION_CFLAGS_RELEASE = (blank)
119 | #
120 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG flags are only applied to DEBUG targets.
121 | #
122 | # (default) PROJECT_OPTIMIZATION_CFLAGS_DEBUG = (blank)
123 | #
124 | # Note: Before adding PROJECT_OPTIMIZATION_CFLAGS, please note that the
125 | # PLATFORM_OPTIMIZATION_CFLAGS defined in your platform specific configuration
126 | # file will be applied by default and further optimization flags here may not
127 | # be needed.
128 | #
129 | # Note: Leave a leading space when adding list items with the += operator
130 | ################################################################################
131 | # PROJECT_OPTIMIZATION_CFLAGS_RELEASE =
132 | # PROJECT_OPTIMIZATION_CFLAGS_DEBUG =
133 |
134 | ################################################################################
135 | # PROJECT COMPILERS
136 | # Custom compilers can be set for CC and CXX
137 | # (default) PROJECT_CXX = (blank)
138 | # (default) PROJECT_CC = (blank)
139 | # Note: Leave a leading space when adding list items with the += operator
140 | ################################################################################
141 | # PROJECT_CXX =
142 | # PROJECT_CC =
143 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutSender.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // SpoutSender
3 | //
4 | // Wrapper class so that a sender object can be created independent of a receiver
5 | //
6 | // ====================================================================================
7 | // Revisions :
8 | //
9 | // 23.09.14 - return DirectX 11 capability in SetDX9
10 | // 28.09.14 - Added GL format for SendImage
11 | // - Added bAlignment (4 byte alignment) flag for SendImage
12 | // - Added Host FBO for SendTexture, DrawToSharedTexture
13 | // 08.02.15 - Changed default texture format for SendImage in header to GL_RGBA
14 | // 29.05.15 - Included SetAdapter for multiple adapters - Franz Hildgen.
15 | // 02.06.15 - Added GetAdapter, GetNumAdapters, GetAdapterName
16 | // 08.06.15 - Added SelectSenderPanel for user adapter output selection
17 | // ====================================================================================
18 | /*
19 |
20 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
21 |
22 | Redistribution and use in source and binary forms, with or without modification,
23 | are permitted provided that the following conditions are met:
24 |
25 | 1. Redistributions of source code must retain the above copyright notice,
26 | this list of conditions and the following disclaimer.
27 |
28 | 2. Redistributions in binary form must reproduce the above copyright notice,
29 | this list of conditions and the following disclaimer in the documentation
30 | and/or other materials provided with the distribution.
31 |
32 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
33 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
36 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
37 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
39 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
40 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 |
42 | */
43 | #include "SpoutSender.h"
44 |
45 | SpoutSender::SpoutSender()
46 | {
47 |
48 | }
49 |
50 |
51 | //---------------------------------------------------------
52 | SpoutSender::~SpoutSender()
53 | {
54 |
55 | }
56 |
57 |
58 |
59 | //---------------------------------------------------------
60 | bool SpoutSender::CreateSender(char *name, unsigned int width, unsigned int height, DWORD dwFormat)
61 | {
62 | return spout.CreateSender(name, width, height, dwFormat);
63 | }
64 |
65 |
66 | //---------------------------------------------------------
67 | bool SpoutSender::UpdateSender(char *name, unsigned int width, unsigned int height)
68 | {
69 | return spout.UpdateSender(name, width, height);
70 | }
71 |
72 |
73 | //---------------------------------------------------------
74 | void SpoutSender::ReleaseSender(DWORD dwMsec)
75 | {
76 | spout.ReleaseSender(dwMsec);
77 | }
78 |
79 |
80 | //---------------------------------------------------------
81 | bool SpoutSender::SendImage(unsigned char* pixels, unsigned int width, unsigned int height, GLenum glFormat, bool bAlignment, bool bInvert)
82 | {
83 | return spout.SendImage(pixels, width, height, glFormat, bAlignment, bInvert);
84 | }
85 |
86 | //---------------------------------------------------------
87 | bool SpoutSender::SendTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, bool bInvert, GLuint HostFBO)
88 | {
89 | return spout.SendTexture(TextureID, TextureTarget, width, height, bInvert, HostFBO);
90 | }
91 |
92 | //---------------------------------------------------------
93 | bool SpoutSender::DrawToSharedTexture(GLuint TextureID, GLuint TextureTarget, unsigned int width, unsigned int height, float max_x, float max_y, float aspect, bool bInvert, GLuint HostFBO)
94 | {
95 | return spout.DrawToSharedTexture(TextureID, TextureTarget, width, height, max_x, max_y, aspect, bInvert, HostFBO);
96 | }
97 |
98 | //---------------------------------------------------------
99 | bool SpoutSender::SelectSenderPanel(const char* message)
100 | {
101 | return spout.SelectSenderPanel(message);
102 | }
103 |
104 |
105 | //---------------------------------------------------------
106 | bool SpoutSender::GetMemoryShareMode()
107 | {
108 | return spout.GetMemoryShareMode();
109 | }
110 |
111 |
112 | //---------------------------------------------------------
113 | bool SpoutSender::SetMemoryShareMode(bool bMemoryMode)
114 | {
115 | return spout.SetMemoryShareMode(bMemoryMode);
116 | }
117 |
118 |
119 | //---------------------------------------------------------
120 | bool SpoutSender::SetDX9(bool bDX9)
121 | {
122 | // printf("spoutSender::SetDX9(%d)\n", bDX9);
123 | return spout.SetDX9(bDX9);
124 | }
125 |
126 |
127 | //---------------------------------------------------------
128 | bool SpoutSender::GetDX9()
129 | {
130 | return spout.interop.isDX9();
131 | }
132 |
133 | //---------------------------------------------------------
134 | void SpoutSender::SetDX9compatible(bool bCompatible)
135 | {
136 | if(bCompatible) {
137 | // DX11 -> DX9 only works if the DX11 format is set to DXGI_FORMAT_B8G8R8A8_UNORM
138 | spout.interop.SetDX11format(DXGI_FORMAT_B8G8R8A8_UNORM);
139 | }
140 | else {
141 | // DX11 -> DX11 only
142 | spout.interop.SetDX11format(DXGI_FORMAT_R8G8B8A8_UNORM);
143 | }
144 | }
145 |
146 |
147 | //---------------------------------------------------------
148 | bool SpoutSender::GetDX9compatible()
149 | {
150 | if(spout.interop.DX11format == DXGI_FORMAT_B8G8R8A8_UNORM)
151 | return true;
152 | else
153 | return false;
154 |
155 | }
156 |
157 | //---------------------------------------------------------
158 | bool SpoutSender::SetAdapter(int index)
159 | {
160 | return spout.SetAdapter(index);
161 | }
162 |
163 | // Get current adapter index
164 | int SpoutSender::GetAdapter()
165 | {
166 | return spout.GetAdapter();
167 | }
168 |
169 | // Get the number of graphics adapters in the system
170 | int SpoutSender::GetNumAdapters()
171 | {
172 | return spout.GetNumAdapters();
173 | }
174 |
175 | // Get an adapter name
176 | bool SpoutSender::GetAdapterName(int index, char *adaptername, int maxchars)
177 | {
178 | return spout.GetAdapterName(index, adaptername, maxchars);
179 | }
180 |
181 |
182 | //---------------------------------------------------------
183 | bool SpoutSender::SetVerticalSync(bool bSync)
184 | {
185 | return spout.interop.SetVerticalSync(bSync);
186 | }
187 |
188 | //---------------------------------------------------------
189 | int SpoutSender::GetVerticalSync()
190 | {
191 | return spout.interop.GetVerticalSync();
192 | }
193 |
194 | //------------------ debugging aid only --------------------
195 | bool SpoutSender::SenderDebug(char *Sendername, int size)
196 | {
197 | return spout.interop.senders.SenderDebug(Sendername, size);
198 |
199 | }
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutReceiver.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // SpoutReceiver
3 | //
4 | // Wrapper class so that a receiver object can be created independent of a sender
5 | //
6 | // ====================================================================================
7 | // Revisions :
8 | //
9 | // 27-07-14 - CreateReceiver - bUseActive flag instead of null name
10 | // 03.09.14 - Cleanup
11 | // 23.09.14 - return DirectX 11 capability in SetDX9
12 | // 28.09.14 - Added Host FBO for ReceiveTexture
13 | // 12.10.14 - changed SelectSenderPanel arg to const char
14 | // 23.12.14 - added host fbo arg to ReceiveImage
15 | // 08.02.15 - Changed default texture format for ReceiveImage in header to GL_RGBA
16 | // 29.05.15 - Included SetAdapter for multiple adapters - Franz Hildgen.
17 | // 02.06.15 - Added GetAdapter, GetNumAdapters, GetAdapterName
18 | //
19 | // ====================================================================================
20 | /*
21 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
22 |
23 | Redistribution and use in source and binary forms, with or without modification,
24 | are permitted provided that the following conditions are met:
25 |
26 | 1. Redistributions of source code must retain the above copyright notice,
27 | this list of conditions and the following disclaimer.
28 |
29 | 2. Redistributions in binary form must reproduce the above copyright notice,
30 | this list of conditions and the following disclaimer in the documentation
31 | and/or other materials provided with the distribution.
32 |
33 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
34 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
35 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
36 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
37 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
38 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
39 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
40 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 |
43 | */
44 | #include "SpoutReceiver.h"
45 |
46 | SpoutReceiver::SpoutReceiver()
47 | {
48 |
49 | }
50 |
51 |
52 | //---------------------------------------------------------
53 | SpoutReceiver::~SpoutReceiver()
54 | {
55 |
56 | }
57 |
58 |
59 | //---------------------------------------------------------
60 | bool SpoutReceiver::ReceiveTexture(char* name, unsigned int &width, unsigned int &height, GLuint TextureID, GLuint TextureTarget, bool bInvert, GLuint HostFBO)
61 | {
62 | return spout.ReceiveTexture(name, width, height, TextureID, TextureTarget, bInvert, HostFBO);
63 | }
64 |
65 |
66 | //---------------------------------------------------------
67 | bool SpoutReceiver::ReceiveImage(char* name, unsigned int &width, unsigned int &height, unsigned char* pixels, GLenum glFormat, GLuint HostFBO)
68 | {
69 | return spout.ReceiveImage(name, width, height, pixels, glFormat, HostFBO);
70 | }
71 |
72 |
73 | //---------------------------------------------------------
74 | bool SpoutReceiver::GetImageSize(char* name, unsigned int &width, unsigned int &height, bool &bMemoryMode)
75 | {
76 | return spout.GetImageSize(name, width, height, bMemoryMode);
77 | }
78 |
79 |
80 | //---------------------------------------------------------
81 | bool SpoutReceiver::CreateReceiver(char* name, unsigned int &width, unsigned int &height, bool bUseActive)
82 | {
83 | return spout.CreateReceiver(name, width, height, bUseActive);
84 | }
85 |
86 | //---------------------------------------------------------
87 | void SpoutReceiver::ReleaseReceiver()
88 | {
89 | spout.ReleaseReceiver();
90 | }
91 |
92 |
93 | //---------------------------------------------------------
94 | bool SpoutReceiver::BindSharedTexture()
95 | {
96 | return spout.BindSharedTexture();
97 | }
98 |
99 |
100 | //---------------------------------------------------------
101 | bool SpoutReceiver::UnBindSharedTexture()
102 | {
103 | return spout.UnBindSharedTexture();
104 | }
105 |
106 |
107 | //---------------------------------------------------------
108 | int SpoutReceiver::GetSenderCount()
109 | {
110 | return spout.GetSenderCount();
111 | }
112 |
113 | //---------------------------------------------------------
114 | bool SpoutReceiver::DrawSharedTexture(float max_x, float max_y, float aspect, bool bInvert)
115 | {
116 | return spout.DrawSharedTexture(max_x, max_y, aspect, bInvert);
117 | }
118 |
119 |
120 | //---------------------------------------------------------
121 | bool SpoutReceiver::GetSenderName(int index, char* sendername, int MaxNameSize)
122 | {
123 | return spout.GetSenderName(index, sendername, MaxNameSize);
124 | }
125 |
126 | //---------------------------------------------------------
127 | bool SpoutReceiver::GetActiveSender(char* Sendername)
128 | {
129 | return spout.GetActiveSender(Sendername);
130 | }
131 |
132 |
133 | //---------------------------------------------------------
134 | bool SpoutReceiver::SetActiveSender(char* Sendername)
135 | {
136 | return spout.SetActiveSender(Sendername);
137 | }
138 |
139 |
140 | //---------------------------------------------------------
141 | bool SpoutReceiver::GetSenderInfo(const char* sendername, unsigned int &width, unsigned int &height, HANDLE &dxShareHandle, DWORD &dwFormat)
142 | {
143 | return spout.GetSenderInfo(sendername, width, height, dxShareHandle, dwFormat);
144 | }
145 |
146 |
147 | //---------------------------------------------------------
148 | bool SpoutReceiver::SelectSenderPanel(const char* message)
149 | {
150 | return spout.SelectSenderPanel(message);
151 | }
152 |
153 | //---------------------------------------------------------
154 | bool SpoutReceiver::GetMemoryShareMode()
155 | {
156 | return spout.GetMemoryShareMode();
157 | }
158 |
159 |
160 | //---------------------------------------------------------
161 | bool SpoutReceiver::SetMemoryShareMode(bool bMemory)
162 | {
163 | return spout.SetMemoryShareMode(bMemory);
164 | }
165 |
166 | //---------------------------------------------------------
167 | bool SpoutReceiver::SetDX9(bool bDX9)
168 | {
169 | return spout.interop.UseDX9(bDX9);
170 | }
171 |
172 |
173 | //---------------------------------------------------------
174 | bool SpoutReceiver::GetDX9()
175 | {
176 | return spout.interop.isDX9();
177 | }
178 |
179 |
180 | //---------------------------------------------------------
181 | void SpoutReceiver::SetDX9compatible(bool bCompatible)
182 | {
183 | if(bCompatible) {
184 | // DX11 -> DX9 only works if the DX11 format is set to DXGI_FORMAT_B8G8R8A8_UNORM
185 | spout.interop.SetDX11format(DXGI_FORMAT_B8G8R8A8_UNORM);
186 | }
187 | else {
188 | // DX11 -> DX11 only
189 | spout.interop.SetDX11format(DXGI_FORMAT_R8G8B8A8_UNORM);
190 | }
191 | }
192 |
193 |
194 | //---------------------------------------------------------
195 | bool SpoutReceiver::GetDX9compatible()
196 | {
197 | if(spout.interop.DX11format == DXGI_FORMAT_B8G8R8A8_UNORM)
198 | return true;
199 | else
200 | return false;
201 | }
202 |
203 | //---------------------------------------------------------
204 | bool SpoutReceiver::SetAdapter(int index)
205 | {
206 | return spout.SetAdapter(index);
207 | }
208 |
209 | // Get current adapter index
210 | int SpoutReceiver::GetAdapter()
211 | {
212 | return spout.GetAdapter();
213 | }
214 |
215 | // Get the number of graphics adapters in the system
216 | int SpoutReceiver::GetNumAdapters()
217 | {
218 | return spout.GetNumAdapters();
219 | }
220 |
221 | // Get an adapter name
222 | bool SpoutReceiver::GetAdapterName(int index, char *adaptername, int maxchars)
223 | {
224 | return spout.GetAdapterName(index, adaptername, maxchars);
225 | }
226 |
227 | //---------------------------------------------------------
228 | bool SpoutReceiver::SetVerticalSync(bool bSync)
229 | {
230 | return spout.interop.SetVerticalSync(bSync);
231 | }
232 |
233 | //---------------------------------------------------------
234 | int SpoutReceiver::GetVerticalSync()
235 | {
236 | return spout.interop.GetVerticalSync();
237 | }
238 |
--------------------------------------------------------------------------------
/src/vdome/input/spout/SpoutSDK/SpoutSenderNames.h:
--------------------------------------------------------------------------------
1 | /*
2 |
3 | spoutSenderNames.h
4 | Spout sender management
5 |
6 | LJ - leadedge@adam.com.au
7 |
8 | Thanks and credit to Malcolm Bechard for modifications to this class
9 |
10 | https://github.com/mbechard
11 |
12 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
13 | Copyright (c) 2014-2015, Lynn Jarvis. All rights reserved.
14 |
15 | Redistribution and use in source and binary forms, with or without modification,
16 | are permitted provided that the following conditions are met:
17 |
18 | 1. Redistributions of source code must retain the above copyright notice,
19 | this list of conditions and the following disclaimer.
20 |
21 | 2. Redistributions in binary form must reproduce the above copyright notice,
22 | this list of conditions and the following disclaimer in the documentation
23 | and/or other materials provided with the distribution.
24 |
25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
26 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28 | IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
30 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 | LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 |
36 | */
37 | #pragma once
38 | #ifndef __spoutSenderNames__ // standard way as well
39 | #define __spoutSenderNames__
40 |
41 | #include
42 | #include
43 | #include
44 | #include
45 | #include
46 | #include