pdftract/crates/pdftract-core/src
jedarden 6ea0b0aa54 feat(pdftract-44f6): implement GraphicsState with 13 fields, Color enum, and matrix ops
Implements the complete graphics state per PDF spec section 8.4:

- Color enum with 5 variants (DeviceGray/RGB/CMYK, Spot, Other)
- Color::to_css_hex() for JSON serialization (returns None for Spot/Other)
- GraphicsState struct with all 13 fields (ctm, text_matrix, text_line_matrix,
  font, font_size, char_spacing, word_spacing, horiz_scaling, leading,
  text_rise, text_rendering_mode, fill_color, stroke_color)
- GraphicsState::initial() returning default state (identity CTM, black colors)
- Matrix operations: scale(), translate(), rotate(), invert()
- Manual Debug impl for GraphicsState (Font doesn't implement Debug)

All acceptance criteria PASS:
- initial() has identity CTM, font_size 0.0, fill_color DeviceGray(0.0)
- Clone produces deep-equal value
- Color::DeviceRGB([1.0, 0.0, 0.0]).to_css_hex() == Some("#ff0000")
- Color::Spot returns None
- Matrix multiply identity*identity within 1e-10

Closes: pdftract-44f6

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-24 15:49:50 -04:00
..
annotation feat(pdftract-46qa): implement 7.6.1 annotation walker dispatcher 2026-05-24 15:30:45 -04:00
attachment feat(pdftract-3lir): implement Filespec dict + EF stream decoder 2026-05-24 13:54:27 -04:00
cache feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
fingerprint feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
font feat(pdftract-2iur): implement nearest-neighbor scanner with Hamming distance and frequency tie-break 2026-05-24 06:57:27 -04:00
forms feat(pdftract-5qca): implement form_fields JSON output + schema integration 2026-05-24 14:36:03 -04:00
layout feat(pdftract-64j83): implement column label assignment to Span.column + Line.column 2026-05-24 14:45:19 -04:00
ocr/preprocessing feat(pdftract-6dki1): implement histogram stretch contrast normalization 2026-05-24 10:30:20 -04:00
parser feat(pdftract-66ykq): implement CCITTFaxDecode passthrough with diagnostics 2026-05-24 13:20:25 -04:00
profiles feat(pdftract-64p5): implement classify CLI subcommand and --auto flag 2026-05-24 15:16:56 -04:00
receipts feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
render feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
schema feat(pdftract-5qca): implement form_fields JSON output + schema integration 2026-05-24 14:36:03 -04:00
signature feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
table feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
atomic_file_writer.rs feat(pdftract-68wfa): implement AtomicFileWriter for atomic file writes 2026-05-24 13:02:37 -04:00
classify.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
content_stream.rs feat(pdftract-62uon): implement Do operator for form XObject execution 2026-05-24 15:42:26 -04:00
diagnostics.rs feat(pdftract-66ykq): implement CCITTFaxDecode passthrough with diagnostics 2026-05-24 13:20:25 -04:00
document.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
dpi.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
extract.rs feat(pdftract-5qca): implement form_fields JSON output + schema integration 2026-05-24 14:36:03 -04:00
graphics_state.rs feat(pdftract-44f6): implement GraphicsState with 13 fields, Color enum, and matrix ops 2026-05-24 15:49:50 -04:00
hybrid.rs feat(pdftract-64j83): implement column label assignment to Span.column + Line.column 2026-05-24 14:45:19 -04:00
lib.rs feat(pdftract-46qa): implement 7.6.1 annotation walker dispatcher 2026-05-24 15:30:45 -04:00
markdown.rs feat(pdftract-5qca): implement form_fields JSON output + schema integration 2026-05-24 14:36:03 -04:00
ocr.rs feat(pdftract-6dki1): implement histogram stretch contrast normalization 2026-05-24 10:30:20 -04:00
options.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
preprocess.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
render.rs feat(pdftract-axcri): record inline images as ImageXObject entries 2026-05-24 07:41:50 -04:00
semaphore.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
span_flags.rs feat(pdftract-cbrbg): implement span flag detector for Phase 4.1 2026-05-24 07:28:25 -04:00
url_validation.rs feat(pdftract-3s2i): implement Phase 5.5.2 validation filter 2026-05-24 04:57:17 -04:00
word_boundary.rs feat(pdftract-h2s0z): implement adaptive word boundary detector 2026-05-24 06:06:56 -04:00