Twinklebear / oidn-rs

Rust bindings to Intel's OpenImageDenoise Library
MIT License
24 stars 12 forks source link

Added hdr_scale(), swapped CString uses for \0-terminated byte slices. #10

Closed virtualritz closed 3 years ago

virtualritz commented 3 years ago

Forgot: I also moved the code supplying a normal pass under the condition checking for albedo. This is trivial but avoids a test for Some(normal) that is never ran if albedo is absent.

Twinklebear commented 3 years ago

Looks great, thanks @virtualritz ! I'll put up a minor release on Crates once CI runs through this

Twinklebear commented 3 years ago

It looks like the byte strings don't need an extra ref to be taken from them for passing through to C. In the original PR I was getting errors back from OIDN on invalid param names, after switching to b"RT\0" for example that fixed it: https://github.com/Twinklebear/oidn-rs/commit/6b0281e7df3d692b0faa3207f782578f47efe51a

virtualritz commented 3 years ago

It looks like the byte strings don't need an extra ref to be taken from them for passing through to C.

Yeah, heaps sorry. I thought I was testing my display driver agains the patched oidn-rs but I was actually still testing against the one on crates.io. Once I switched nothing worked because of the &. My bad. Heaps, heaps sorry.

Twinklebear commented 3 years ago

No worries!