-
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ScreenshotRemote Function this create a screenshot like the norma…
…l screenshot, except that it outputs the image as Base64 String
- Loading branch information
Sebastian Feustel
committed
Mar 12, 2024
1 parent
1508416
commit 1df3ace
Showing
11 changed files
with
106 additions
and
1 deletion.
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
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
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
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,26 @@ | ||
/*** | ||
* Copyright (C) Falko Axmann. All rights reserved. | ||
* Licensed under the MIT license. | ||
* See LICENSE.txt file in the project root for full license information. | ||
****/ | ||
|
||
#include "ScreenshotRemote.h" | ||
|
||
#include <Scene/Scene.h> | ||
namespace spix { | ||
namespace cmd { | ||
|
||
ScreenshotRemote::ScreenshotRemote(ItemPath targetItemPath, std::promise<std::string> promise) | ||
: m_itemPath {std::move(targetItemPath)} | ||
, m_promise(std::move(promise)) | ||
{ | ||
} | ||
|
||
void ScreenshotRemote::execute(CommandEnvironment& env) | ||
{ | ||
auto value = env.scene().takeScreenshotRemote(m_itemPath); | ||
m_promise.set_value(value); | ||
} | ||
|
||
} // namespace cmd | ||
} // namespace spix |
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,23 @@ | ||
#pragma once | ||
|
||
#include "Command.h" | ||
#include <Spix/Data/ItemPath.h> | ||
|
||
#include <future> | ||
|
||
namespace spix { | ||
namespace cmd { | ||
|
||
class ScreenshotRemote : public Command { | ||
public: | ||
ScreenshotRemote(ItemPath targetItemPath, std::promise<std::string> promise); | ||
|
||
void execute(CommandEnvironment& env) override; | ||
|
||
private: | ||
ItemPath m_itemPath; | ||
std::promise<std::string> m_promise; | ||
}; | ||
|
||
} // namespace cmd | ||
} // namespace spix |
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
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
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
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
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
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