Imaging: implement ManagedImage and codec abstraction #38

Closed
opened 2026-08-08 08:17:24 +00:00 by hugo · 1 comment
Owner

Objective

Implement the owned image representation, channel/layout operations, validation, and object-safe codec boundary.

Deliverables

  • Cover dimensions, channel flags, strides, allocation checks, interleave/deinterleave, alpha/bump/color access, resize/copy operations, and ownership semantics.
  • Return typed errors for invalid sizes/layouts and enforce decode limits.
  • Keep codec/native library types out of the public abstraction.

Validation

  • All ManagedImage and codec-interface tests pass.
  • Overflow and malformed-dimension tests allocate nothing excessive.
  • Public docs define pixel/channel layout.

Prerequisite

Types and StructuredData are implemented and the global API/test gates are complete.

Project constraints

  • Native Rust implementation only; optional third-party native codecs stay behind documented features.
  • Keep mapped signatures fixed and preserve translated geometry/pixel assertions exactly.
  • Enforce checked sizes and indices, then update docs and coverage status.
## Objective Implement the owned image representation, channel/layout operations, validation, and object-safe codec boundary. ## Deliverables - Cover dimensions, channel flags, strides, allocation checks, interleave/deinterleave, alpha/bump/color access, resize/copy operations, and ownership semantics. - Return typed errors for invalid sizes/layouts and enforce decode limits. - Keep codec/native library types out of the public abstraction. ## Validation - All ManagedImage and codec-interface tests pass. - Overflow and malformed-dimension tests allocate nothing excessive. - Public docs define pixel/channel layout. ## Prerequisite Types and StructuredData are implemented and the global API/test gates are complete. ## Project constraints - Native Rust implementation only; optional third-party native codecs stay behind documented features. - Keep mapped signatures fixed and preserve translated geometry/pixel assertions exactly. - Enforce checked sizes and indices, then update docs and coverage status.
hugo added this to the 06 - Imaging and PrimMesher implementation milestone 2026-08-08 08:17:24 +00:00
hugo added the enhancement label 2026-08-08 08:17:24 +00:00
Author
Owner

Implemented and verified in commit 2c806d8. Replaced all Imaging.Abstractions shims with native Rust: an object-safe ITextureCodec boundary, flag-compatible channel type, and owned ManagedImage with checked dimensions and allocation limits, documented planar layout and stride, exact C# channel conversion, clear/deep-copy ownership, nearest and bilinear resizing, bottom-left RGBA export, and stride-aware canonical interleave/deinterleave helpers. Public buffer corruption and oversized dimensions return typed errors without partial mutation. The generated audit now reports 3/3 native types and 20/20 native members with no Imaging.Abstractions shim. Verification: 7/7 native imaging tests pass; all 3/3 pre-created ManagedImage C# parity tests pass; controlled suite is exactly 193 passed and 1200 expected standardized failures; mapping, API generation/coverage, parity/surface, fmt, workspace check, locked API fixture, no-run, clippy -D warnings, and docs all pass. A post-implementation review checked the code against every issue deliverable and the pinned C# source.

Implemented and verified in commit 2c806d8. Replaced all Imaging.Abstractions shims with native Rust: an object-safe ITextureCodec boundary, flag-compatible channel type, and owned ManagedImage with checked dimensions and allocation limits, documented planar layout and stride, exact C# channel conversion, clear/deep-copy ownership, nearest and bilinear resizing, bottom-left RGBA export, and stride-aware canonical interleave/deinterleave helpers. Public buffer corruption and oversized dimensions return typed errors without partial mutation. The generated audit now reports 3/3 native types and 20/20 native members with no Imaging.Abstractions shim. Verification: 7/7 native imaging tests pass; all 3/3 pre-created ManagedImage C# parity tests pass; controlled suite is exactly 193 passed and 1200 expected standardized failures; mapping, API generation/coverage, parity/surface, fmt, workspace check, locked API fixture, no-run, clippy -D warnings, and docs all pass. A post-implementation review checked the code against every issue deliverable and the pinned C# source.
hugo closed this issue 2026-08-09 02:11:27 +00:00
Sign in to join this conversation.