Skip to content

WIC image I/O dynamic codecs#2376

Merged
andrewfb merged 2 commits intocinder:masterfrom
andrewfb:WicImageIoUpdates2
Oct 20, 2025
Merged

WIC image I/O dynamic codecs#2376
andrewfb merged 2 commits intocinder:masterfrom
andrewfb:WicImageIoUpdates2

Conversation

@andrewfb
Copy link
Collaborator

This update changes the way we interact with WIC on Windows for image reading and writing. Rather than the hard-coded set of supported codecs we've had in the past, we now dynamically query what codecs are available on the machine. Under both Windows 10 and Windows 11, this adds a number of new formats without any changes to your app code.

As compared to previous versions, on Windows 11 this PR adds the following source formats:

- webp - Google's WebP format
- heic, heif, hif, avci, heics, heifs, avcs, avif, avifs - HEIF/HEVC/AV1 image formats
- JXL - JPEG XL
- cur - Windows cursor files
- icon - Additional icon extension
- jfif, exif - JPEG variants
- rle - RLE-compressed bitmaps
- dng - Adobe Digital Negative
- Raw camera formats (34 formats!): 3FR, ARI, ARW, BAY, CAP, CR2, CR3, CRW, DCS, DCR, DRF, EIP, ERF, FFF, IIQ, K25, KDC, MEF, MOS, MRW, NEF, NRW, ORF, ORI, PEF, PTX, PXN, RAF, RAW, RW2, RWL, SR2, SRF, SRW, X3F

and adds the following output formats:

- heic, heif, hif - HEIF encoding support
- JXL - JPEG XL encoding
- gif - GIF encoding (was commented out in old code)
- dds - DirectDraw Surface
- dib, rle - BMP variants
- jfif, exif - JPEG variants
- jxr, wdp - Both extensions for JPEG XR/HD Photo

This PR also handles correct handling for a number of new image formats,

The row bytes calculation was incorrectly using sizeof(float) instead of
sizeof(uint8_t) for UINT8 data types, causing incorrect buffer sizes.
…ation

- Replace raw COM pointers with msw::ComPtr for automatic lifetime management
- Use releaseAndGetAddressOf() for COM output parameters
- Remove overly restrictive static_assert from ComPtr that prevented compilation with forward-declared types
- Implement dynamic WIC decoder/encoder enumeration to automatically register supported extensions
- WIC now queries installed codecs at registration time instead of using hardcoded extension list
@andrewfb andrewfb merged commit dc77ee8 into cinder:master Oct 20, 2025
8 checks passed
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.

1 participant