Skip to main content

rawshift_image/
lib.rs

1//! # rawshift-image
2//!
3//! Still-image support for rawshift: a high-performance RAW image processing
4//! library with support for multiple camera formats and a full processing
5//! pipeline, plus standard compressed-format decode/encode.
6//!
7//! This crate is normally consumed through the [`rawshift`] facade crate
8//! (enable its `image` feature). Depend on `rawshift-image` directly when you
9//! need per-format Cargo feature control.
10//!
11//! [`rawshift`]: https://docs.rs/rawshift
12//!
13//! ## Supported Formats
14//!
15//! ### RAW Formats (full pipeline)
16//! - Sony ARW (v1–v5)
17//! - Adobe DNG (v1.7, including Apple ProRAW)
18//! - Canon CR2
19//! - Canon CR3 (metadata + format detection; pixel decode pending CRX codec)
20//! - Nikon NEF
21//! - Fujifilm RAF
22//!
23//! ### Standard Formats (direct RGB decode)
24//! - GIF, JPEG, PNG, WebP, JPEG XL, TIFF
25//! - SVG (requires `svg` feature)
26//! - AVIF decode + encode (requires `avif` feature)
27//! - HEIC decode (requires `heic` feature; via libheif)
28//! - APV (detection only; no Rust decoder exists yet)
29//!
30//! ## Quick Start
31//!
32//! ```no_run,ignore
33//! // Requires features = ["experimental"]
34//! use rawshift_image::formats::RawFile;
35//! use std::fs::File;
36//!
37//! let file = File::open("image.arw").expect("Failed to open file");
38//! let raw = RawFile::open(file).expect("Failed to parse RAW file");
39//! let metadata = raw.metadata();
40//! println!(
41//!     "Camera: {} {}",
42//!     metadata.camera.make,
43//!     metadata.camera.model
44//! );
45//! ```
46//!
47//! ## Processing Pipeline
48//!
49//! Raw images go through these steps:
50//! 1. Format decoding (ARW, DNG, CR2, NEF, RAF)
51//! 2. Black level subtraction
52//! 3. White balance
53//! 4. Demosaicing (AMaZE, RCD, LMMSE, Markesteijn)
54//! 5. Color matrix application
55//! 6. Tone mapping / gamma
56//!
57//! ## Feature Flags
58//!
59//! Cargo features are organised in five tiers, high-level to low-level. Each
60//! tier is defined in terms of the tier below; only tier-4 features (and RAW
61//! tier-3 features) pull in an external crate.
62//!
63//! 1. **Bundles** — `default`, `full`, `experimental`, `raw-stabilizing`,
64//!    `raw-incomplete`.
65//! 2. **Formats** — `jpeg`, `png`, `webp`, `jxl`, `avif`, `dng`, `gif`, `tiff`,
66//!    `heic`, `svg`, `arw`, `cr2`, `cr3`, `crw`, `nef`, `raf` (decode + encode
67//!    for that format).
68//! 3. **Directions** — `jpeg-decode`, `jpeg-encode`, `arw-decode`, … For
69//!    compressed formats a direction feature aliases the **default**
70//!    implementation; RAW formats have a single in-repo implementation.
71//! 4. **Implementations** — compressed formats only, named
72//!    `format-direction-impl` (e.g. `jpeg-decode-zune`). Multiple may be enabled
73//!    at once; the active backend is chosen via [`formats::DecodeOptions`] and
74//!    [`formats::export::EncodeOptions`].
75//! 5. **Infrastructure** — `tiff-parser`, `serde`, `heic-vendored`.
76//!
77//! See the "Feature Flags" section of the README for the full hierarchy.
78
79pub(crate) mod codecs;
80pub mod core;
81pub mod data;
82pub mod error;
83pub mod formats;
84pub(crate) mod metadata;
85pub mod processing;
86#[cfg(feature = "tiff-parser")]
87pub mod tiff;
88pub mod transforms;
89
90pub mod prelude;