mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-05 10:10:46 +00:00
prepress: rename craft-separations to craft-prepress
This commit is contained in:
1 parent
2c80b65e98
commit
4585efee97
12 files changed
+27
-25
No files matched your search
@@ -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
|
||||
|
||||
Generated
+9
-9
@@ -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"
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -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.
|
||||
|
||||
File renamed without changes.
@@ -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())
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user