Replies: 2 comments 1 reply
-
While it makes sense yo have in place decoding, it complicates everything else. So let's say we want to transform RGBA to RGB565 via a function
And other things you meet when you start implementing. If you need RGB565, you can always use https://crates.io/crates/mozjpeg which supports outputting to RGB565, I probably will not support that or end up accepting a PR even if someone does the work(it adds maintenance burden to an already largely scoped project) |
Beta Was this translation helpful? Give feedback.
-
I was poking around the code more and saw What do you think if This does complicate things slightly, but overall is relatively small and well scoped change. |
Beta Was this translation helpful? Give feedback.
-
When decoding a JPG image,
decode()
gives me aVec<u8>
of components, where each component (R, G, B, A) is a byte. I then transform this vector into whatever pixel format I'm sending to a pixel buffer, for example RGB565. This increases memory usage in that each image I'm decoding, I need a byte per component per pixel for decoding and a 2 bytes (in the case of RGB565) per pixel for the end result.We can save the byte per component per pixel during decoding if we can directly translate to the end pixel format inside of
decode()
.Maybe a closure added to
DecoderOptions
for the most flexibility in terms of translations?Beta Was this translation helpful? Give feedback.
All reactions