Crates.io | img_rcc |
lib.rs | img_rcc |
version | |
source | src |
created_at | 2024-12-11 16:14:12.756018 |
updated_at | 2024-12-11 16:14:12.756018 |
description | A Rust library for image processing with CUDA, C++. |
homepage | |
repository | https://github.com/ndranathunga/imgRCC |
max_upload_size | |
id | 1480239 |
Cargo.toml error: | TOML parse error at line 30, column 1 | 30 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This project is a fun and educational venture designed to explore the interoperability of multiple programming languages—namely C++, CUDA, and Rust—and to understand how we can utilize the strengths of each language in a multi-module, cross-language setting. The aim is to build a high-performance image processing library with GPU acceleration using CUDA, organized modularly in C++, with high-level safe bindings in Rust. Eventually, the library will also offer bindings for Python and Go, making it versatile and usable across various programming ecosystems.
Through this project, I'm learning:
Image Loading and Saving:
Grayscale Conversion:
Benchmarking Tools:
Image Convolution:
Gaussian Blur:
Sobel Edge Detection:
Color Conversion (RGB to HSV/YCbCr):
Thresholding:
Python Bindings:
Go Bindings:
The project is organized into several modules:
/parallel_image_processing_lib/
├── include/ # C++ headers
├── src/ # Rust bindings
├──── cpp/ # C++ source files
├──── cuda/ # CUDA source files
├── tests/ # Unit tests
├── benchmarks/ # Performance benchmarks
├── cmake/ # CMake modules
├── build.rs # Rust build script
├── CMakeLists.txt # CMake build configuration
├── Cargo.toml # Rust project configuration
└── README.md # This file
Clone the repository:
https://github.com/ndranathunga/imgRCC.git
cd imgRCC
Build the project using CMake for the C++/CUDA part:
mkdir build
cd build
cmake ..
make
Build the Rust bindings:
cargo build
You can use the library within a Rust project by adding it as a dependency in your Cargo.toml
:
[dependencies]
img_rcc = { path = "../path/to/imgRCC" }
Then, use it in your Rust code:
use img_rcc::grayscale_cpu;
fn main() {
let image = load_image_("input.jpg"); // Function to load image (not yet implemented)
let grayscale_image = grayscale_cpu(image);
save_image_(grayscale_image, "output.jpg"); // Function to save image (not yet implemented)
}
The project includes unit tests for both C++ and Rust components. To run the Rust tests:
cargo test
For C++ tests, run the make test
command after building the project using CMake.