Skip to content

Commit e72d75b

Browse files
rust impl (#1)
* initial rust library impl, broken currently, color channels seem flipped * try using data() and data_mut() * working rust implementation
1 parent 8c12441 commit e72d75b

File tree

11 files changed

+848
-89
lines changed

11 files changed

+848
-89
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
result
2-
build
2+
build
3+
4+
.direnv

c/include/debayer.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
// Kernel block size
1313
#define KERNEL_BLOCK_SIZE 8
1414

15-
15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
1618
void debayer_mirror_image(cudaStream_t stream, int32_t width, int32_t height, size_t input_pitch, uint8_t* input_data);
1719

1820
void debayer_rggb2bgr_malvar2004(cudaStream_t stream, int32_t width, int32_t height, size_t input_pitch, size_t output_pitch, uint8_t* input_data, uint8_t* output_data);
@@ -22,4 +24,7 @@ void debayer_rggb2bgr_bilinear(cudaStream_t stream, int32_t width, int32_t heigh
2224

2325
void debayer_rggb2bgr_saronic1(cudaStream_t stream, int32_t width, int32_t height, size_t input_pitch, size_t output_pitch, uint8_t* input_data, uint8_t* output_data);
2426

27+
#ifdef __cplusplus
28+
}
29+
#endif
2530
#endif // DEBAYERC_H

c/libdebayer.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Description: @PROJECT_DESCRIPTION@
88
Version: @PROJECT_VERSION@
99

1010
Requires:
11-
Libs: -L${libdir} -llibdebayer
11+
Libs: -L${libdir} -ldebayer
1212
Cflags: -I${includedir}

cpp/libdebayercpp.pc.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ Description: @PROJECT_DESCRIPTION@
88
Version: @PROJECT_VERSION@
99

1010
Requires:
11-
Libs: -L${libdir} -llibdebayercpp
11+
Libs: -L${libdir} -ldebayercpp
1212
Cflags: -I${includedir}

flake.nix

+4-3
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
packages.kodak_benchmark_cpp = kodak_benchmark_cpp;
8181

8282
devShells.default = mkShell {
83-
nativeBuildInputs = with pkgs; [ pkg-config cmake ];
83+
nativeBuildInputs = with pkgs; [ pkg-config cmake clang ];
8484
buildInputs = with pkgs; [
8585
gitFull gitRepo gnupg autoconf curl
8686
procps gnumake util-linux m4 gperf unzip
@@ -93,10 +93,11 @@
9393
libdebayer
9494
libdebayer_cpp
9595
rust-bin.nightly.latest.default
96-
96+
rust-analyzer
97+
imagemagick
9798
];
9899

99-
LIBCLANG_PATH = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.libclang.lib}/lib/";
100+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib/";
100101

101102

102103
shellHook = ''

0 commit comments

Comments
 (0)