| Crates.io | img_rcc |
| lib.rs | img_rcc |
| version | 0.1.0 |
| created_at | 2024-12-11 16:14:12.756018+00 |
| updated_at | 2024-12-11 16:14:12.756018+00 |
| description | A Rust library for image processing with CUDA, C++. |
| homepage | |
| repository | https://github.com/ndranathunga/imgRCC |
| max_upload_size | |
| id | 1480239 |
| size | 446,794 |
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.