Bounded native OpenEXR HDR channel interchange and windowed decoding
moon version --all
moon check --target all --deny-warn
moon build --target all --deny-warn
moon test --target all --deny-warn
moon run examples/render_assets
moon run examples/scientific_imaging
moon run examples/offline_preview --target js
moon run examples/scale --target native --releasemoon add FikaRomantic/moonexr@0.1.0.\tools\windows\moon.ps1 check --target all --deny-warn
.\tools\windows\moon.ps1 test --target all --deny-warn
.\tools\windows\moon.ps1 run examples/render_assetsfn main raise {
let w = @exr.Window::new(-1, 2, 1, 3)
let ids = @exr.Plane::from_values(
{ name: "id", kind: U32, linear: true }, w,
[0.0, 1.0, 16777217.0, 4294967295.0, 42.0, 7.0],
)
let image = @exr.Image::new(w, [ids])
let file = @exr.ExrFile::open(@exr.encode(image))
let roi = file.read(region=Some(@exr.Window::new(0, 2, 1, 3)))
assert_eq(roi.plane("id").bits_at(1, 2), 16777217U)
}| 项目 | 已支持 | 明确不支持/不承诺 |
|---|---|---|
| 存储 | EXR version2单部件、平面scanline;增序/减序声明与offset表读取 | tiled、deep、multipart、随机行序声明、未来flags |
| 通道 | UINT32、IEEE HALF16、FLOAT32,单位采样,命名层、长UTF-8名字 | 子采样、自动合成Y/RY/BY、任意像素类型 |
| 压缩 | NONE、RLE、ZIPS、ZIP及无收益raw fallback;ZIP16行尾块 | PIZ、PXR24、B44、DWAA/DWAB等;没有隐式降级 |
| 元数据 | 标准窗口/屏幕/像素比例,未知可选属性原始保留;string/int/float/chromaticities辅助接口 | 任意可选属性的领域解释、ICC变换、设备校准 |
| 读写 | 确定性whole-image编码,原子批push,块计划、区域/通道选择、分批返回 | 文件IO流式读取、零复制、物理字节完全一致重写 |
| 处理 | crop/select/rename/translate、层选择/合并、显式类型转换、有限值统计/直方图、RGBA预览 | 合成器、滤镜引擎、渲染器、完整色彩管理 |
moon run cmd/main --target native -- inspect INPUT.exr
moon run cmd/main --target native -- bits INPUT.exr
moon run cmd/main --target native -- demo NEW.exr
moon run cmd/main --target native -- rewrite INPUT.exr NEW.exr zip
python -m venv _local/venv
# 激活环境后安装;Windows也可直接使用_local/venv/Scripts/python.exe
python -m pip install -r scripts/requirements-interop.txt
moon build --target native --deny-warn
python scripts/interop.py verify _build/native/debug/build/cmd/main/main.exepub struct ExrFile {
// private fields
}pub struct Header {
// private fields
}pub(all) struct Histogram {
lower : Double
upper : Double
bins : Array[Int]
below : Int
above : Int
nonfinite : Int
}pub struct Image {
// private fields
}pub(all) struct MaskedStatistics {
selected : Int
finite_samples : Int
nonfinite_samples : Int
minimum : Double?
maximum : Double?
mean : Double?
} derive(Debug)pub struct Plane {
// private fields
}pub(all) struct PlaneStatistics {
samples : Int
finite_samples : Int
nan_samples : Int
positive_infinities : Int
negative_infinities : Int
negative_zeros : Int
minimum : Double?
maximum : Double?
mean : Double?
population_variance : Double?
} derive(Debug)pub(all) struct SampleDifference {
samples : Int
changed_bits : Int
finite_pairs : Int
maximum_absolute_error : Double?
} derive(Debug)pub struct Scan {
// private fields
}pub struct Writer {
// private fields
}fn float_bits_to_half(bits : UInt) -> Intfn half_to_float_bits(bits : Int) -> UIntInstall
Download zipBounded native OpenEXR HDR channel interchange and windowed decoding