Skip to content
Merged
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
43 changes: 42 additions & 1 deletion .github/workflows/build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
toolchain: [ stable, "1.89.0" ]
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
- run: rustup target add aarch64-unknown-linux-gnu x86_64-unknown-linux-gnu i686-unknown-linux-gnu powerpc-unknown-linux-gnu
- run: RUSTFLAGS="-C target-feature=+neon" cargo build --all-features --target aarch64-unknown-linux-gnu
- run: RUSTFLAGS="-C target-feature=+sse4.1" cargo build --all-features --target i686-unknown-linux-gnu
Expand All @@ -31,4 +36,40 @@ jobs:
- run: RUSTFLAGS="-C target-feature=+sse4.1" cargo build --all-features --target x86_64-unknown-linux-gnu
- run: RUSTFLAGS="-C target-feature=+avx2" cargo build --all-features --target x86_64-unknown-linux-gnu
- name: Test release pipeline
run: cargo publish --dry-run
run: cargo publish --dry-run
if: matrix.toolchain == 'stable'

test_x86_64:
name: Test x86_64
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run tests SSE4.1
run: RUSTFLAGS="-C target-feature=+sse4.1" cargo test --all-features
- name: Run tests AVX2
run: RUSTFLAGS="-C target-feature=+avx2" cargo test --all-features
- name: Run tests no features
run: cargo test --no-default-features

test_i686:
name: Test i686
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: rustup target add i686-unknown-linux-gnu
- run: sudo apt-get install -y gcc-multilib
- name: Run tests SSE4.1
run: RUSTFLAGS="-C target-feature=+sse4.1" cargo test --all-features --target i686-unknown-linux-gnu
- name: Run tests AVX2
run: RUSTFLAGS="-C target-feature=+avx2" cargo test --no-default-features --target i686-unknown-linux-gnu

test_aarch64:
name: Test AArch64 NEON
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Run tests
run: cargo test --all-features
8 changes: 4 additions & 4 deletions .github/workflows/mirroring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@gitlab.com/awxkee/colorutils.git
git remote add codeberg https://awxkee:${{ secrets.CODEBERG_TOKEN }}@codeberg.org/awxkee/colorutils.git
git push gitlab --all --force
git push gitlab --tags --force
git push codeberg --all --force
git push codeberg --tags --force
git push gitlab --all
git push gitlab --tags
git push codeberg --all
git push codeberg --tags
2 changes: 1 addition & 1 deletion Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ workspace = { members = ["src/app"] }

[package]
name = "colorutils-rs"
version = "0.7.6"
edition = "2021"
version = "0.8.0"
edition = "2024"
description = "High performance utilities for color format handling and conversion."
readme = "README.md"
keywords = ["lab", "hsv", "xyz", "color", "colorspace"]
Expand All @@ -14,6 +14,7 @@ categories = ["multimedia::images", "multimedia::video"]
homepage = "https://github.com/awxkee/colorutils-rs"
repository = "https://github.com/awxkee/colorutils-rs"
exclude = ["*.jpg"]
rust-version = "1.89.0"

[dependencies]
erydanos = "0.2"
Expand Down
38 changes: 22 additions & 16 deletions src/app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,22 @@ fn main() {

{
let mut lab_store: Vec<f32> = vec![];
let store_stride = width as usize * components * std::mem::size_of::<f32>();
lab_store.resize(width as usize * components * height as usize, 0.);
let src_stride = width * components as u32;
let start_time = Instant::now();
rgba_to_oklab(
src_bytes,
src_stride,
&mut lab_store,
store_stride as u32,
width,
height,
&ImageBuffer::new(src_bytes, width, height, src_stride, 4).unwrap(),
&mut ImageBufferMut::new(
BufferStore::Borrowed(&mut lab_store),
width,
height,
src_stride,
4,
)
.unwrap(),
TransferFunction::Srgb,
);
)
.unwrap();
let elapsed_time = start_time.elapsed();
// Print the elapsed time in milliseconds
println!("RGBA To HSV: {:.2?}", elapsed_time);
Expand All @@ -85,7 +88,6 @@ fn main() {
// let dst_stride = width * 4 * std::mem::size_of::<f32>() as u32;
// append_alpha(&mut destination, dst_stride, &store, store_stride as u32, &alpha_store, alpha_stride as u32, width, height);

let lab_stride = width as usize * 3usize * std::mem::size_of::<f32>();
//
// let mut src_shift = 0usize;
// for _ in 0..height as usize {
Expand All @@ -104,14 +106,18 @@ fn main() {

let start_time = Instant::now();
oklab_to_rgba(
&lab_store,
store_stride as u32,
&mut dst_slice,
src_stride,
width,
height,
&ImageBuffer::new(&lab_store, width, height, src_stride, 4).unwrap(),
&mut ImageBufferMut::new(
BufferStore::Borrowed(&mut dst_slice),
width,
height,
src_stride,
4,
)
.unwrap(),
TransferFunction::Srgb,
);
)
.unwrap();

let elapsed_time = start_time.elapsed();
// Print the elapsed time in milliseconds
Expand Down
Loading