On Tue, 22 Oct 2024 15:13:05 GMT, Andy Goryachev <ango...@openjdk.org> wrote:
>> `scanlineStride` is useful for all the `ImageFrame` constructors, or do you >> think recomputing it (with the risk of it being different) is still the best >> course of action given that AWT supplies it and might be using some other >> alignment/padding? > >> `var` helps the writer of the code, but almost never helps the reader of the >> code > > I fully agree with John on this. > `scanlineStride` is useful for all the `ImageFrame` constructors, or do you > think recomputing it (with the risk of it being different) is still the best > course of action given that AWT supplies it and might be using some other > alignment/padding? I've changed it to always take the scanline stride from AWT and never recompute. Note that AWT measures the stride in "data elements", not in bytes. I've marked the points in the source code where the meaning of stride changes from "data elements" to "bytes". ------------- PR Review Comment: https://git.openjdk.org/jfx/pull/1593#discussion_r1810996961