-
-
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 ScreenshotAsBase64 Function this create a screenshot like the normal screenshot, except that it outputs the image as Base64 String
- Loading branch information
1 parent
18ab4db
commit b948a34
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 "ScreenshotBase64.h" | ||
|
||
#include <Scene/Scene.h> | ||
namespace spix { | ||
namespace cmd { | ||
|
||
ScreenshotAsBase64::ScreenshotAsBase64(ItemPath targetItemPath, std::promise<std::string> promise) | ||
: m_itemPath {std::move(targetItemPath)} | ||
, m_promise(std::move(promise)) | ||
{ | ||
} | ||
|
||
void ScreenshotAsBase64::execute(CommandEnvironment& env) | ||
{ | ||
auto value = env.scene().takeScreenshotAsBase64(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 ScreenshotAsBase64 : public Command { | ||
public: | ||
ScreenshotAsBase64(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