1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
File: crates/ag-psd/src/lib.rs
Purpose:
Корень крейта `ag-psd` (Rust-порт одноимённой TS-библиотеки). Зеркалирует
`index.ts`: объявляет все модули и собирает публичные re-export'ы.
Main responsibilities:
- объявить `pub mod ...;` для каждого порта upstream-файла (разбиение 1:1);
- свести будущий публичный API крейта в одну точку входа (как `index.ts`);
- быть единственным местом, где задаётся видимость модулей наружу.
Source compatibility:
- зеркало `test/ag-psd/src/index.ts`.
PORT STATUS: stub — модули объявлены, логика ещё не портирована.
*/
//! # ag-psd
//!
//! Read and write Adobe Photoshop (`.psd` / `.psb`) files in pure Rust.
//!
//! This crate is a from-scratch Rust port of the
//! [`ag-psd`](https://github.com/Agamnentzar/ag-psd) TypeScript library. The
//! data model mirrors the upstream structures, so anyone familiar with the JS
//! API will recognize [`psd::Psd`], [`psd::Layer`], [`psd::ReadOptions`] and
//! [`psd::WriteOptions`].
//!
//! ## Quick start
//!
//! ```no_run
//! use ag_psd::{read_psd, write_psd};
//! use ag_psd::psd::{ReadOptions, WriteOptions};
//!
//! // Read
//! let bytes = std::fs::read("input.psd").unwrap();
//! let psd = read_psd(&bytes, &ReadOptions::default()).unwrap();
//! println!("{}x{}, {} top-level layers", psd.width, psd.height,
//! psd.children.as_ref().map_or(0, |c| c.len()));
//!
//! // Write
//! let out = write_psd(&psd, &WriteOptions::default());
//! std::fs::write("output.psd", out).unwrap();
//! ```
//!
//! The most important entry points are [`read_psd`] and [`write_psd`]; the
//! document/layer types live in the [`psd`] module. See the `README.md` and
//! `docs/usage.md` in the repository for a detailed guide.
//!
//! ## Vibe-coded port
//!
//! This port was written almost entirely by **Claude** (Anthropic), using the
//! upstream TypeScript source as the specification and its test fixtures as the
//! oracle. See the README for the full status and known limitations.
// dead_code is expected: not every ported symbol is wired into the public API.
// Публичные re-export'ы (зеркало index.ts) добавляются по мере портирования,
// например `pub use psd::*;`, `pub use abr::*;`, `pub use csh::*;`.
pub use ;
pub use decode_engine_data2;
pub use ;
pub use ;
pub use ;
pub use read_psd;
pub use ;