mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-25 03:53:53 +01:00
Remove unused codec workspace deps and cut examples over to craft-image-codecs
This commit is contained in:
1 parent
3400e5af9f
commit
9d90aacf00
5 files changed
+17
-17
No files matched your search
+1
-9
@@ -87,21 +87,13 @@ libc = "0.2" # dev-only: process CPU time in benches
|
||||
dhat = "0.3" # opt-in heap profiling (lightcraft-cli --features dhat-heap) and heap tests; never in product builds
|
||||
|
||||
# formats
|
||||
quick-xml = "0.41"
|
||||
miniz_oxide = "0.9"
|
||||
|
||||
# codecs
|
||||
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "tiff", "webp"] }
|
||||
zune-jpeg = { version = "0.5", default-features = false, features = ["std", "x86", "neon"] }
|
||||
zune-core = { version = "0.5", default-features = false, features = ["std"] }
|
||||
jpeg-decoder = { version = "0.3", default-features = false }
|
||||
jpeg-encoder = { version = "0.7", default-features = false, features = ["std"] }
|
||||
ab_glyph = { version = "0.2", default-features = false, features = ["std"] } # Apache-2.0, pure Rust glyph rasterizer (export watermarks)
|
||||
png = "0.18"
|
||||
tiff = "0.11"
|
||||
image-webp = "0.2"
|
||||
moxcms = { version = "0.9", default-features = false, features = ["lut"] }
|
||||
jxl-oxide = { version = "0.12", default-features = false }
|
||||
zune-core = { version = "0.5", default-features = false, features = ["std"] }
|
||||
zune-jpegxl = { version = "0.5", default-features = false, features = ["std"] } # MIT/Apache-2.0/Zlib lossless JXL encoder (test fixtures only)
|
||||
ravif = { version = "0.13", default-features = false, features = ["threading"] } # no "asm": it needs nasm (non-Rust)
|
||||
# HDR AVIF (PQ): ravif fixes the sRGB transfer curve, so HDR files drive its rav1e + avif-serialize directly
|
||||
|
||||
@@ -22,5 +22,5 @@ serde = { workspace = true }
|
||||
dhat = { workspace = true }
|
||||
lightcraft-scenes = { workspace = true }
|
||||
proptest = { workspace = true }
|
||||
image = { workspace = true }
|
||||
craft-image-codecs = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
@@ -8,7 +8,8 @@ fn main() {
|
||||
let lib = lightcraft_scenes::demo_library();
|
||||
let picks = [0usize, 2, 3, 6, 8, 5];
|
||||
let (cw, ch) = (420usize, 280usize);
|
||||
let mut sheet = image::RgbImage::new((cw * 2) as u32, (ch * picks.len()) as u32);
|
||||
let (sw, sh) = (cw * 2, ch * picks.len());
|
||||
let mut sheet = vec![0u8; sw * sh * 3];
|
||||
for (row, &i) in picks.iter().enumerate() {
|
||||
let src = lib[i].render_fit(900);
|
||||
let mut edited = DevelopSettings::default();
|
||||
@@ -27,11 +28,14 @@ fn main() {
|
||||
for y in 0..r.height {
|
||||
for x in 0..r.width {
|
||||
let p = r.get(x, y);
|
||||
sheet.put_pixel((ox + x) as u32, (oy + y) as u32, image::Rgb([p[0], p[1], p[2]]));
|
||||
let idx = ((oy + y) * sw + (ox + x)) * 3;
|
||||
sheet[idx..idx + 3].copy_from_slice(&[p[0], p[1], p[2]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
sheet.save(&out).unwrap();
|
||||
let img = craft_image_codecs::Image::from_u8(sw as u32, sh as u32, craft_image_codecs::ChannelLayout::Rgb, sheet).unwrap();
|
||||
let png = craft_image_codecs::encode(&img, craft_image_codecs::Format::Png, &Default::default()).unwrap();
|
||||
std::fs::write(&out, png).unwrap();
|
||||
println!("{out}");
|
||||
}
|
||||
@@ -15,4 +15,4 @@ serde = { workspace = true }
|
||||
rayon = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
image = { workspace = true }
|
||||
craft-image-codecs = { workspace = true }
|
||||
@@ -7,7 +7,8 @@ fn main() {
|
||||
let lib = lightcraft_scenes::demo_library();
|
||||
let (cw, ch, cols) = (360usize, 240usize, 6usize);
|
||||
let rows = lib.len().div_ceil(cols);
|
||||
let mut sheet = image::RgbImage::new((cw * cols) as u32, (ch * rows) as u32);
|
||||
let (sw, sh) = (cw * cols, ch * rows);
|
||||
let mut sheet = vec![0u8; sw * sh * 3];
|
||||
let m = REC2020.to_space(&SRGB);
|
||||
for (i, s) in lib.iter().enumerate() {
|
||||
let img = s.render_fit(cw.min(ch * 3 / 2).max(ch));
|
||||
@@ -20,10 +21,13 @@ fn main() {
|
||||
let v = v.max(0.0);
|
||||
encode_srgb8(v / (1.0 + v * 0.35))
|
||||
};
|
||||
sheet.put_pixel((ox + x) as u32, (oy + y) as u32, image::Rgb([t(c[0]), t(c[1]), t(c[2])]));
|
||||
let idx = ((oy + y) * sw + (ox + x)) * 3;
|
||||
sheet[idx..idx + 3].copy_from_slice(&[t(c[0]), t(c[1]), t(c[2])]);
|
||||
}
|
||||
}
|
||||
}
|
||||
sheet.save(&out).unwrap();
|
||||
let img = craft_image_codecs::Image::from_u8(sw as u32, sh as u32, craft_image_codecs::ChannelLayout::Rgb, sheet).unwrap();
|
||||
let png = craft_image_codecs::encode(&img, craft_image_codecs::Format::Png, &Default::default()).unwrap();
|
||||
std::fs::write(&out, png).unwrap();
|
||||
println!("{out}");
|
||||
}
|
||||
Reference in new issue
Block a user