hayro-interpret: name the spot alternate helper for its space

This commit is contained in:
aiongg committed 2026-10-23 08:25:41 +00:00
1 parent bd5c21682c
commit 4cdf3dece4
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -182,7 +182,7 @@
"path": "src/color.rs",
"source_sha256": "799ce29bb5e59c8fc94db202873e48c2047dd35962e6f26efd215156c47158c1",
"source_git_blob": "56bb04f24c04ba33ab6bf99c02a24735670959ad",
"sha256": "ceea74f5c29b533969fa5e724dd77bae007036f5a668b2423332ee6ce7e323a0"
"sha256": "031a4615051020c34eacb28f656464db0769e2b1b8ff6f32ed328e62a8ee3d05"
},
{
"path": "src/context.rs",
+3 -3
View File
@@ -1892,7 +1892,7 @@ impl ColorSpace {
/// Craft patch (CMYK masks): the alternate space of a `Separation` or `DeviceN` space that
/// names a spot ink; `None` for other spaces, and for colorants that are all process inks,
/// `All` or `None`.
fn spot_alternate(&self) -> Option<&ColorSpace> {
fn spot_alternate_space(&self) -> Option<&ColorSpace> {
let is_spot = |c: &Colorant| matches!(c, Colorant::Ink(Ink::Spot(_)));
match self.0.as_ref() {
ColorSpaceType::Separation(s) if is_spot(&s.colorant) => Some(&s.alternate_space),
@@ -1922,7 +1922,7 @@ impl ColorSpace {
/// `spots_as_process` (Craft patch, CMYK masks), a space naming a spot ink paints as its
/// alternate space.
pub(crate) fn ink_use(&self, ink: &Ink, spots_as_process: bool) -> InkUse {
if spots_as_process && let Some(alternate) = self.spot_alternate() {
if spots_as_process && let Some(alternate) = self.spot_alternate_space() {
return alternate.ink_use(ink, false);
}
match self.0.as_ref() {
@@ -1978,7 +1978,7 @@ impl ColorSpace {
manual_scale: bool,
spots_as_process: bool,
) -> f32 {
if spots_as_process && let Some(alternate) = self.spot_alternate() {
if spots_as_process && let Some(alternate) = self.spot_alternate_space() {
let alternate_components = self.tint_transform(components);
return alternate.ink_tint(&alternate_components, ink, simulation, false, false);
}