Skip to content

Commit

Permalink
feat: basic functional proyect
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioRibera committed Jan 4, 2024
1 parent c11c78b commit 0e64584
Show file tree
Hide file tree
Showing 17 changed files with 1,017 additions and 85 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[workspace.package]
name = "sss"
version = "0.0.1"
edition = "2021"
license = "MIT OR Apache-2.0"
Expand All @@ -22,4 +21,3 @@ codegen-units = 1
[workspace.dependencies]
log = "0.4.20"
env_logger = "0.10.0"
thiserror = "1.0.50"
6 changes: 6 additions & 0 deletions crates/sss_cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ name = "sss_cli"
version = "0.1.0"
edition = "2021"

[[bin]]
name = "sss"
path = "./src/main.rs"

[dependencies]
sss_lib = { path = "../sss_lib" }
clap = { version = "4.4.8", features = [
"derive",
"color",
"env",
"suggestions",
"wrap_help",
] }
screenshots = "0.8.6"
20 changes: 19 additions & 1 deletion crates/sss_cli/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
use sss_lib::{generate_image, DynImageContent, GenerationSettings, Shadow};

struct Screenshot;

impl DynImageContent for Screenshot {
fn content(&self) -> sss_lib::image::DynamicImage {
let binding = screenshots::Screen::all().unwrap();
let screens = binding.last().unwrap();
let img = screens.capture().unwrap();
sss_lib::image::DynamicImage::ImageRgba8(img)
}
}

fn main() {
println!("Hello, world!");
let img = generate_image(GenerationSettings {
shadow: Some(Shadow::default()),
..Default::default()
}, Screenshot);

img.save("./algo.png").unwrap();
}
1 change: 1 addition & 0 deletions crates/sss_lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ font-kit = "0.12.0"
imageproc = "0.23.0"
arboard = { version = "3.3.0", features = ["wayland-data-control"] }
image = { version = "0.24.7", default-features = false, features = ["png", "jpeg", "jpeg_rayon", "webp"] }
rayon = "1.8.0"
Loading

0 comments on commit 0e64584

Please sign in to comment.