Skip to content

Commit 05522fe

Browse files
committed
v0.5.5
1 parent c3c0cbc commit 05522fe

File tree

5 files changed

+3
-87
lines changed

5 files changed

+3
-87
lines changed

CHANGELOG.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "satpaper"
33
authors = ["Colonial"]
4-
version = "0.5.4"
4+
version = "0.5.5"
55
edition = "2021"
66

77
description = "Display near-real-time satellite imagery on your desktop."

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Thanks to `cyberbit`, everything you need to build and run a Satpaper Docker ima
112112
- `-b`/`--background-image`/`SATPAPER_BACKGROUND_IMAGE` - the path to an image to use as the background.
113113
- Most common image formats are supported.
114114
- For best results, the image should match the specified resolution, but Satpaper will resize the image to fit if need be.
115-
- Satpaper uses a basic "marching" algorithm to find the bounds of the Earth and apply transparency to the original image, but it's not perfect - some black bordering may remain.
115+
- Satpaper uses a basic "marching" algorithm to find the bounds of the Earth and apply transparency to the original image, but it's not perfect - some black bordering and/or jagged edges may remain. (Unfortunately, the canonical algorithm for this problem - flood filling - doesn't really work, because it tends to end up eating into the Earth at night. If you have an idea for a better solution, please let me know!)
116116
- `-w`/`--wallpaper-command`/`SATPAPER_WALLPAPER_COMMAND` - custom command to run when a wallpaper is generated.
117117
- This overrides the automatic update handling.
118118
- Currently, this only works on Unix. The command will be run as `sh -c "{command} file://{image_path}`.

src/slider.rs

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -198,70 +198,6 @@ enum Direction {
198198
Right
199199
}
200200

201-
fn cutout_disk_flood(image: &mut DynamicImage) {
202-
use std::collections::VecDeque;
203-
204-
let x_max = image.dimensions().0 - 1;
205-
let y_max = image.dimensions().1 - 1;
206-
207-
let step = |mut x: u32, mut y: u32, direction: Direction| {
208-
use Direction::*;
209-
210-
match direction {
211-
Up => y = y.saturating_add(1),
212-
Down => y = y.saturating_sub(1),
213-
Left => x = x.saturating_sub(1),
214-
Right => x = x.saturating_add(1),
215-
};
216-
217-
(x, y)
218-
};
219-
220-
let mut flood_fill = |x: u32, y: u32| {
221-
use Direction::*;
222-
223-
let mut queue = VecDeque::new();
224-
225-
queue.push_back((x, y));
226-
227-
while !queue.is_empty() {
228-
let (x, y) = queue
229-
.pop_front()
230-
.expect("Queue should not be empty");
231-
232-
if x > x_max ||
233-
y > y_max
234-
{
235-
continue;
236-
}
237-
238-
let pixel = image.get_pixel(x, y);
239-
240-
// It turns out that some pixels in the "black" background are actually [1, 1, 1, 255]!
241-
// Why? Who knows.
242-
if pixel.0 <= BLACK.0 && pixel != CLEAR {
243-
image.put_pixel(x, y, CLEAR);
244-
245-
queue.push_back(step(x, y, Up));
246-
queue.push_back(step(x, y, Down));
247-
queue.push_back(step(x, y, Left));
248-
queue.push_back(step(x, y, Right));
249-
}
250-
}
251-
};
252-
253-
// These might seem redundant, but it's necessary to handle differences in the
254-
// satellite imagery - GOES has no space between the Earth and image edge on the left and right,
255-
// while the rest do.
256-
//
257-
// This handles the "edge case" of GOES's separated corners, while not doing any extra work
258-
// for the likes of Himawari (because the first fill will get all the pixels, causing the rest to finish immediately.)
259-
flood_fill(0, 0);
260-
flood_fill(x_max, 0);
261-
flood_fill(0, y_max);
262-
flood_fill(x_max, y_max);
263-
}
264-
265201
// Identifies the bounds of the Earth in the image
266202
fn cutout_disk(image: &mut DynamicImage) {
267203
// Find the midpoint and max of the edges.

0 commit comments

Comments
 (0)