-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IBA): IBA::normalize() - Normalize 3D vectors (i.e., divide by t…
…heir length) textures. (#3945) Normalize 3D vectors (i.e., divide by their length) textures. inCenter and outCenter define 0.0 coordinate in input and output 3D vectors encodings (e.g. 0.0f for [-1,1] or 0.5f for [0,1] encoding). scale defines the scale factor to apply to the normalized vectors (i.e. 1.0f for a full range normalization, 0.5f for 0.0-1.0 range encoding). Default values are for [-1,1] encoding and full range normalization. Functions required 3 or 4 channels. If destination have no alpha channel, but source have, alpha channel will be dropped. ## Tests ``` int main(int argc, const char* argv[]) { ImageBuf input(argv[1]); ImageBuf output; bool ok = ImageBufAlgo::normalize(output, input, 0.0f, 0.0f, 1.0f); if (ok) { ok = output.write(argv[2]); } else { std::cerr << "Could not normalize image: " << argv[1] << std::endl; return -1; } return 0; } ``` --------- Signed-off-by: ssh4net <libalias@gmail.com> Signed-off-by: Anton Dukhovnikov <antond@wetafx.co.nz> Signed-off-by: Vlad Erium <libalias@gmail.com> Signed-off-by: Larry Gritz <lg@larrygritz.com> Co-authored-by: Anton Dukhovnikov <131838425+antond-weta@users.noreply.github.com> Co-authored-by: Larry Gritz <lg@larrygritz.com>
- Loading branch information
1 parent
a5c7a0c
commit b445bc6
Showing
19 changed files
with
216 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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