diff --git a/.github/workflows/pdf.yml b/.github/workflows/pdf.yml index 51ccf4f2..96b4ea7c 100644 --- a/.github/workflows/pdf.yml +++ b/.github/workflows/pdf.yml @@ -3,9 +3,9 @@ name: Shared PDF on: push: branches: [main] - paths: ["crates/pdf/**", "crates/separations/**", "vendor/hayro*/**", "vendor/krilla/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] + paths: ["crates/pdf/**", "crates/prepress/**", "vendor/hayro*/**", "vendor/krilla/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] pull_request: - paths: ["crates/pdf/**", "crates/separations/**", "vendor/hayro*/**", "vendor/krilla/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] + paths: ["crates/pdf/**", "crates/prepress/**", "vendor/hayro*/**", "vendor/krilla/**", "scripts/test-pdf-backends.sh", "scripts/*fetch-pdf-test-fonts.py", "Cargo.toml", "Cargo.lock", ".github/workflows/pdf.yml"] workflow_dispatch: permissions: @@ -46,11 +46,11 @@ jobs: - run: cargo clippy -p craft-pdf --all-targets --all-features --locked -- -D warnings - run: cargo test -p craft-pdf --all-features --locked - run: cargo test --manifest-path crates/pdf/read-only-contract/Cargo.toml --locked - - name: Separations (plates through the vendored renderer) + - name: craft-prepress (plates through the vendored renderer) if: matrix.os == 'ubuntu-latest' run: | - cargo clippy -p craft-separations --all-targets --locked -- -D warnings - cargo test -p craft-separations --locked + cargo clippy -p craft-prepress --all-targets --locked -- -D warnings + cargo test -p craft-prepress --locked backends: name: PDF vendored contracts runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index ba814a83..3d133dbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -634,6 +634,15 @@ dependencies = [ "wasm-bindgen-test", ] +[[package]] +name = "craft-prepress" +version = "0.1.0" +dependencies = [ + "craft-cms", + "craft-pdf", + "thiserror 2.0.21", +] + [[package]] name = "craft-print" version = "0.1.0" @@ -657,15 +666,6 @@ dependencies = [ "objc2-app-kit 0.3.2", ] -[[package]] -name = "craft-separations" -version = "0.1.0" -dependencies = [ - "craft-cms", - "craft-pdf", - "thiserror 2.0.21", -] - [[package]] name = "craft-settings" version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml index 2ba6ad5f..f0499394 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,9 @@ craft-atomic = { path = "crates/atomic" } craft-cms = { path = "crates/cms" } craft-docpath = { path = "crates/docpath" } craft-i18n = { path = "crates/i18n" } +craft-prepress = { path = "crates/prepress" } craft-print = { path = "crates/print" } craft-quit = { path = "crates/quit" } -craft-separations = { path = "crates/separations" } craft-settings = { path = "crates/settings" } craft-ui = { path = "crates/ui" } egui = { version = "0.36", default-features = false } diff --git a/crates/separations/Cargo.toml b/crates/prepress/Cargo.toml similarity index 65% rename from crates/separations/Cargo.toml rename to crates/prepress/Cargo.toml index 4cdec570..3e65e8b9 100644 --- a/crates/separations/Cargo.toml +++ b/crates/prepress/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "craft-separations" -description = "Ink model and per-ink plates rendered from a PDF, for the Craft apps' print output" +name = "craft-prepress" +description = "Prepress for the Craft apps: ink model, per-ink plates rendered from a PDF, coverage, ink limits and composite preview" version.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/separations/README.md b/crates/prepress/README.md similarity index 96% rename from crates/separations/README.md rename to crates/prepress/README.md index a90df300..3c0dcd6b 100644 --- a/crates/separations/README.md +++ b/crates/prepress/README.md @@ -1,6 +1,6 @@ -# craft-separations +# craft-prepress -Print separations for the Craft apps: +Prepress for the Craft apps: separations, ink limits and the ink manager. - `ink`: the ink model the writers and previews share. `InkSet` holds the four process inks (always first, in plate order) and the spot inks of a job, and is the job's ink manager @@ -13,12 +13,14 @@ Print separations for the Craft apps: - `composite`: an sRGB preview of chosen plates. - `cms`: process color conversion into a CMYK printing condition through craft-cms. +A transparency flattener is planned as a module behind a `flatten` feature. + ## Plates from an exported PDF An app exports its PDF as usual, then separates a page of it: ```rust -use craft_separations::{plates, InkId, Options, Process}; +use craft_prepress::{plates, InkId, Options, Process}; let p = plates(&pdf, 0, 150.0, &Options::default())?; for (id, ink) in p.inks.iter() { @@ -101,11 +103,11 @@ Overprint is already in the plates (the renderer decides per plate what overprin knocks out), so the preview shows it without rewriting any paint as a blend mode. ```rust -use craft_separations::{CmsConversion, InkId}; +use craft_prepress::{CmsConversion, InkId}; let cms = CmsConversion::fogra39(); let mut enabled = vec![true; p.inks.len()]; -enabled[InkId::process(craft_separations::Process::Black).index()] = false; // hide Black +enabled[InkId::process(craft_prepress::Process::Black).index()] = false; // hide Black let mut rgb = p.composite(&enabled, &cms); let over = p.above(300.0, &enabled); over.paint(&mut rgb, [255, 0, 255]); // TAC warning diff --git a/crates/separations/src/cms.rs b/crates/prepress/src/cms.rs similarity index 100% rename from crates/separations/src/cms.rs rename to crates/prepress/src/cms.rs diff --git a/crates/separations/src/composite.rs b/crates/prepress/src/composite.rs similarity index 100% rename from crates/separations/src/composite.rs rename to crates/prepress/src/composite.rs diff --git a/crates/separations/src/coverage.rs b/crates/prepress/src/coverage.rs similarity index 100% rename from crates/separations/src/coverage.rs rename to crates/prepress/src/coverage.rs diff --git a/crates/separations/src/ink.rs b/crates/prepress/src/ink.rs similarity index 100% rename from crates/separations/src/ink.rs rename to crates/prepress/src/ink.rs diff --git a/crates/separations/src/lib.rs b/crates/prepress/src/lib.rs similarity index 87% rename from crates/separations/src/lib.rs rename to crates/prepress/src/lib.rs index a1676f96..3543f633 100644 --- a/crates/separations/src/lib.rs +++ b/crates/prepress/src/lib.rs @@ -1,6 +1,6 @@ #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] -//! Print separations for the Craft apps: an ink model and ink manager shared by the writers, +//! Prepress for the Craft apps: an ink model and ink manager shared by the writers, //! plates rendered from a PDF, coverage and a color preview read from the plates, and process //! color conversion through craft-cms. See the README. diff --git a/crates/separations/src/plates.rs b/crates/prepress/src/plates.rs similarity index 100% rename from crates/separations/src/plates.rs rename to crates/prepress/src/plates.rs diff --git a/crates/separations/tests/plates.rs b/crates/prepress/tests/plates.rs similarity index 97% rename from crates/separations/tests/plates.rs rename to crates/prepress/tests/plates.rs index dbde4772..2b27dadf 100644 --- a/crates/separations/tests/plates.rs +++ b/crates/prepress/tests/plates.rs @@ -1,7 +1,7 @@ use std::sync::Arc; use craft_cms::{Intent, Profile, Transform, builtin}; -use craft_separations::{Alternate, CmsConversion, Conversion, Error, Fallback, Ink, InkId, MAX_SPOT_INKS, Options, Process, plates}; +use craft_prepress::{Alternate, CmsConversion, Conversion, Error, Fallback, Ink, InkId, MAX_SPOT_INKS, Options, Process, plates}; /// A 40 × 40 pt page with `content` and `resources`, `catalog` entries, and `objects` /// numbered from 5 (each a whole object body). @@ -92,7 +92,7 @@ fn red_in(profile: &[u8]) -> [u8; 4] { cmyk.map(|v| (v * 255.0).round() as u8) } -fn red_tints(p: &craft_separations::Plates) -> [u8; 4] { +fn red_tints(p: &craft_prepress::Plates) -> [u8; 4] { Process::ALL.map(|c| p.tint(InkId::process(c), 20, 20).unwrap()) }