[PR #1439] [MERGED] Port hardsubx imgops #2182

Open
opened 2026-01-29 17:20:42 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1439
Author: @shashwat1002
Created: 6/6/2022
Status: Merged
Merged: 6/15/2022
Merged by: @PunitLodha

Base: masterHead: port_hardsubx_imgops


📝 Commits (10+)

  • 9f50803 add hardsubx rust module and expose it
  • 77a8ab2 port rgb_to_hsv to rust
  • e1bc1d9 add dependency fast-math and extern it
  • 5c2fb1d port rgb_to_lab to rust
  • 3f3b17e improve if-else constructs for readability
  • b02ab18 unroll macros that were only used once and remove their definition
  • dcd6d8a Improve readability of rgb_to_lab function (and fixes)
  • 15efc4a remove fast math library, use palette library and rewrite imgops using it
  • 21f84f0 run formatter
  • d0d849a replace destructuring assignment statement with normal assignment statements because of build rust compiler issues

📊 Changes

6 files changed (+228 additions, -6 deletions)

View changed files

📝 src/lib_ccx/hardsubx_imgops.c (+4 -4)
📝 src/rust/Cargo.lock (+197 -2)
📝 src/rust/Cargo.toml (+1 -0)
src/rust/src/hardsubx/imgops.rs (+24 -0)
src/rust/src/hardsubx/mod.rs (+1 -0)
📝 src/rust/src/lib.rs (+1 -0)

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

On determination that the imgops functions have lowest dependency and need to be used as-is, that is where I have begun porting.

The PR introduces (as of now) a function with an identical signature to rgb_to_hsv with rest of the code unchanged. The DISABLE_RUST flag is used to decide if the Rust version is compiled or the C version.
Edit: hardsubx_imgops is now fully ported

The compilation works and the executable runs properly on the files I have. However, the who suite of tests must be run as soon as the imgops module is ported.

Ps: I discovered that when building using cmake, Rust compilation is disabled by default and I had to explicitly set the DWITHOUT_RUST=OFF
I am unsure if this is the expected behaviour.
Edit: apparently this is because cmake caches options

Cc: @PunitLodha, @cfsmp3
please look this over once to check if I am not doing something obviously dangerous. I will continue after feedback.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1439 **Author:** [@shashwat1002](https://github.com/shashwat1002) **Created:** 6/6/2022 **Status:** ✅ Merged **Merged:** 6/15/2022 **Merged by:** [@PunitLodha](https://github.com/PunitLodha) **Base:** `master` ← **Head:** `port_hardsubx_imgops` --- ### 📝 Commits (10+) - [`9f50803`](https://github.com/CCExtractor/ccextractor/commit/9f508030ef61a82559cc4ad57827ba4c27e1027d) add hardsubx rust module and expose it - [`77a8ab2`](https://github.com/CCExtractor/ccextractor/commit/77a8ab264555674fee0334a001f50cdcbbe25b05) port rgb_to_hsv to rust - [`e1bc1d9`](https://github.com/CCExtractor/ccextractor/commit/e1bc1d9ed1b0b2709bfca02799816d77aeaa9ec3) add dependency fast-math and extern it - [`5c2fb1d`](https://github.com/CCExtractor/ccextractor/commit/5c2fb1d17c759052cb9e1c21ff9ec5c0fc670a88) port rgb_to_lab to rust - [`3f3b17e`](https://github.com/CCExtractor/ccextractor/commit/3f3b17e383b7f64dc62b16deeef551f45fbc4158) improve if-else constructs for readability - [`b02ab18`](https://github.com/CCExtractor/ccextractor/commit/b02ab188bcf112cafdb0e89cc72385046744fc41) unroll macros that were only used once and remove their definition - [`dcd6d8a`](https://github.com/CCExtractor/ccextractor/commit/dcd6d8af3335debfb7f2894bb5babed93d24fc1d) Improve readability of rgb_to_lab function (and fixes) - [`15efc4a`](https://github.com/CCExtractor/ccextractor/commit/15efc4a75290b4f200fb71b0586a1e22a0fae60a) remove fast math library, use palette library and rewrite imgops using it - [`21f84f0`](https://github.com/CCExtractor/ccextractor/commit/21f84f04fccdb2a289aaf9179d964acdc426671f) run formatter - [`d0d849a`](https://github.com/CCExtractor/ccextractor/commit/d0d849a2ab1f769641900028a2a9cadd9d377067) replace destructuring assignment statement with normal assignment statements because of build rust compiler issues ### 📊 Changes **6 files changed** (+228 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/hardsubx_imgops.c` (+4 -4) 📝 `src/rust/Cargo.lock` (+197 -2) 📝 `src/rust/Cargo.toml` (+1 -0) ➕ `src/rust/src/hardsubx/imgops.rs` (+24 -0) ➕ `src/rust/src/hardsubx/mod.rs` (+1 -0) 📝 `src/rust/src/lib.rs` (+1 -0) </details> ### 📄 Description <!-- Please prefix your pull request with one of the following: **[FEATURE]** **[FIX]** **[IMPROVEMENT]**. --> **In raising this pull request, I confirm the following (please check boxes):** - [ ] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [X] I have checked that another pull request for this purpose does not exist. - [X] I have considered, and confirmed that this submission will be valuable to others. - [X] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [X] I give this submission freely, and claim no ownership to its content. - [X] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [X] I am an active contributor to CCExtractor. --- On determination that the imgops functions have lowest dependency and need to be used as-is, that is where I have begun porting. The PR introduces (as of now) a function with an identical signature to `rgb_to_hsv` with rest of the code unchanged. The `DISABLE_RUST` flag is used to decide if the Rust version is compiled or the C version. Edit: hardsubx_imgops is now fully ported The compilation works and the executable runs properly on the files I have. However, the who suite of tests must be run as soon as the `imgops` module is ported. Ps: I discovered that when building using `cmake`, Rust compilation is disabled by default and I had to explicitly set the `DWITHOUT_RUST=OFF` I am unsure if this is the expected behaviour. Edit: apparently this is because cmake caches options Cc: @PunitLodha, @cfsmp3 please look this over once to check if I am not doing something obviously dangerous. I will continue after feedback. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:20:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2182