Skip to content

Commit 5d09404

Browse files
committed
FastImage v0.1.0-STABLE: Final Polish (32-byte Alignment, API Design, Full Handle Safety)
1 parent db0a584 commit 5d09404

3 files changed

Lines changed: 258 additions & 431 deletions

File tree

README.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
1-
# FastImage — SIMD-Accelerated Native Imaging for Java
1+
# FastImage — SIMDAccelerated, Off‑Heap Image Processing for Java
22

3-
**Ultra-fast image processing using native AVX2/SSE4.1 kernels and off-heap memory.**
3+
[![FastJava](https://img.shields.io/badge/Ecosystem-FastJava-0078D4.svg?style=for-the-badge&logo=java)](https://github.com/andrestubbe)
4+
[![Release](https://img.shields.io/badge/Release-v0.1.0--STABLE-green.svg?style=for-the-badge)](https://github.com/andrestubbe/FastImage/releases)
5+
[![Performance](https://img.shields.io/badge/Performance-10--50x_Faster-blue.svg?style=for-the-badge)](https://github.com/andrestubbe/FastImage#benchmarks)
46

5-
[![Java](https://img.shields.io/badge/Java-17+-blue.svg)](https://www.java.com)
6-
[![Platform](https://img.shields.io/badge/Platform-Windows%20x64-lightgrey.svg)]()
7-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8-
[![Standard: BluePrint](https://img.shields.io/badge/Standard-BluePrint-blueviolet.svg)](#)
7+
**FastImage** ist eine ultra‑schnelle, native‑beschleunigte Image‑Processing‑Engine für Java, gebaut für das FastJava‑Ecosystem. Es kombiniert AVX/SSE SIMD, off‑heap Storage, zero‑copy Pipelines und eine fluent API, um typische BufferedImage‑Operationen **10–50× schneller** auszuführen — ohne GC‑Pressure, ohne Pixel‑Loops, ohne JVM‑Overhead.
98

10-
FastImage is the high-performance imaging core of the **FastJava** ecosystem. By moving pixel data out of the JVM heap and into **native memory**, it eliminates GC overhead and enables real-time filters (Blur, Contrast, Brightness) at 60+ FPS on 4K images.
9+
### Highlights
10+
-**SIMD Accelerated**: AVX2 & SSE4.1 optimierte Kernel für maximale CPU-Ausnutzung.
11+
- 📦 **Off-Heap Memory**: Pixel werden außerhalb des Java-Heaps gespeichert (kein GC-Overhead).
12+
- 🧬 **Fluent API**: Intuitive Verkettung von Operationen (`resize().blur().grayscale()`).
13+
- 🛡️ **Fail-Safe JNI**: Robuste Fehlerbehandlung und Bounds-Checks.
14+
15+
---
16+
17+
### Tags
18+
`java` `image-processing` `simd` `avx` `sse` `native` `jni` `off-heap` `high-performance` `fastjava` `graphics` `zero-copy`
1119

1220
---
1321

docs/API_DESIGN.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# FastImage API Design & Architecture
2+
3+
FastImage is designed for ultra-high-performance image processing in Java, bypassing the limitations of the JVM heap and garbage collector.
4+
5+
## Core Philosophy
6+
7+
1. **Off-Heap Storage**: Pixel data is stored in native memory via `_aligned_malloc`. This avoids GC pressure and allows direct access by native SIMD kernels.
8+
2. **SIMD Acceleration**: Every core operation is vectorized using Intel SSE4.1 and AVX2 instructions.
9+
3. **Runtime Dispatching**: The library detects CPU features at startup and automatically chooses the fastest available code path (AVX2 -> SSE4.1 -> Plain C++).
10+
4. **Zero-Stutter JNI**: JNI transitions are minimized, and long-running operations are designed to be thread-safe for background execution.
11+
12+
## Memory Model
13+
14+
- **Manual Management**: Since memory is off-heap, `dispose()` must be called to free native resources. A fallback `finalize()` is provided but should not be relied upon.
15+
- **Alignment**: All buffers are 32-byte aligned to satisfy the requirements of 256-bit AVX instructions.
16+
17+
## Error Handling
18+
19+
- **Bounds Validation**: All parameters (radii, dimensions, factors) are validated in Java before reaching native code.
20+
- **Native Safety**: JNI entry points verify native handles. Invalid access throws `FastImageException` instead of crashing the JVM.
21+
22+
## Integration with FastJava
23+
24+
FastImage follows the **BluePrint** standard:
25+
- Modular architecture.
26+
- Fluent API for filter chaining.
27+
- Native performance with Java simplicity.

0 commit comments

Comments
 (0)