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

Enable image feature avif-native (decoder for Avif) #2007

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .justfiles/clippy.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
clippy:
cargo clippy --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} --all-targets --all-features -- -D warnings
49 changes: 49 additions & 0 deletions .justfiles/dav1d.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
dav1d: dirs

install-meson:
python --version
pip install -U meson setuptools ninja

clone:
-git clone --branch 1.3.0 --depth 1 https://code.videolan.org/videolan/dav1d.git {{ join(justfile_directory(), 'target', 'dav1d') }}

[unix]
prepare: clone install-meson
pwd
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}

[windows]
setup-msvc:
$LinkGlob = "VC\Tools\MSVC\*\bin\Hostx64\x64"
$env:PATH = "$env:PATH;${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer"
$LinkPath = vswhere -latest -products * -find "$LinkGlob" | Select-Object -Last 1
$env:PATH = "$env:PATH;$LinkPath"

[windows]
setup-nasm:
@echo 'TODO'

[windows]
prepare: clone install-meson setup-msvc setup-nasm
pwd
meson setup -Denable_tools=false -Denable_examples=false --buildtype release {{ join(justfile_directory(), 'target', 'dav1d_build') }} {{ join(justfile_directory(), 'target', 'dav1d') }}

compile: prepare
pwd
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }}

install: compile
ninja -C {{ join(justfile_directory(), 'target', 'dav1d_build') }} install

dirs:
@echo {{ just_executable() }}
@echo {{ join(justfile_directory(), 'target', 'dav1d') }}
@echo {{ join(justfile_directory(), 'target', 'dav1d_build') }}
@echo 'After compiling dav1d set:'
@echo PKG_CONFIG_PATH={{ join(justfile_directory(), 'target', 'dav1d_build', 'pkgconfig') }}
@echo LD_LIBRARY_PATH={{ join(justfile_directory(), 'target', 'dav1d_build') }}

[confirm("Are you sure you want to remove dav1d and dav1d_build?")]
clear:
rm -rf {{ join(justfile_directory(), 'target', 'dav1d') }}
rm -rf {{ join(justfile_directory(), 'target', 'dav1d_build') }}
7 changes: 7 additions & 0 deletions .justfiles/deny.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
deny: workspace

workspace: install-cargo-deny
cargo deny --log-level error --workspace --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} check

install-cargo-deny:
cargo install cargo-deny
7 changes: 7 additions & 0 deletions .justfiles/fmt.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fmt: run

run:
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

check:
cargo fmt --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }} -- --check
10 changes: 10 additions & 0 deletions .justfiles/msrv.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
msrv: verify

run: install-cargo-msrv
cargo msrv --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

verify: install-cargo-msrv
cargo msrv verify --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

install-cargo-msrv:
cargo install cargo-msrv --version 0.16.0-beta.20 --no-default-features
7 changes: 7 additions & 0 deletions .justfiles/test.just
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test: all no-default-features

all:
cargo test --all --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}

no-default-features:
cargo test --all --no-default-features --manifest-path {{ join(justfile_directory(), 'Cargo.toml') }}
152 changes: 149 additions & 3 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ yare = "3"
[build-dependencies]

[features]
default = ["imageproc-ops", "nasm"]
default = ["avif-decoder" ,"imageproc-ops", "nasm"]
imageproc-ops = ["sic_core/imageproc-ops", "sic_cli_ops/imageproc-ops", "sic_image_engine/imageproc-ops", "sic_parser/imageproc-ops"]
nasm = ["sic_core/nasm"]
avif-decoder = ["sic_core/avif-decoder"]

output-test-images = []

Expand Down
21 changes: 0 additions & 21 deletions Makefile

This file was deleted.

1 change: 1 addition & 0 deletions crates/sic_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ thiserror = "1"

[features]
nasm = ["image/nasm"]
avif-decoder = ["image/avif-native"]
imageproc-ops = ["imageproc", "ab_glyph"]
Loading
Loading