LibKaleidoscope is a high-performance, cross-platform library that transforms ordinary images into breathtaking kaleidoscope patterns. Written in C with FFI support, it offers seamless integration with multiple programming languages and includes GPU acceleration for ultimate performance.
๐ Learn More: Check out the mathematical explanation of the kaleidoscope effect!
๐ Performance | ๐ Multi-Language | ๐จ Easy to Use | โก GPU Accelerated |
---|---|---|---|
Ultra-fast processing with optimized algorithms | C, C++, Python, CUDA support | Simple 3-function API | CUDA backend for maximum speed |
Language | Purpose | Features |
---|---|---|
๐ง C | Main programming language | Core library, maximum performance |
โก C++ | Header-only binding | Easy integration, STL compatibility |
๐ Python | Cython bindings | PyPI package, Pythonic interface |
๐ CUDA | GPU computing | Parallel processing, extreme performance |
๐ก Pro Tip: Check
python/python-test.py
for example usage!
โ ๏ธ IMPORTANT: CUDA Toolkit must be installed and available on your system before building with CUDA support. Download from NVIDIA Developer.
๐ Note: The libjpeg-turbo dependency is only for testing and demo purposes
LibKaleidoscope makes image transformation incredibly simple with just 3 functions:
Step | Function | Purpose |
---|---|---|
1๏ธโฃ | initKaleidoscope() | Initialize transformation matrix |
2๏ธโฃ | processKaleidoscope() | Process images (reusable for same dimensions) |
3๏ธโฃ | deInitKaleidoscope() | Clean up resources |
๐ Example: Check
src/kaleidoscope-cmd.c
for complete usage
Transform images instantly with the command line tool:
๐ Advantage: RAII-style resource management, exception safety
๐ก Performance Tip: Ensure your data is allocated on GPU memory for maximum speed
๐งช Examples: See
tests/processingTest.cpp
andtests/processingTest.cu
for complete implementations
Hardware: Intel i7-11800H CPU
๐ฅ Resolution | ๐ FPS | ๐ฏ Use Case |
---|---|---|
๐ฅ 4K UHD (3840ร2160) | **~65 FPS** | Professional video editing |
๐ฌ Full HD (1920ร1080) | **~265 FPS** | Real-time streaming |
๐บ 720p (1280ร720) | **~640 FPS** | Gaming overlays |
๐ฑ 576p (720ร576) | **~1350 FPS** | Mobile apps |
The performance follows an exponential decay model:
$$\Large FPS = a \cdot e^{b \cdot nPixels} + c \cdot e^{d \cdot nPixels}$$
Where:
โ ๏ธ Important: Use
-DCMAKE_BUILD_TYPE=Release
for accurate benchmarks
We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.
This project is licensed under the terms of MIT License.