From ebdff8b93136e894606a1c344d545c7325c5cf62 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Sun, 15 Nov 2026 13:59:18 -0500 Subject: [PATCH] Document Duotone public record fields and counts --- crates/psd/src/duotone.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/psd/src/duotone.rs b/crates/psd/src/duotone.rs index 62283f576..6c9ae49e1 100644 --- a/crates/psd/src/duotone.rs +++ b/crates/psd/src/duotone.rs @@ -19,15 +19,20 @@ pub const NO_COLOR: ColorRecord = [0xffff, 0, 0, 0, 0]; #[derive(Clone, Copy, Debug, PartialEq, Eq)] #[repr(u16)] pub enum InkCount { + /// One active ink. One = 1, + /// Two active inks. Two = 2, + /// Three active inks. Three = 3, + /// Four active inks. Four = 4, } /// One fixed-size ink slot, including uninterpreted reserved curve word. #[derive(Clone, Debug, PartialEq, Eq)] pub struct InkRecord { + /// Raw ink colour space and components. pub color: ColorRecord, /// Pascal name bytes, including its length byte; text encoding belongs to the caller. pub name: [u8; 64], @@ -63,6 +68,7 @@ impl<'a> DuotoneView<'a> { (1..=4).contains(&count).then_some(Self { data, count }) } + /// Number of active ink records (one through four). pub fn ink_count(self) -> usize { self.count }