Open
Conversation
Member
|
Looks good to me, in order to make this easier to implement in the future, we could assign each filter an ID string instead of an int. Then we could send those to the frontend (by querying the filter vector), the frontend sends the selected ID back and the filter selection is stored by ID instead of index. This way, we should not need to have a separate enum. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a preparation to work on templates + filters (see also: #40).
I have implemented a simple grayscale filter which should assist debugging problems that arise when combining templates with filters because the basic filter does some adjustments, but imo they are not clearly visible/ distinguishable from not having applied a filter.
Also fixed usage output in src/main_filter.cpp (because you cannot define the output directory, it's hard-coded) and added some other debug outputs. Nice to have this tiny little tool to test filtering!
This may not add large benefit to self-o-mat, but I think it may assist debugging. And at least some people may want to use grayscale images... 😄
Biggest benefit is to "demo" what parts of the code need to be changed (which was not 100% intuitive). We may add this to the wiki:
src/main_filter.cpp: add include for the new header file, add an instance to the vecotr by adding a call tofilters.push_back(); build the tool and test your filter 😉FILTER, and filter name to vectorfilterNames; add instance of the new filter as member variable (comparebasicFilter+grayscaleFilter)FILTERenum value and add a call to methodprocessImage(image, gain)of the member instance thereadd_executable()sections of CMakeLists.txtFILTERenum value inside ofBoothLogic::getFilter(); otherwise new filter will be presented on the web UI for selection but the actual runtime choice will fall back toNO_FILTER; this was a small, unexpected pitfall for meHappy to get feedback on this, but no rush.
Cheers