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

cli update: read input filenames from stdin #63

Merged
merged 9 commits into from
Jun 6, 2022
Merged

cli update: read input filenames from stdin #63

merged 9 commits into from
Jun 6, 2022

Conversation

sz3
Copy link
Owner

@sz3 sz3 commented Jun 6, 2022

This should enable piping inputs from other processes, for example when decoding. It's not perfect -- there's not a good way to tell when cimbar is finished with an input (though it shouldn't take long) -- but it's a start.

Also:

  • fountain mode (-f) is now the default. This includes zstd compression as well, and matches what cimbar.org and CFC do.
  • when decoding, the cimbar binary will now log completed file paths to stdout after they're written
  • I added a simple python(3) test for the cimbar binary. These API tests may be extended to testing an so/dll once a stable interface exists.

sz3 added 9 commits May 27, 2022 19:02
... output files to cwd if no output path is provided.
Not sure about dragging gcc7 along like this, but I'm already doing it
for the unit tests.

Will have to pull the plug sooner or later (maybe sooner)
Also, have the StdinLineReader know how to deal with a closed stream.
@sz3 sz3 merged commit c8529e3 into master Jun 6, 2022
@sz3 sz3 deleted the stdin branch June 6, 2022 02:16
("color-correct", "Toggle decoding color correction. 1 == on. 0 == off.", cxxopts::value<int>()->default_value("1"))
("encode", "Run the encoder!", cxxopts::value<bool>())
("no-deskew", "Skip the deskew step -- treat input image as already extracted.", cxxopts::value<bool>())
("no-fountain", "Disable fountain encode/decode. Will also disable compression.", cxxopts::value<bool>())
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fountain is now the default. The option to disable it is --no-fountain, in line with --no-deskew above.


// else -- default case, all bells and whistles
fountain_decoder_sink<cimbar::zstd_decompressor<std::ofstream>> sink(outpath, chunkSize);
// else, the good stuff
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The if clauses below are in a different order, but the logic is identical.

sz3 added a commit that referenced this pull request Mar 13, 2024
f219e87 Merge pull request #75 from sz3/web-fix
20f1601 The GL window height, or width, or both, needs to be divisible by 4?
98368d7 Pass dummy values to configure() to use config defaults
1b09a77 Use Config settings for cimbar_js defaults
b392e57 Pin the emscripten/emsdk docker image
d9bd2a2 Merge pull request #73 from sz3/bugfix-improve-and-5x5
709a348 Add back a few test cases, add some comments, and check in the 5x5 tileset
b9d9d03 Simplify calculate_cooldown() + a comment for FloodDecodePositions::update()
55fcadb gh workflow updates
6baf0c4 Odd emscripten workaround -- not sure if this is the "right way", but it works
9f11473 Fix wasm packaging script
04528bb Add the 5x5 tileset to bitmaps.h + missing include
dce6833 Fix off-by-one type bug!
d452652 Update regression tests
8c891d0 Put back the Config.cpp for broader compiler support...
55956de Update more tests?
9204892 Misc fix
4d2943c Experimenting with ways to improve the flood decode
6daa947 3,-5 for adaptiveThreshhold on symbols seems better?
18e5480 Put back the skip param for mean_rgb on larger cell sizes
1ec077b Running afoul of constexpr rules
4e33841 Put us back on 8x8
ec74f7c For now, put the uint128s back
02d4573 Have ahash_result take a template param for cell size
e2b55fc + do all bitextract index magic in "pattern()" function
24a291a Add some compile-time magic to auto-generate the bit extract pattern
173087c Move grid params into their own file?
cad107c Minor tweaks to make it easier to switch between grid sizes
f932602 Special case for running the "ALL" check (9-way compare) on seed locations
92a33ef More warnings \o/
3479d39 Better(?) threshold params, and a thought
99e0f51 Drift cooldown?
f3cdabe More const, and add more seed positions for the decode?
6849234 These should all be const...
f9a9dd8 Scale window size off the size of the image.
3616c36 Pass image_size/anchor_size to extractor...
7766cfd Attempt to use 988x988 grid...?
c4f8750 A 5x5 that works with both 4 bit and 5 bit
c34ae88 Calculate total_cells() and frame capacity, and ...
cdd2f5c Update ahash_result for 5-bit reads + lots of test fixes for average_hash
ec62980 Changes to average_hash...
e2cab43 Small changes to average_hash(), decode_color()
731dfb1 Update the bitextractor to deal with reads other than len=8
1fd265d Minimal changes for encoding with a grid of 5x5s
b0aae78 Merge pull request #68 from sz3/packaging-cimbar-html
6ca0650 Post cimbar_js.html as part of package build.
0906f68 Script to bundle cimbar_js's asm.js build into a single html file
c8529e3 Merge pull request #63 from sz3/stdin
d17dcf3 -f is now the default
21f9932 A bit silly, but: py3.6 compatibility for now
2ff867d Test cli?
d646ec7 Have fountain_decoder_sink optionally print its work...
892579a Have the encoder be stdin-aware too
21cc6a7 🤔
aad249d Read filenames from stdin iff no inputs are provided, + ...
074d813 Make fountain encoding the default. Add StdinLineReader for decodes.
89762c1 An idea

git-subtree-dir: app/src/cpp/libcimbar
git-subtree-split: f219e87
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

Successfully merging this pull request may close these issues.

1 participant