-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
327 additions
and
137 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 |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
|
||
members = [ | ||
"micro", | ||
"micro-common", | ||
"worker-blender" | ||
] |
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,15 @@ | ||
[package] | ||
name = "fabseal-micro-common" | ||
version = "0.1.0" | ||
authors = [ "Tobias Markus <tobias@miglix.eu>" ] | ||
edition = "2018" | ||
license = "GPL-3.0-or-later" | ||
repository = "https://github.com/Siegler-von-Catan/fabseal-micro/" | ||
homepage = "https://fabseal.de" | ||
categories = [ "computer-vision", "web-programming::http-server" ] | ||
publish = false | ||
|
||
[dependencies] | ||
serde = "1.0" | ||
serde_json = "1.0" | ||
mime = "0.3" |
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,42 @@ | ||
use serde::{Deserialize, Serialize}; | ||
|
||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub enum ImageType { | ||
PNG, | ||
JPEG | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct StoredImage { | ||
pub image_type: ImageType, | ||
pub image: Vec<u8>, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct ImageRequest { | ||
pub request_id: u32, | ||
pub image: StoredImage, | ||
} | ||
|
||
#[derive(Serialize, Deserialize, Debug)] | ||
pub struct RequestSettings { | ||
pub start_x: i32, | ||
pub end_x: i32, | ||
pub start_y: i32, | ||
pub end_y: i32, | ||
pub is_inverted: bool, | ||
pub is_low_quality: bool, | ||
} | ||
|
||
pub const FABSEAL_QUEUE: &'static str = "fabseal"; | ||
|
||
pub const FABSEAL_EXCHANGE: &'static str = ""; | ||
|
||
pub const RESULT_EXPIRATION_SECONDS: usize = 10*60; | ||
|
||
pub fn result_key( | ||
request_id: u32 | ||
) -> String { | ||
format!("rs_{}", request_id) | ||
} |
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
Oops, something went wrong.