Add L32F and La32F to ExtendedColorType#2793
Merged
Merged
Conversation
fintelia
approved these changes
Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #1940
This PR adds variants to
ExtendedColorTypefor representing single-channel and dual-channel float32 colors:L32FandLa32Frespectively. These color types are not uncommon and should at least be representable inimage. Adding them toColorTypewould be nice too, but likely much more complex due to the symmetry withDynamicImage. I added themExtendedColorTypebecause this type seems more open to change and enables additional functionality (such as saving images).This addition also closes some gaps in existing APIs. Since
ExtendedColorTypecan now represent the pixel typesLuma<f32>andLumaA<f32>, thePixelWithColorTypetrait can be implemented for all color x primitive combinations. Because of this,ImageBuffer<Luma<f32>, _>andImageBuffer<LumaA<f32>, _>can now use thesave*andwrite*methods.Of course, no encoder currently supports L32F or La32F, but this can easily be added in follow-up PRs. In particular, supporting L32F in TIFF and HDR should be relatively easy. And of course, I want to support L32F for DDS too.