-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from smasherprog/Dev
First Release of windows support
- Loading branch information
Showing
36 changed files
with
3,494 additions
and
559 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"variant": { | ||
"label": "Debug", | ||
"keywordSettings": { | ||
"buildType": "debug" | ||
}, | ||
"description": "Emit debug information without performing optimizations" | ||
}, | ||
"activeEnvironments": [ | ||
"Visual C++ 14.0 - x86" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Mac", | ||
"includePath": ["/usr/include"], | ||
"browse" : { | ||
"limitSymbolsToIncludedHeaders" : true, | ||
"databaseFilename" : "" | ||
} | ||
}, | ||
{ | ||
"name": "Linux", | ||
"includePath": ["/usr/include"], | ||
"browse" : { | ||
"limitSymbolsToIncludedHeaders" : true, | ||
"databaseFilename" : "" | ||
} | ||
}, | ||
{ | ||
"name": "Win32", | ||
"includePath": [ | ||
"c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/include/", | ||
"C:/Program Files (x86)/Windows Kits/10/Include/10.0.10586.0" | ||
], | ||
"browse" : { | ||
"limitSymbolsToIncludedHeaders" : true, | ||
"databaseFilename" : "" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "C++ Launch (Windows)", | ||
"type": "cppvsdbg", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/build/Example/Debug/Screen_Capture_Example.exe", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceRoot}/build/Example/Debug/", | ||
"environment": [], | ||
"externalConsole": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Place your settings in this file to overwrite default and user settings. | ||
{ | ||
"C_Cpp.clang_format_style": "WebKit", | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"version": "0.1.0", | ||
"isShellCommand": true, | ||
"showOutput": "always", | ||
"suppressTaskName": true, | ||
"options": { | ||
"cwd": "${workspaceRoot}/build" | ||
}, | ||
"echoCommand": true, | ||
"windows": { | ||
"command": "cmd", | ||
"args": ["/C"], | ||
"tasks": [ | ||
{ | ||
"taskName": "clean", | ||
"args": [ "rd /s /q", "${workspaceRoot}\\build"] | ||
}, | ||
{ | ||
"taskName": "cmake", | ||
"args": ["cmake", "--build","${workspaceRoot}\\build"], | ||
"isBuildCommand": true, | ||
"problemMatcher": { | ||
"owner": "cpp", | ||
"fileLocation": "absolute", | ||
"pattern": { | ||
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", | ||
"file": 1, | ||
"line": 2, | ||
"column": 3, | ||
"severity": 4, | ||
"message": 5 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"linux": { | ||
"command": "sh", | ||
"args": ["-c"], | ||
"tasks": [ | ||
{ | ||
"taskName": "clean", | ||
"args": [ "rm -rf", "${workspaceRoot}/build" ] | ||
}, | ||
{ | ||
"taskName": "cmake", | ||
"args": ["cmake", "--build","${cwd}"], | ||
"isBuildCommand": true | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
project(Screen_Capture) | ||
|
||
option(BUILD_EXAMPLE "Build example" On) | ||
|
||
add_subdirectory(lib) | ||
|
||
if(BUILD_EXAMPLE) | ||
add_subdirectory(Example) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
project(Screen_Capture_Example) | ||
|
||
include_directories(${Screen_Capture_SOURCE_DIR}/include) | ||
|
||
|
||
add_executable(${PROJECT_NAME} tiny_jpeg.h Screen_Capture_Example.cpp) | ||
target_link_libraries(${PROJECT_NAME} Screen_Capturelib) | ||
|
||
install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include "ScreenCaptureManager.h" | ||
#include <iostream> | ||
#include <chrono> | ||
#include <atomic> | ||
#include <thread> | ||
#include <string> | ||
#define TJE_IMPLEMENTATION | ||
#include "tiny_jpeg.h" | ||
|
||
int main() | ||
{ | ||
|
||
std::atomic<int> realcounter; | ||
realcounter = 0; | ||
SL::Screen_Capture::ScreenCaptureManager framgrabber; | ||
SL::Screen_Capture::ImageCallback func = [&](const SL::Screen_Capture::CapturedImage& img) { | ||
std::cout << "Height " << img.Height << ", Width " << img.Width << ", Top " << img.AbsoluteTop << ", Left " << img.AbsoluteLeft << std::endl; | ||
auto r = realcounter.fetch_add(1); | ||
std::string s("screen"); | ||
s += std::to_string(img.AbsoluteTop) + std::string(",") + std::to_string(img.AbsoluteLeft) +std::string(" ") + std::to_string(r) + std::string(".jpg"); | ||
|
||
if (!tje_encode_to_file(s.c_str(), img.Width, img.Height, 4, (const unsigned char*)img.Data.get())) { | ||
std::cout << "Could not write JPEG\n"; | ||
} | ||
}; | ||
framgrabber.StartCapturing(func, 100); | ||
|
||
while (true) { | ||
std::this_thread::sleep_for(std::chrono::milliseconds(1000)); | ||
} | ||
|
||
framgrabber.StopCapturing(); | ||
int k = 0; | ||
std::cin >> k; | ||
return 0; | ||
} | ||
|
Oops, something went wrong.