Expose encoder_for_format() publicly#2554
Conversation
|
What about a strong opaque type around |
|
My initial reaction was that we might want to have an encoding analog of As far as return type, is it possible to make the method return And if we're not tracking it anywhere, we should make a note to have |
|
I'm not completely certain we want the trait to be dyn-compatible. The main purpose is to facilitate writing bindings correctly for which the consumption is required. The use of those encoders requires them to be boxed but to me that is separate from the purpose of facilitating bindings. It's not completely unreasonable to leave it dyn-incompatible as long as we have an internal conversion. Afterall, |
In wondermagick I want to be able to call
set_icc_profileandset_exif_metadataon an encoder without amatchthat enumerates every single format. That requires a public API to go from aformatto animpl Encoder. This PR adds such an API.TODO: trait ImageEncoderBoxed isn't public, so this is not shippable as-is. Any ideas on how best to handle that?