Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework LeptonicaFrameConverter#convert(Frame) #2178

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

msmuenchen
Copy link
Contributor

@msmuenchen msmuenchen commented Jan 27, 2024

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.

@saudet
Copy link
Member

saudet commented Jan 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants