feat(domain): R4.6 ExportSession (incremental export, OD-2): rasters decoded and written on arrival, chunked file handed out in parts, views composed by the core, raster_size_of (O4); wasm ExportSession and CoreExportSession; R4 digests re-frozen (catalog and page tree written last, B2)
This commit is contained in:
1 parent
8d16be577c
commit
9e688b6801
38 files changed
+2421
-354
No files matched your search
@@ -95,3 +95,22 @@ fn expand_parts(parts: &[Value], dir: &std::path::Path) -> Vec<u8> {
|
||||
pub fn latin1_bytes(text: &str) -> Vec<u8> {
|
||||
text.chars().map(|c| u32::from(c) as u8).collect()
|
||||
}
|
||||
|
||||
/// An [`ImageSink`] for the layout oracles: keeps every PNG given, sized from its header,
|
||||
/// so the O1 `pngSha256` per embed index can be checked without a PDF writer.
|
||||
#[derive(Default)]
|
||||
pub struct PngKeeper {
|
||||
pub pngs: Vec<Vec<u8>>,
|
||||
}
|
||||
|
||||
impl faunosteo_core::pdf::write::layout::ImageSink for PngKeeper {
|
||||
fn embed(&mut self, png: &[u8]) -> Option<faunosteo_core::pdf::write::layout::Image> {
|
||||
let (width, height) = faunosteo_core::pdf::write::layout::png::dimensions(png)?;
|
||||
self.pngs.push(png.to_vec());
|
||||
Some(faunosteo_core::pdf::write::layout::Image {
|
||||
embed: self.pngs.len() - 1,
|
||||
width,
|
||||
height,
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user