Expose is_top_down function in BMP Decoder#2760
Conversation
|
Thinking about an alternative, I think that probably it is a better option to return as a second parameter of rows_read function instead of a new dedicated method as knowing orientation from the consumer side only makes sense while having partially decoded rows; once fully decoded, orientation does not matter for the consumer of BMPDecoder as it manages internally the row inversion (the only case where it would be required is that one in which you want to encode exact same file content you decoded, but I don't think it is a valued use case and would require exposing all other header attributes). |
|
I updated to return the tuple in rows_decoded and removed the public function which could cause confusion when used on a fully decoded image. |
197g
left a comment
There was a problem hiding this comment.
Let me know what you think about the design direction.
During the codereview integrating streamed/resumabled BMP decoding in Skia that will be used from Chromium, we found a gap when copying partially decoded rows:
https://skia-review.googlesource.com/c/skia/+/1138796
The issue is that, despite BMP decoder is always doing conversion to always provide the same row ordering independently of the type of file, when we have partially decoded rows and only first n rows are available, it is required to know if the image is top down or not to know if the rows to copy are the first n rows or the last n rows.
This is a gap identified for completing #2696