Expand description
§Ranga — Core Image Processing Library
Ranga (रंग, Sanskrit: color/hue) provides shared image processing primitives for the AGNOS creative suite. It eliminates duplicate implementations across rasa (image editor), tazama (video editor), and aethersafta (compositor).
§Modules
color— Color spaces (sRGB, linear, HSL, CIE XYZ/Lab, Oklab/Oklch, CMYK, P3), Delta-E, color temperaturepixel— Pixel buffer with 6 formats, zero-copy views, buffer poolblend— 12 Porter-Duff blend modes with SSE2/AVX2/NEON SIMDconvert— Pixel format conversion (BT.601/709/2020, ARGB↔NV12, RGB8↔RGBA8, RgbaF32)filter— 24+ CPU filters (blur, sharpen, hue shift, 3D LUT, noise, median, bilateral)composite— Layer compositing, masks, transitions (dissolve/fade/wipe), gradientshistogram— Luminance/RGB histograms, equalization, auto-levelstransform— Crop, resize (nearest/bilinear/bicubic), affine, perspective, flipicc— ICC v2/v4 profile parsing, tone curves, embedded sRGB profilegpu— GPU compute: blend, filters, noise, transitions, crop/resize/flip, batched dispatch (GpuChain)hwaccel— GPU detection with VRAM/utilization-aware offload decisionsspectral— Physically-based color science via prakash (SPD, CIE CMFs, illuminants, CRI)
§Feature Flags
simd(default) — SSE2/AVX2/NEON SIMD acceleration for blend and convertgpu— wgpu compute pipelines withGpuChainbatched dispatchhwaccel— hardware accelerator detection via ai-hwaccel 0.23.3parallel— rayon row-parallel blurspectral— physically-based color science via prakashfull— all features
§Example
use ranga::pixel::{PixelBuffer, PixelFormat};
use ranga::filter;
let mut buf = PixelBuffer::zeroed(4, 4, PixelFormat::Rgba8);
filter::brightness(&mut buf, 0.5).unwrap();Modules§
- blend
- Blend modes — Porter-Duff and Photoshop-style compositing.
- color
- Color spaces and conversions.
- composite
- Compositing operations — layer masks, transitions, gradients, alpha handling.
- convert
- Pixel format conversion — RGB↔YUV, ARGB↔NV12, format interop.
- filter
- CPU image filters — brightness, contrast, saturation, levels, curves, blur, sharpen, hue shift, color balance, 3D LUT, vignette, and noise.
- histogram
- Histogram computation for luminance and color channels.
- icc
- ICC color profile parsing — matrix-based and LUT-based profiles.
- pixel
- Pixel buffer type — unified image buffer with format awareness.
- transform
- Geometry transforms — crop, resize, affine, flip.
Enums§
- Ranga
Error - Errors from ranga image processing operations.
Type Aliases§
- Result
- Result type alias for ranga operations.