Skip to content
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
2bb332f
feat(jpeg2000): add codestream parsing, tile geometry and tier-2 pack…
Oct 10, 2026
d2f7552
feat(jpeg2000): add MQ/EBCOT tier-1 decoding, dequantization and inve…
Oct 10, 2026
861c384
feat(jpeg2000): add JP2 boxes, component transforms and public Jpeg20…
Oct 10, 2026
2310c7c
fix(jpeg2000): inherit main-header POC entries in tiles
Oct 10, 2026
1687c4d
test(jpeg2000): add test-only encoder and Jpeg2000Codec tests
Oct 10, 2026
66fd82a
feat(pdf): decode /JPXDecode image XObjects and /SMask soft masks
Oct 10, 2026
4a586c3
test(pdf): add JPXDecode and SMask PDF tests
Oct 10, 2026
5fc09b7
style(codecs): use US spellings in JPEG 2000 comments; update unsuppo…
Oct 10, 2026
c93b648
docs: add JPEG 2000 codec and PDF JPX requirements, design, verificat…
Oct 10, 2026
7e5736c
docs: use US spelling in reviewmark comment
Oct 10, 2026
07ede83
test(codecs): add real-encoder JPEG 2000 fixtures and tests
Oct 10, 2026
06a7ad1
fix(jpx): fail closed on Indexed non-8-bit and palette+ColorSpace JPX…
Oct 10, 2026
da13233
Harden JPEG 2000 decoder: decoder limits, decode-wide budget, strict …
Oct 10, 2026
5c2cc2c
Document JPEG 2000 decoder limits, budget and validation; add fixture…
Oct 10, 2026
245a427
Harden PDF image decoding: JPX limits, /SMask, shared /Decode, SMaskI…
Oct 10, 2026
9816ad5
Update docs, requirements and SysML for PDF image review fixes
Oct 10, 2026
93b342c
JPEG 2000: scale Tier-1 work budget with input and split precinct/pac…
Oct 10, 2026
20998d8
JPEG 2000: require full packet coverage and in-sequence tile-parts
Oct 10, 2026
729969b
JPEG 2000: rewrite hostile-limit tests to hit specific caps; add budg…
Oct 10, 2026
7ac913b
docs: JPEG 2000 budget, coverage, lenient behaviors, requirement test…
Oct 10, 2026
69be7fd
PDF images: support 1/2/4/8/16-bit samples, apply /Decode to DCT imag…
Oct 10, 2026
8564399
docs: PDF image bit depths, /Decode, soft masks, limits interface row
Oct 10, 2026
e7c6676
JPEG 2000: raise default MaxTier1Work to 2^34, add large lossless tes…
Oct 10, 2026
f1e5fc1
PDF images: add bit-depth tests, decode in place; docs cleanups
Oct 10, 2026
50e31d0
fix(jpeg2000): raise tier-1 per-byte allowance to 2^14, document host…
Oct 10, 2026
dfba39e
Fix lint: blank lines between members and wrap long design line
Oct 10, 2026
3b91d28
Reject COD/COC/QCD/QCC/RGN in later JPEG 2000 tile-parts
Oct 10, 2026
4706ece
Require /Subtype /Image on PDF /SMask streams
Oct 10, 2026
5809743
Validate JP2 signature content, reject signed palette columns, add PO…
Oct 10, 2026
6b7598f
Correct codec capability description in verification introduction
Oct 10, 2026
92dd35d
Fix JPEG 2000 SIZ tile-count overflow bypass
Oct 10, 2026
932bfa4
fix(jpeg2000): enforce exact payload lengths in marker and box parsers
Oct 10, 2026
ad69640
Use US spelling in JPEG 2000 user guide text
Oct 10, 2026
d5b1991
fix(jpeg2000): validate style-0 quantization entry counts, pin COC/QC…
Oct 10, 2026
e07a08d
test(jpeg2000): replace wall-clock assertions with deterministic deco…
Oct 10, 2026
ff2c8a9
refactor(jpeg2000): reduce cognitive complexity and parameter counts
Oct 10, 2026
6bdcd1e
test(pdf): restore original hang-guard values in unrelated PdfDocumen…
Oct 10, 2026
39caa8e
Jpeg2000: decode tiles in place without copying tile data
Oct 10, 2026
0be4a27
Correct codec docs for decode-only loaders and six-unit enumeration
Oct 10, 2026
b8e91d4
Jpeg2000: bound jp2h probing and avoid ICC profile copy
Oct 10, 2026
e2618b2
Add superbox to spell-check dictionary
Oct 10, 2026
71262e9
Jpeg2000: require ftyp, jp2h and ihdr (matching SIZ) in JP2 files
Oct 10, 2026
f25520c
Jpeg2000: enforce marker placement and reject duplicate PPM/PPT index…
Oct 10, 2026
e669936
Jpeg2000: add validation audit tests and consolidated validation table
Oct 10, 2026
f226112
Use US spelling gray in JPEG 2000 docs and comments
Oct 10, 2026
70697bd
Correct JPX dimension-limit documentation
Oct 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,70 @@ language: en

# Project-specific technical terms and tool names
words:
- dctdecode
- Lsiz
- smaskindata
- psnr
- bitplanes
- bitstream
- Cdef
- codestreams
- coef
- Colr
- CPRL
- csiz
- dequantization
- Dmax
- Dmin
- dplanes
- EBCOT
- fplane
- INITDEC
- INITENC
- Ippm
- Irrev
- isot
- Lblock
- LRCP
- lsot
- luts
- Mallat
- mant
- Memberwise
- NLPS
- NMPS
- Nppm
- Osiz
- Pclr
- Pcoc
- PCRL
- Prec
- Psot
- TNsot
- TPsot
- pterm
- Renorm
- RLCP
- RPCL
- rsiz
- scoc
- scod
- segsym
- signedness
- smask
- ssiz
- subband
- Sycc
- Termall
- Tsiz
- vcausal
- vsum
- xmap
- xmaps
- Xsiz
- ymaps
- ysiz
- Zppm
- Aabb
- functiontype
- Poppler
Expand Down Expand Up @@ -235,6 +299,10 @@ words:
- Argb
- cmap
- Cmap
- Lsop
- ftyp
- bpcc
- superbox
- codepoint
- Dzik
- glyf
Expand Down
29 changes: 29 additions & 0 deletions .reviewmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,31 @@ reviews:
- "test/DemaConsulting.CanvasNet.Tests/Codecs/GifCodecTests.cs" # unit tests
- "test/DemaConsulting.CanvasNet.Tests/Codecs/GifFixtureTests.cs" # fixture conformance tests

# CanvasNet-Codecs-Jpeg2000Codec Review (one per unit)
- id: CanvasNet-Codecs-Jpeg2000Codec
title: Review that CanvasNet Codecs Jpeg2000Codec Implementation is Correct
context:
- "docs/design/canvas-net.md"
- "docs/reqstream/canvas-net.yaml"
- "docs/design/canvas-net/codecs.md"
- "docs/reqstream/canvas-net/codecs.yaml"
paths:
- "docs/reqstream/canvas-net/codecs/jpeg2000-codec.yaml" # unit requirements
- "docs/design/canvas-net/codecs/jpeg2000-codec.md" # unit design
- "docs/verification/canvas-net/codecs/jpeg2000-codec.md" # unit verification
- "src/DemaConsulting.CanvasNet/Codecs/Jpeg2000Codec.cs" # unit source (public API entry point)
- "src/DemaConsulting.CanvasNet/Codecs/Jpeg2000Image.cs" # unit source (public decoded-image result type)
- "src/DemaConsulting.CanvasNet/Codecs/Jpeg2000ColorSpace.cs" # unit source (public color-space enum)
- "src/DemaConsulting.CanvasNet/Codecs/Jpeg2000DecoderLimits.cs" # unit source (public decoder resource limits)
- "src/DemaConsulting.CanvasNet/Codecs/Jpeg2000/**/*.cs" # unit source (partial-class implementation files)
- "src/DemaConsulting.CanvasNet/Codecs/ImageInfo.cs" # shared header-only probe result type
- "src/DemaConsulting.CanvasNet/Codecs/NamespaceDoc.cs" # Codecs namespace documentation
- "test/DemaConsulting.CanvasNet.Tests/Codecs/Jpeg2000CodecTests.cs" # unit tests
- "test/DemaConsulting.CanvasNet.Tests/Codecs/Jpeg2000ValidationTests.cs" # fail-closed validation tests
- "test/DemaConsulting.CanvasNet.Tests/Codecs/Jpeg2000TestEncoder*.cs" # test-only JPEG 2000 encoder
- "test/DemaConsulting.CanvasNet.Tests/Codecs/Jpeg2000FixtureTests.cs" # real-encoder fixture tests
- "test/DemaConsulting.CanvasNet.Tests/Jpeg2000Fixtures/**" # real-encoder fixture corpus + README

# CanvasNet-Geometry Review (one per subsystem)
- id: CanvasNet-Geometry
title: Review that CanvasNet Geometry Subsystem Implementation is Correct
Expand Down Expand Up @@ -770,6 +795,10 @@ reviews:
- "src/DemaConsulting.CanvasNet.Pdf/NamespaceDoc.cs" # Pdf namespace documentation
- "test/DemaConsulting.CanvasNet.Pdf.Tests/PdfDocumentTests.cs" # unit tests
- "test/DemaConsulting.CanvasNet.Pdf.Tests/PdfDocumentMeshShadingTests.cs" # mesh shading unit tests
- "test/DemaConsulting.CanvasNet.Pdf.Tests/PdfDocumentJpxTests.cs" # JPXDecode/SMask unit tests
- "test/DemaConsulting.CanvasNet.Tests/Jpeg2000Fixtures/gray.jp2" # gray JPX fixture
- "test/DemaConsulting.CanvasNet.Tests/Jpeg2000Fixtures/source_gray.png" # source pixels of gray.jp2
- "test/DemaConsulting.CanvasNet.Tests/JpegFixtures/grayscale_baseline.jpg" # gray DCT fixture
- "test/DemaConsulting.CanvasNet.Pdf.Tests/PdfSystemIntegrationTests.cs" # integration tests
- "test/DemaConsulting.CanvasNet.Pdf.Tests/PdfFixtureTests.cs" # fixture conformance tests

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ image operations using `Span<T>`, and supports independent-copy cropping for loa
- 🖨️ **TIFF Codec** - Load/save 8-bit RGB/RGBA/Grayscale TIFF files
- 🗜️ **JPEG Codec** - Load baseline/progressive; save baseline JPEG
- 🎞️ **GIF Codec** - Decode-only load of first GIF frame; `GetInfo` reports the true frame count
- 🖼️ **JPEG 2000 Codec** - Decode-only load of JP2 files and raw codestreams (Decode also exposes color space and alpha)
- 📐 **SVG Codec** - Rasterize a common SVG subset to a surface (`DemaConsulting.CanvasNet.Svg`)
- 📄 **PDF Document** - Open, inspect, and rasterize PDF pages with font substitution (`DemaConsulting.CanvasNet.Pdf`)
- 📊 **Chart Rendering** - Build and paint Bar/Column/Line/Area/Pie/Doughnut charts (`DemaConsulting.CanvasNet.Charts`)
Expand Down Expand Up @@ -88,7 +89,7 @@ PngCodec.Save(surface, "surface.png");
using var reloaded = PngCodec.Load("surface.png");
```

Open a PDF and render a page (BMP/TIFF/JPEG/GIF/SVG codecs, header-only probing, and
Open a PDF and render a page (BMP/TIFF/JPEG/GIF/JPEG 2000/SVG codecs, header-only probing, and
feature-detection all follow the same pattern):

```csharp
Expand Down
22 changes: 14 additions & 8 deletions docs/design/canvas-net-pdf.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ size — but every filled/stroked path painted in solid opaque black, since no c
implemented yet. Phase 3 added real device color (`g`/`G`/`rg`/`RG`/`k`/`K`/`cs`/
`CS`/`sc`/`SC`/`scn`/`SCN`), a generalized `/Filter`/`/DecodeParms` stream-decoding pipeline
(`FlateDecode` plus PNG/TIFF predictor reversal), and image XObjects (`Do`: `DCTDecode` via the
`CanvasNet` system's `Codecs.JpegCodec`, or raw `DeviceGray`/`DeviceRGB`/`DeviceCMYK` 8-bit
samples, composited through the current transformation matrix). Phase 4 added real text/font
rendering: `BT`/`ET`/`Tc`/`Tw`/`Tz`/`TL`/`Tf`/`Tr`/`Ts`/`Td`/`TD`/`Tm`/`T*`/`Tj`/`'`/`"`/
`CanvasNet` system's `Codecs.JpegCodec`, `JPXDecode` via `Codecs.Jpeg2000Codec`, or raw
`DeviceGray`/`DeviceRGB`/`DeviceCMYK`/`Indexed` samples of 1/2/4/8/16 bits, composited through the
current transformation matrix).
Phase 4 added real text/font rendering: `BT`/`ET`/`Tc`/`Tw`/`Tz`/`TL`/`Tf`/`Tr`/`Ts`/`Td`/`TD`/`Tm`/`T*`/`Tj`/`'`/`"`/
`TJ` resolve a simple `/Subtype /TrueType` font from the current page's `/Resources/Font`
dictionary (requiring an embedded `/FontDescriptor/FontFile2`, loaded via the `CanvasNet`
system's `Fonts.TrueTypeFont`), map each shown byte through its `/WinAnsiEncoding`/
Expand Down Expand Up @@ -106,9 +107,9 @@ Form XObject's `/BBox` is never used to clip its content and its `/Group` (trans
entry is never consulted, though the Form itself renders; `/ShadingType` values outside `2`-`7`
and `/FunctionType 4` (PostScript calculator) functions fail closed; the `sh` operator and general
path clipping (`W`/`W*`) are supported; no
`/SMask`/alpha compositing or transparency groups (every decoded image is treated as fully
opaque); no `JPXDecode` filter decoding (fails closed; `CCITTFaxDecode` - Group 4 (T.6 MMR) only -
is supported); `/Separation`/`/DeviceN`/`/CalGray`/`/Lab` color spaces remain unsupported and fail
`/Mask`/`/Matte` image masks or transparency groups (an explicit `/SMask` and JPEG 2000
alpha are applied); `CCITTFaxDecode` - Group 4 (T.6 MMR) only - is supported and `JPXDecode`
is decoded; `/Separation`/`/DeviceN`/`/CalGray`/`/Lab` color spaces remain unsupported and fail
closed; and an encrypted document using any security handler, crypt-filter method, `/V`/`/R`
combination other than the ones listed above, or whose correct password is not supplied, fails
closed rather than being decrypted. These remain out of scope and are planned for later phases
Expand Down Expand Up @@ -335,8 +336,13 @@ crypt filter), `pdf-encrypted-r-{revision}`,
non-empty one is genuinely required), `pdf-encrypted-incorrect-password`,
`pdf-encrypted-password-non-ascii` (an R2-R4 password outside ASCII 0-127),
`pdf-colorspace-{name}` (`Separation`/`DeviceN`/`CalGray`/`Lab`), `pdf-colorspace-Pattern`,
`pdf-colorspace-ICCBased`, `pdf-filter-{name}` (`JPXDecode` and any other unrecognized filter),
`pdf-tiff-predictor-bitdepth-{n}`, `pdf-image-bitdepth-{n}`, `pdf-pattern-not-declared`,
`pdf-colorspace-ICCBased`, `pdf-filter-{name}` (any unrecognized filter),
`pdf-tiff-predictor-bitdepth-{n}`, `pdf-image-bitdepth-{n}` (a depth other than 1/2/4/8/16, or a 16-bit `/Indexed` image),
`pdf-jpx-colorspace` (a JPX image of a channel count with no device color space without `/ColorSpace`),
`pdf-jpx-palette-colorspace` (a `/ColorSpace` override on JP2 data with its own palette),
`pdf-jpx-indexed-bit-depth` (an `/Indexed` space over non-8-bit JPX samples),
`pdf-jpx-smaskindata-indexed` (`/SMaskInData 2` over an `/Indexed` space),
`pdf-pattern-not-declared`,
`pdf-pattern-type-{n}`, `pdf-pattern-tile-too-large`, `pdf-shading-type-{n}`,
`pdf-shading-colorspace-{family}`, `pdf-functiontype-{n}`, `pdf-function-multiinput`,
`pdf-function-bitspersample-{n}`, `pdf-font-subtype-{subtype}` (`MMType1` only),
Expand Down
Loading
Loading