Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: interactive GUI for pixel_match #33

Merged
merged 34 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6e7de9f
show recovered image
kawaemon Sep 18, 2021
3a75061
show cell border
kawaemon Sep 18, 2021
e65d62f
movable cell border
kawaemon Sep 19, 2021
eee9da0
multithreading
kawaemon Sep 20, 2021
72166a0
edge
kawaemon Sep 20, 2021
32f5951
refactor
kawaemon Sep 20, 2021
3b91d58
recalculate
kawaemon Sep 20, 2021
3579db2
wip
kawaemon Sep 21, 2021
3f880fb
buggy
kawaemon Sep 21, 2021
f532611
fixed
kawaemon Sep 21, 2021
6ae8e05
algo
kawaemon Sep 21, 2021
71ad86c
blacklist works on shaker
kawaemon Sep 21, 2021
e926d8f
prepare for confirmed pairs
kawaemon Sep 22, 2021
a89de11
refactor part.1
kawaemon Sep 22, 2021
9f09fec
split
kawaemon Sep 22, 2021
373822d
VecOnGrid<Option<_>> -> VecOnGrid<_>
kawaemon Sep 23, 2021
851c781
wip
kawaemon Sep 23, 2021
c86280c
now confirmed_pairs works
kawaemon Sep 24, 2021
e9ff1b3
draggable to x and y axis
kawaemon Sep 29, 2021
ab446b9
merge master
kawaemon Sep 30, 2021
4bea720
combine
kawaemon Sep 30, 2021
a1e24e5
ugly but better
kawaemon Oct 1, 2021
935fb08
connected square on drag
kawaemon Oct 3, 2021
bcef9cc
wip
kawaemon Oct 3, 2021
1e99e71
merge main
kawaemon Oct 3, 2021
428ad01
fix dragging bug
kawaemon Oct 4, 2021
f8163b8
refactor shaker
kawaemon Oct 5, 2021
ce825ff
select root at begin
kawaemon Oct 5, 2021
a198d96
fix draggable dir
kawaemon Oct 6, 2021
6dbb34e
Merge branch 'main' into feat/improve-pixel-match-try2
kawaemon Oct 7, 2021
08be759
remove temp code
kawaemon Oct 7, 2021
556ba67
remove unused gitignore
kawaemon Oct 7, 2021
f56a47b
update ci to install sdl2
kawaemon Oct 7, 2021
d49f0f6
remote unneeded features of sdl2
kawaemon Oct 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup SDL2
run: |
cargo install cargo-vcpkg
cargo vcpkg -v build
- name: Build
run: cargo build --release --verbose
- name: Run tests
Expand All @@ -31,6 +35,10 @@ jobs:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Setup SDL2
run: |
cargo install cargo-vcpkg
cargo vcpkg -v build
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
Expand Down
64 changes: 51 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ default-run = "procon2021_comp"
anyhow = "1.0.40"
easy-parallel = "3.1.0"
image = "0.23.14"
bitflags = "1.3.2"

reqwest = { version = "0.11.4", features = ["blocking"], optional = true }
dotenv = { version = "0.15.0", optional = true }
Expand All @@ -28,3 +29,17 @@ rand = "0.8.4"
[profile.release]
codegen-units = 1
lto = "fat"
debug = true

[dependencies.sdl2]
version = "0.34"
default-features = false
features = ["ttf", "static-link", "use-vcpkg"]

[package.metadata.vcpkg]
dependencies = ["sdl2", "sdl2-ttf"]
git = "https://github.com/microsoft/vcpkg"
rev = "261c458af6e3eed5d099144aff95d2b5035f656b"

[package.metadata.vcpkg.target]
x86_64-pc-windows-msvc = { triplet = "x64-windows-static-md" }
Binary file added mplus-1m-medium.ttf
Binary file not shown.
8 changes: 4 additions & 4 deletions src/basis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub(crate) struct Operation {
}

/// `Rot` はある断片画像を原画像の状態から時計回りに回転させた角度を表す.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum Rot {
R0,
R90,
Expand All @@ -117,7 +117,7 @@ pub(crate) enum Rot {

impl Rot {
#[inline]
fn as_num(self) -> u8 {
pub(crate) fn as_num(self) -> u8 {
match self {
Rot::R0 => 0,
Rot::R90 => 1,
Expand All @@ -127,7 +127,7 @@ impl Rot {
}

#[inline]
fn from_num(rot: u8) -> Self {
pub(crate) fn from_num(rot: u8) -> Self {
assert!(rot <= 3, "rot must be lower than 4");
match rot {
0 => Rot::R0,
Expand All @@ -147,7 +147,7 @@ impl AddAssign for Rot {
}

/// `Dir` はある断片画像において辺が位置する向きを表す.
#[derive(Debug, Clone, Copy, PartialEq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub(crate) enum Dir {
North,
East,
Expand Down
Loading