All Projects → smasherprog → Screen_capture_lite

smasherprog / Screen_capture_lite

Licence: mit
cross platform screen/window capturing library

Projects that are alternatives of or similar to Screen capture lite

Snapshots For Windows
Application for make and upload screenshots / Приложение для создания и загрузки скриншотов
Stars: ✭ 6 (-98.24%)
Mutual labels:  screenshot, screen-capture, screenshots
autoscreen
Automated screen capture utility
Stars: ✭ 76 (-77.65%)
Mutual labels:  screenshot, screenshots, screen-capture
Falcon
Take Android screenshots with Falcons bright eye!
Stars: ✭ 362 (+6.47%)
Mutual labels:  screenshot, screen-capture, screenshots
Chart To Aws
Microservice to generate screenshot from a webpage and upload it to a AWS S3 Bucket.
Stars: ✭ 43 (-87.35%)
Mutual labels:  screenshot, screen-capture, screenshots
Swift Screencapture
A Swift framework to easily capture the screen on OS X.
Stars: ✭ 105 (-69.12%)
Mutual labels:  screenshot, screen-capture, screenshots
Menyoki
Screen{shot,cast} and perform ImageOps on the command line 🌱 🏞️
Stars: ✭ 255 (-25%)
Mutual labels:  screenshot, screen-capture, screencast
Screenshotty
A library for programatically capturing screenshots on Android
Stars: ✭ 141 (-58.53%)
Mutual labels:  screenshot, screen-capture, screenshots
Tools Ocr
树洞 OCR 文字识别(一款跨平台的 OCR 小工具)
Stars: ✭ 2,303 (+577.35%)
Mutual labels:  screenshot, cross-platform, mac
go-scrap
Go library to capture screen pixels for screenshots or screen recording
Stars: ✭ 68 (-80%)
Mutual labels:  screenshot, screen-capture
AutoScreenshot
Automatic screenshot maker for Windows
Stars: ✭ 49 (-85.59%)
Mutual labels:  screenshot, screenshots
Live-Desktop-Capture
A Live Desktop Capture using Go and WebSockets
Stars: ✭ 42 (-87.65%)
Mutual labels:  screenshot, screen-capture
Notable
The Markdown-based note-taking app that doesn't suck.
Stars: ✭ 18,866 (+5448.82%)
Mutual labels:  cross-platform, mac
android-capture
Capture video and screenshots from Android devices and emulators.
Stars: ✭ 32 (-90.59%)
Mutual labels:  screenshot, screen-capture
Switch-Screenshots
Script to organize Nintendo Switch screenshots by directory instead of date.
Stars: ✭ 50 (-85.29%)
Mutual labels:  screenshot, screenshots
screencast
Interface to record a X11 desktop
Stars: ✭ 91 (-73.24%)
Mutual labels:  screen-capture, screencast
Tracker
Even the best of apps have their issues
Stars: ✭ 113 (-66.76%)
Mutual labels:  mac, screencast
ScreenEat
screenshot made delicious
Stars: ✭ 54 (-84.12%)
Mutual labels:  screenshot, screen-capture
svg-screencast
SVG screencast - animated SVG files from screenshots using CSS animations
Stars: ✭ 28 (-91.76%)
Mutual labels:  screenshot, screencast
Negibox
All in one downloader 全能下载器
Stars: ✭ 335 (-1.47%)
Mutual labels:  cross-platform, mac
screenshotgun
Open cross-platform screenshoter with cloud support and server part
Stars: ✭ 23 (-93.24%)
Mutual labels:  screenshot, screenshots

Above Logo created by https://github.com/mansya

Master is where development happens and should NOT be considered stable. Use tags for stable releases.

Linux/Mac

Windows

Cross-platform screen and window capturing library

No External Dependencies except:

linux: sudo apt-get install libxtst-dev libxinerama-dev libx11-dev libxfixes-dev

Platforms supported:

  • Windows 7 and Up
  • MacOS
  • Linux

The image format is raw BGRA 32 bits per pixel. Alpha is unused for onNewFrame and onFrameChanged except for onMouseChanged where it IS USED!

The data exists like this if you were to march through with a for loop [A,R,G,B], [A,R,G,B], [A,R,G,B]. For a read on why this is check out the post here post here

Example

https://github.com/smasherprog/screen_capture_lite/blob/master/Example/Screen_Capture_Example.cpp

//Setup Screen Capture for all monitors
auto framgrabber =  SL::Screen_Capture::CreateCaptureConfiguration([]() {
//add your own custom filtering here if you want to capture only some monitors
    return SL::Screen_Capture::GetMonitors();
  })->onFrameChanged([&](const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Monitor& monitor) {
  
  })->onNewFrame([&](const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Monitor& monitor) {
  
  })->onMouseChanged([&](const SL::Screen_Capture::Image* img, const SL::Screen_Capture::MousePoint &mousepoint) {
  
  })->start_capturing();

framgrabber->setFrameChangeInterval(std::chrono::milliseconds(100));//100 ms
framgrabber->setMouseChangeInterval(std::chrono::milliseconds(100));//100 ms


//Setup Screen Capture for windows that have the title "cmake" in it
auto windowframgrabber =  SL::Screen_Capture::CreateCaptureConfiguration([]() {
  auto windows = SL::Screen_Capture::GetWindows();
  std::string srchterm = "cmake";
  // convert to lower case for easier comparisons
  std::transform(srchterm.begin(), srchterm.end(), srchterm.begin(), [](char c) { return std::tolower(c, std::locale());});
  decltype(windows) filtereditems;
  for(auto& a : windows) {
    std::string name = a.Name;
    std::transform(name.begin(), name.end(), name.begin(), [](char c) {return std::tolower(c, std::locale()); });
    if(name.find(srchterm) != std::string::npos) {
      filtereditems.push_back(a);
    }
  }
  return filtereditems;
  })->onFrameChanged([&](const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Window& window) {
  
  })->onNewFrame([&](const SL::Screen_Capture::Image& img, const SL::Screen_Capture::Window& window) {
  
  })->onMouseChanged([&](const SL::Screen_Capture::Image* img, const SL::Screen_Capture::MousePoint &mousepoint) {
  
  })->start_capturing();

windowframgrabber->setFrameChangeInterval(std::chrono::milliseconds(100));//100 ms
windowframgrabber->setMouseChangeInterval(std::chrono::milliseconds(100));//100 ms

Library Usage

Only define what are are interested in. Do not define a callback for onMouseChanged if you dont want that information. If you do, the library will assume that you want mouse information and monitor that --so DONT!

Again, DONT DEFINE CALLBACKS FOR EVENTS YOU DONT CARE ABOUT. If you do, the library will do extra work assuming you want the information.

The library owns all image data so if you want to use it for your own purpose after the callback has completed you MUST copy the data out!

Each monitor or window will run in its own thread so there is no blocking or internal synchronization. If you are capturing three monitors, a thread is capturing each monitor.

ICaptureConfiguration

Calls to ICaptureConfiguration cannot be changed after start_capturing is called. You must destroy it and recreate it!

  • ICaptureConfiguration::onNewFrame: This will call back when a new frame is ready on the interval specified in setFrameChangeInterval
  • ICaptureConfiguration::onFrameChanged: This will call back when differences are detected between the last frame and the current one. This is usefull when you want to stream data that you are only sending what has changed, not everything!
  • ICaptureConfiguration::onMouseChanged: This will call back when the mouse has changed location or the mouse image has changed up to a maximum rate specified in setMouseChangeInterval

IScreenCaptureManager

Calls to IScreenCaptureManager can be changed at any time from any thread as all calls are thread safe!

  • IScreenCaptureManager::setFrameChangeInterval: This will set the maximum rate that the library will attempt to capture frame events.
  • IScreenCaptureManager::setMouseChangeInterval: This will set the maximum rate that the library will attempt to capture mouse events.
  • IScreenCaptureManager::pause: all threads will stop capturing.
  • IScreenCaptureManager::isPaused: obvious!
  • IScreenCaptureManager::resume: all threads will resume capturing.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].