-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fixed several accuracy bugs with image resampling #30184
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
base: main
Are you sure you want to change the base?
Changes from all commits
23656e8
a0902fe
717a221
1de3e2e
90bd95f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,7 @@ namespace agg | |
} | ||
} | ||
|
||
#ifndef MPL_FIX_IMAGE_FILTER_LUT_BUGS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The following code block is removed because it not only has the same bugs as the code in |
||
unsigned pivot = m_diameter << (image_subpixel_shift - 1); | ||
|
||
for(i = 0; i < pivot; i++) | ||
|
@@ -96,6 +97,7 @@ namespace agg | |
} | ||
unsigned end = (diameter() << image_subpixel_shift) - 1; | ||
m_weight_array[0] = m_weight_array[end]; | ||
#endif | ||
} | ||
|
||
|
||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is one of the bugs.
0
andend
are different distances frompivot
, so the corresponding weights typically should not be the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the new version under a macro guard, as was done in #28122, so that we keep a track of what's the original Agg and what we changed on top of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, done
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out that I can't add a preprocessor definition in
_image_resample.h
a la #28122. There is buggy code inagg_image_filters.cpp
that needs to be skipped, but since it is a CPP file rather than a H file, it gets compiled separately with no awareness of_image_resample.h
. I have put the preprocessor definition (MPL_FIX_IMAGE_FILTER_LUT_BUGS
) here at the top ofagg_image_filters.h
, which is lower level than would be nice, but at least still makes it clear what is custom code.