Skip to content

feat(core): Pattern / Shading の解決と scn・sh 対応 - #759

Merged
DIO0550 merged 4 commits into
mainfrom
feature/677-pattern-shading-v2
Nov 11, 2026
Merged

DIO0550 merged 4 commits into
mainfrom
feature/677-pattern-shading-v2

Conversation

@DIO0550

@DIO0550 DIO0550 commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

scn / SCN のパターン名を現在の /Resources から解決し、種別と主要属性を取得できるようにします。sh も既定レジストリへ登録します。

  • /Pattern・/Shading のカテゴリ、各定義、主要属性と数値配列要素の間接参照に対応。
  • PatternType 1・2、PaintType、TilingType、ShadingType 1〜7を型で表現し、着色方式・基底色空間・オペランドを検証。
  • /Function は元の参照・辞書・配列を保持。関数評価、メッシュ復号、実際の塗りは対象外。
  • 不正・未知・名前不在は使用位置の警告、参照解決エラーは元の原因を保持。スコープ分離と q/Q に対応。パターンが見つからない警告には指定名を含めます。
  • docs/guides/patterns-shadings.html にPDFの仕組みと具体例を追加。PDF例は静的な構文色分け、文字サイズはJavaScriptなしで切り替えます。

検証: 通常テスト 4,582件、型テスト 96件、型チェック、ビルド、lint が成功。lintの警告2件は既存の .github/scripts/comment-pr-explain.cjs のものです。実PDFバイト列・実ObjectStoreで正常系、未知の種別、壊れた参照、スコープ分離、q/Qを確認しています。

ガイドは読み取り専用の独立静的監査済み。ガイド単体の実画面確認は、Chromiumの起動制限とブラウザのローカルURL制限により未実施です。Rust側には対応する命令実行層がないため、変更はTypeScript側です。

現在の main を起点に作成した、Issue #677 の対応です。履歴更新前のクローズ済みPR #758を引き継いでいます。
根拠: docs/specs/04_resources_graphics_state.md §3.4〜3.6。

Closes #677

github-actions Bot added a commit that referenced this pull request Nov 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Lines Branches Functions Statements

Category Coverage
Lines 🟢 96.81%
Branches 🟢 95.22%
Functions 🟢 100.00%
Statements 🟢 96.81%
File Details
File Lines Branches Functions Statements
packages/core/src/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/color-operation/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/color-space-resources/index.ts 85.0% 🟢 71.2% 🟡 100.0% 🟢 85.0% 🟢
packages/core/src/content-stream/ext-gstate/index.ts 95.6% 🟢 92.3% 🟢 100.0% 🟢 95.6% 🟢
packages/core/src/content-stream/ext-gstate/parameter/index.ts 89.0% 🟢 85.9% 🟢 100.0% 🟢 89.0% 🟢
packages/core/src/content-stream/graphics-state/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/alpha/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/blend-mode/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/clipping-rule/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/color/index.ts 98.5% 🟢 96.0% 🟢 100.0% 🟢 98.5% 🟢
packages/core/src/content-stream/graphics-state/color-space/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/current-path/index.ts 95.7% 🟢 96.0% 🟢 100.0% 🟢 95.7% 🟢
packages/core/src/content-stream/graphics-state/dash-pattern/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/graphics-state/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/line-cap/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/line-join/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/matrix/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/path-segment/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/rendering-intent/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/soft-mask/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/stack/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/text-font/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/text-object/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/text-rendering-mode/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/graphics-state/text-state/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/inline-image/handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/inline-image/inline-image-dict/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/interpreter/index.ts 96.9% 🟢 94.7% 🟢 100.0% 🟢 96.9% 🟢
packages/core/src/content-stream/interpreter/composite-operand/index.ts 95.2% 🟢 93.1% 🟢 100.0% 🟢 95.2% 🟢
packages/core/src/content-stream/marked-content/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/marked-content/stack/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operand-stack/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operator-registry/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/cmyk/fill.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/cmyk/stroke.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/color-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/gray/fill.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/gray/stroke.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/rgb/fill.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/rgb/stroke.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/color/selection/index.ts 97.6% 🟢 96.4% 🟢 100.0% 🟢 97.6% 🟢
packages/core/src/content-stream/operators/graphics-state/cm/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/d/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/graphics-state-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/graphics-state-operators/register-graphics-state-operators.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/gs/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/i/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/line-cap-handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/line-join-handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/line-width-handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/miter-limit-handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/numeric-pdf-object/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/q/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/q-restore/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/graphics-state/ri/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/bdc/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/bmc/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/dp/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/emc/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/marked-content-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/marked-content/mp/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/operand-extractor/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/c/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/clip/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/clip-even-odd/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/close-fill-stroke/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/close-fill-stroke-even-odd/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/close-stroke/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/close-subpath/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/consume-pending-clip/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/end-path/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/fill/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/fill-even-odd/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/fill-stroke/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/fill-stroke-even-odd/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/h/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/l/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/m/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/path-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/re/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/stroke/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/v/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/path/y/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/shading/sh/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/apostrophe/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/bt/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/et/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/quote/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/t-star/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tc/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/td/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/td-leading/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/text-positioning-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/text-showing-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/text-state-operator-factory/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/text-state-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tf/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tj/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tj-array/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tl/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tm/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tr/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/ts/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tw/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/text/tz/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/xobject/do/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/operators/xobject/xobject-operators/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/content-stream/paint-resources/index.ts 95.4% 🟢 94.7% 🟢 100.0% 🟢 95.4% 🟢
packages/core/src/content-stream/tokenizer/index.ts 92.2% 🟢 88.9% 🟢 100.0% 🟢 92.2% 🟢
packages/core/src/content-stream/tokenizer/inline-image/index.ts 91.8% 🟢 92.5% 🟢 100.0% 🟢 91.8% 🟢
packages/core/src/document/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/catalog/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/catalog/catalog-parser/index.ts 98.3% 🟢 97.0% 🟢 100.0% 🟢 98.3% 🟢
packages/core/src/document/date/index.ts 0.0% 🔴 100.0% 🟢 100.0% 🟢 0.0% 🔴
packages/core/src/document/date/pdf-date/index.ts 86.2% 🟢 81.7% 🟢 100.0% 🟢 86.2% 🟢
packages/core/src/document/encoding/index.ts 0.0% 🔴 100.0% 🟢 100.0% 🟢 0.0% 🔴
packages/core/src/document/encoding/decode-pdf-string/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/encoding/pdf-doc-encoding/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/metadata/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/metadata/document-info-parser/index.ts 98.0% 🟢 96.2% 🟢 100.0% 🟢 98.0% 🟢
packages/core/src/document/metadata/document-metadata/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/attr-resolver/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/dict-reader/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/inheritance-resolver/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/page-tree-walker/index.ts 97.5% 🟢 98.0% 🟢 100.0% 🟢 97.5% 🟢
packages/core/src/document/page-tree/resolved-page/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/page-tree/value-resolver/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/pdf-document/index.ts 93.0% 🟢 90.5% 🟢 100.0% 🟢 93.0% 🟢
packages/core/src/document/pdf-header/index.ts 96.7% 🟢 90.9% 🟢 100.0% 🟢 96.7% 🟢
packages/core/src/document/pdf-page/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/document/resources/index.ts 97.2% 🟢 95.0% 🟢 100.0% 🟢 97.2% 🟢
packages/core/src/document/resources/parameters/index.ts 95.2% 🟢 92.3% 🟢 100.0% 🟢 95.2% 🟢
packages/core/src/document/resources/pattern/index.ts 92.8% 🟢 82.5% 🟢 100.0% 🟢 92.8% 🟢
packages/core/src/document/resources/shading/index.ts 92.4% 🟢 87.8% 🟢 100.0% 🟢 92.4% 🟢
packages/core/src/document/resources/xobject/index.ts 94.0% 🟢 90.4% 🟢 100.0% 🟢 94.0% 🟢
packages/core/src/ext/math/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/ext/number/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/ext/string/index.ts 100.0% 🟢 66.7% 🟡 100.0% 🟢 100.0% 🟢
packages/core/src/ext/string-array/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/ext/uint8-array/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/lexer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/lexer/bytes/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/lexer/tokenizer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-parser/index.ts 98.8% 🟢 98.0% 🟢 100.0% 🟢 98.8% 🟢
packages/core/src/objects/object-parser/types.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-parser/buffered-tokenizer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-parser/direct-object/index.ts 96.5% 🟢 97.3% 🟢 100.0% 🟢 96.5% 🟢
packages/core/src/objects/object-parser/indirect-object/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-parser/stream-object/index.ts 88.5% 🟢 88.9% 🟢 100.0% 🟢 88.5% 🟢
packages/core/src/objects/object-parser/string-decoder/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-store/index.ts 97.4% 🟢 95.0% 🟢 100.0% 🟢 97.4% 🟢
packages/core/src/objects/object-store/types.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-store/entry-readers/inline/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-store/entry-readers/object-stream/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-stream-extractor/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-stream-extractor/types.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-stream-extractor/body/index.ts 96.9% 🟢 95.5% 🟢 100.0% 🟢 96.9% 🟢
packages/core/src/objects/object-stream-extractor/dict/index.ts 99.1% 🟢 97.1% 🟢 100.0% 🟢 99.1% 🟢
packages/core/src/objects/object-stream-extractor/flate-decompressor/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/objects/object-stream-extractor/header/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/dictionary-reader/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/crypt-filters/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/dict-reader/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/error/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/key-length/index.ts 97.1% 🟢 94.1% 🟢 100.0% 🟢 97.1% 🟢
packages/core/src/pdf/encryption/permissions/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/aes-key-material/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/aes256-parameters/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v1r2/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v1r3/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v2r3/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v4r4/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v5r5/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-algorithm/v5r6/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/encryption/standard-security-handler/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/errors/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/errors/error/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/errors/warning/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/filter/index.ts 92.3% 🟢 96.4% 🟢 100.0% 🟢 92.3% 🟢
packages/core/src/pdf/filter/flatedecode/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/filter/lzwdecode/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/text-space/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/byte-offset/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/free-object-number/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/generation-number/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/indirect-ref/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/object-number/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/pdf-type/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/pdf-types/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/resolve-ref/index.ts 92.0% 🟢 91.7% 🟢 100.0% 🟢 92.0% 🟢
packages/core/src/pdf/types/token/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/boolean/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/hex-string/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/integer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/literal-string/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/name/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/null/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/types/token/real/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/pdf/version/index.ts 95.1% 🟢 90.9% 🟢 100.0% 🟢 95.1% 🟢
packages/core/src/utils/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/brand/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/interop/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/lru-cache/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/object/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/option/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/result/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/utils/types/utility-type.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/fallback/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/fallback/fallback-scanner/index.ts 96.5% 🟢 95.1% 🟢 100.0% 🟢 96.5% 🟢
packages/core/src/xref/fallback/object-scanner/index.ts 93.4% 🟢 91.1% 🟢 100.0% 🟢 93.4% 🟢
packages/core/src/xref/merger/index.ts 96.2% 🟢 93.8% 🟢 100.0% 🟢 96.2% 🟢
packages/core/src/xref/merger/max-depth/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/startxref/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/startxref/scanner/index.ts 98.3% 🟢 98.2% 🟢 100.0% 🟢 98.3% 🟢
packages/core/src/xref/stream/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/stream/dict/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/stream/parse-xref-stream/index.ts 95.8% 🟢 89.7% 🟢 100.0% 🟢 95.8% 🟢
packages/core/src/xref/stream/parser/index.ts 86.0% 🟢 87.7% 🟢 100.0% 🟢 86.0% 🟢
packages/core/src/xref/stream/predictor/index.ts 87.1% 🟢 85.7% 🟢 100.0% 🟢 87.1% 🟢
packages/core/src/xref/stream/trailer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/table/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/table/parser/index.ts 86.4% 🟢 91.3% 🟢 100.0% 🟢 86.4% 🟢
packages/core/src/xref/trailer/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/trailer/dict-builder/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/core/src/xref/trailer/parser/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/components/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/components/PdfPage/index.tsx 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/components/PdfViewer/index.tsx 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/hooks/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢
packages/react/src/hooks/usePdfDocument/index.ts 100.0% 🟢 100.0% 🟢 100.0% 🟢 100.0% 🟢

Generated by CI workflow

DIO0550 added a commit that referenced this pull request Nov 10, 2026
github-actions Bot added a commit that referenced this pull request Nov 10, 2026
DIO0550 added a commit that referenced this pull request Nov 10, 2026

DIO0550 commented Nov 10, 2026

Copy link
Copy Markdown
Owner Author

最終コミット 6199a8c の確認が完了しました。

  • frontend CI: lint・型チェック・型テスト・カバレッジ付きテスト・ビルドがすべて成功。
  • ローカルの通常テスト 4,582件、型テスト 96件も成功。最後のコミットはHTMLの空白修正だけで、検証済みのTypeScriptコードと同一です。
  • PR解説ページを最新コミットに合わせて公開。公開CIも成功しました。
  • 公開ページの5画面、全3コミットの処理単位の差分注釈、PDF例の構文色分けと本文、文字サイズ変更を確認しました。解説は94件の行注釈・5件の技術解説を含みます。
  • 恒久ガイド docs/guides/patterns-shadings.html は静的な色分け・JavaScriptなしの文字サイズ切り替え付き。独立した読み取り専用の静的監査済みです。ガイド単体の実画面確認はChromiumの起動制限とブラウザのローカルURL制限により未実施です。

現在のmainを起点とする3コミットで、競合はありません。クローズ済みの #758 はそのまま残しています。

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟡 Changes recommended

警告メッセージ(PATTERN_NOT_FOUND)にパターン名(/Name)が含まれておらず、複数パターンを扱う場面で原因特定とデバッグが難しくなるという指摘が残っているためです。

1 open issue
What changed in this PR

@pdfmod/core の content stream 実行に向けて、現在スコープの /Resources から /Pattern・/Shading を解決し、scn/SCN の名前参照解決と sh オペレータ対応で種別・主要属性を取得できるようにする変更です。

Changes:

  • /Pattern・/Shading の定義解決(間接参照・数値配列要素の参照解決を含む)と型表現を追加
  • PaintResources を導入し、scn/SCN と sh が現在スコープの定義へ到達できるように operator registry へ統合
  • 仕様(docs/specs)とガイド(docs/guides)を追加・更新し、解決範囲と回復方針を明文化
File Description
packages/​core/​src/​pdf/​errors/​warning/​index.ts Pattern/Shading 関連の warning code を追加します。
packages/​core/​src/​index.ts PaintResources・PdfPattern・PdfShading などの公開エクスポートを追加します。
packages/​core/​src/​document/​resources/​xobject/​index.ts XObject の属性解決を ResourceParameters に委譲して共通化します。
packages/​core/​src/​document/​resources/​shading/​index.ts ShadingType(1〜7)の判別と共通属性の読み取り・保持(参照解決含む)を実装します。
packages/​core/​src/​document/​resources/​shading/​__tests__/​shading.type.test-d.ts Shading の型レベル制約(メッシュ種別は stream 必須等)を型テストで検証します。
packages/​core/​src/​document/​resources/​shading/​__tests__/​shading.error.test.ts Shading の不正属性や要件違反に対する警告・回復をテストします。
packages/​core/​src/​document/​resources/​shading/​__tests__/​shading.basic.test.ts Shading の主要属性取得や間接参照を含む基本動作をテストします。
packages/​core/​src/​document/​resources/​pattern/​index.ts PatternType(1/2) の判別と tiling/shading pattern の主要属性読み取り(Shading 解決含む)を追加します。
packages/​core/​src/​document/​resources/​pattern/​__tests__/​pattern.type.test-d.ts Pattern 種別ごとの型の絞り込みと属性差を型テストで検証します。
packages/​core/​src/​document/​resources/​pattern/​__tests__/​pattern.error.test.ts Pattern の不正/未対応/必須欠落などに対する警告・回復をテストします。
packages/​core/​src/​document/​resources/​pattern/​__tests__/​pattern.basic.test.ts Tiling/Shading pattern の主要属性と間接参照解決の基本動作をテストします。
packages/​core/​src/​document/​resources/​parameters/​index.ts リソース辞書属性と数値配列要素の参照解決を行う共通ユーティリティを追加します。
packages/​core/​src/​document/​resources/​parameters/​__tests__/​parameters.basic.test.ts ResourceParameters の座標抽出・null保持・参照解決エラー等の基本挙動をテストします。
packages/​core/​src/​content-stream/​paint-resources/​index.ts 実行前に Pattern/Shading を解決して同期オペレータへ渡す PaintResources を追加します。
packages/​core/​src/​content-stream/​paint-resources/​__tests__/​setup-paint.ts PaintResources と operator registry を組み立てる統合テスト用セットアップを追加します。
packages/​core/​src/​content-stream/​paint-resources/​__tests__/​paint-resources.integration.test.ts scn/SCN の名前解決、q/Q の保存復元、スコープ境界などの統合動作をテストします。
packages/​core/​src/​content-stream/​paint-resources/​__tests__/​paint-resources.error.test.ts 名前オペランド拒否、参照エラー伝播、配列要素参照エラー等のエラー系をテストします。
packages/​core/​src/​content-stream/​operators/​shading/​sh/​index.ts sh オペレータの追加(/Shading 名の解決と警告/エラー方針)を実装します。
packages/​core/​src/​content-stream/​operators/​shading/​sh/​__tests__/​sh.basic.test.ts sh の既定登録、警告/エラー、状態不変性などをテストします。
packages/​core/​src/​content-stream/​operators/​color/​selection/​index.ts sc/scn/SC/SCN で Pattern 名を解決し、PaintType と基底色空間等の整合性を検証します。
packages/​core/​src/​content-stream/​operators/​color/​color-operators/​index.ts 色オペレータ登録 API を拡張して PaintResources を伝搬できるようにします。
packages/​core/​src/​content-stream/​operator-registry/​index.ts createDefault に PaintResources を追加し sh を既定レジストリへ登録します。
packages/​core/​src/​content-stream/​color-space-resources/​__tests__/​setup-color-space.ts color-space 系テストでも PaintResources を準備して registry に注入するよう更新します。
packages/​core/​src/​content-stream/​color-space-resources/​__tests__/​color-space.pattern.test.ts Pattern 色空間のテストを PaintResources 前提の実装に合わせて更新します。
packages/​core/​src/​content-stream/​color-operation/​index.ts Pattern PaintType と Pattern base color space の整合性チェックを追加します。
docs/​specs/​04_resources_graphics_state.md Pattern/Shading の解決・警告方針・sh の扱いを仕様として追記します。
docs/​guides/​resources.html Pattern/Shading 解説への導線と PaintResources の利用手順を追記します。
docs/​guides/​README.md guides の目次に patterns-shadings ガイドを追加します。
docs/​guides/​patterns-shadings.html Pattern/Shading の仕組み・具体例・対応範囲を解説する新規ガイドを追加します。

Review effort: Balanced

github-actions Bot added a commit that referenced this pull request Nov 11, 2026
DIO0550 added a commit that referenced this pull request Nov 11, 2026

DIO0550 commented Nov 11, 2026

Copy link
Copy Markdown
Owner Author

レビュー指摘に対応し、7c55235 で PATTERN_NOT_FOUND の警告に指定されたパターン名を含めました。/P1 を指定した場合は Pattern resource not found: /P1 と表示されます。修正コミット

関連テスト25件が成功しました。GitHub Actionsでもlint・型チェック・型テスト・カバレッジ付きテスト・ビルドがすべて成功しました。CI結果

解説に修正箇所とテストの注釈を追加し、公開ページで表示を確認しました。PR解説

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟢 Approval recommended

Pattern/Shading の事前解決と scn/SCN・sh の名前解決追加に対して、型テスト・基本/統合/エラー系テストと回復方針を含む仕様/ガイド更新まで揃っており、未解決の指摘事項が見当たらないためです。

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@DIO0550
DIO0550 merged commit b459716 into main Nov 11, 2026
4 checks passed
@DIO0550
DIO0550 deleted the feature/677-pattern-shading-v2 branch November 11, 2026 13:57
github-actions Bot added a commit that referenced this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Phase 5] /Pattern / /Shading サブ辞書を解決して scn の名前オペランドに対応する

2 participants