javacv icon indicating copy to clipboard operation
javacv copied to clipboard

Rework LeptonicaFrameConverter#convert(Frame)

Open msmuenchen opened this issue 6 months ago • 1 comments

This PR reworks LeptonicaFrameConverter#convert(Frame) to be able to convert b/w and RGB Frame instances to Leptonica PIX, no matter their stride size. Original bug reported in #1115.

It ships with a rough unit test against a few example images that were manually verified to be known-good.

Notes:

  • Unfortunately I had to drop big-endian support entirely as I lack a machine to test that.
  • I didn't touch the reverse function at all, maybe I'll do it when I have a bit of spare time but no promises.
  • I removed BytePointer frameData, pixData; ByteBuffer frameBuffer, pixBuffer; out of the equation entirely. I assume these were originally used for the byte-order conversion but as that's gone there is no reason to keep the image data around in any buffers where it might leak.

msmuenchen avatar Jan 27 '24 14:01 msmuenchen

Add new tests under platform/src/test, not src/test

saudet avatar Jan 27 '24 23:01 saudet