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

api: Adjust IBA::perpixel_op function signature #4409

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

lgritz
Copy link
Collaborator

@lgritz lgritz commented Sep 6, 2024

When I added perpixel_op recently, I didn't get the function signature right. It only would work for plain old function pointers, and would not work properly for "functors" or lambdas with capture. I should have used function_view which can do a light-weight wrapper of all three, so now I do. Also modified imagebufalgo_test to explicitly test all three forms to be sure they work.

Also update function_view ever so slightly.

@lgritz
Copy link
Collaborator Author

lgritz commented Sep 6, 2024

@ssh4net

When I added perpixel_op recently, I didn't get the function signature
right. It only would work for plain old function pointers, and would
not work properly for "functors" or lambdas with capture. I should
have used function_view which can do a light-weight wrapper of all
three, so now I do. Also modified imagebufalgo_test to explicitly test
all three forms to be sure they work.

Also update function_view ever so slightly.

Signed-off-by: Larry Gritz <[email protected]>
@ssh4net
Copy link
Contributor

ssh4net commented Sep 9, 2024

@lgritz just checked both variants with:

  • with lambda with a capture list
  • struct

both are works!

@lgritz lgritz merged commit 37a814f into AcademySoftwareFoundation:master Sep 14, 2024
25 of 26 checks passed
@lgritz lgritz deleted the lg-perpixel branch September 14, 2024 17:38
zachlewis pushed a commit to zachlewis/OpenImageIO that referenced this pull request Sep 16, 2024
…ation#4409)

When I added perpixel_op recently, I didn't get the function signature
right. It only would work for plain old function pointers, and would not
work properly for "functors" or lambdas with capture. I should have used
function_view which can do a light-weight wrapper of all three, so now I
do. Also modified imagebufalgo_test to explicitly test all three forms
to be sure they work.

Also update function_view ever so slightly.

---------

Signed-off-by: Larry Gritz <[email protected]>
Signed-off-by: Zach Lewis <[email protected]>
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.

2 participants