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

Separate parsing from the parse results #1

Open
chafey opened this issue Nov 7, 2022 · 2 comments
Open

Separate parsing from the parse results #1

chafey opened this issue Nov 7, 2022 · 2 comments

Comments

@chafey
Copy link
Collaborator

chafey commented Nov 7, 2022

Currently the parse results (e.g. codestream.segments, codestream.tiles) is tightly coupled to the parsing logic (codestream.decode()) logic. These should be separated for a few reasons:

  1. the parsing code can be re-used without having to do decoding. A few examples come to mind - a simple codestream dump utility, code that needs to implement sub resolution fetching, JPIP server
  2. The decoding logic can be re-used independently of the HTJ2K code stream itself. A few examples come to mind - JPIP client, resumable decoder (e.g. progressive decoding client side)

Some initial thoughts on how to proceed:

  1. Pass a callback class to the parser which gets called as the parser works. This is like a SAX based parser. The callback should be able to cancel or pause parsing
  2. A callback can be used to create a codestream object from the results of the parser
@chafey
Copy link
Collaborator Author

chafey commented Nov 7, 2022

Discussed with pantelis, and we want to break up Codestream into three separate classes:

  1. Data structure that holds the data in a codestream (with no parsing logic)
  2. A parser that invokes a callback with the data it parses
  3. A parser callback that populates 1 with the results of 2

@chafey
Copy link
Collaborator Author

chafey commented Nov 7, 2022

Requirement: The callback should be able to pause the parsing. While paused, new datg

@chafey chafey closed this as completed Nov 7, 2022
@chafey chafey reopened this Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant