-
Notifications
You must be signed in to change notification settings - Fork 30
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
added sourceBox parameter to resizeInto in RasterYuv420Semiplanar #1852
Conversation
resizeInto: func (target: This) { | ||
resizeInto: func (target: This, sourceBox := IntBox2D new()) { | ||
if (sourceBox hasZeroArea) | ||
sourceBox = IntBox2D new(this size) |
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.
I suppose sourceBox := IntBox2D new(this size)
does not work as a default argument?
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.
I think it is evaluated only once. It does not seem to be a problem now, but maybe someone would like to change the size
at some point.
Should I change it anyway ?
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 is fine. I think my suggestion actually does not work.
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.
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.
:(
thisStride := srcRow * this uv stride / 2 | ||
targetStride := row * target uv stride / 2 | ||
for (column in 0 .. targetSizeHalf x) { | ||
srcColumn := (thisSizeHalf x * column) / targetSizeHalf x | ||
srcColumn := (thisSizeHalf x * column) / targetSizeHalf x + sourceBox left / 2 |
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.
Oh, I should ask: You are reading the sourceBox
properties once per iteration, do you want to speed them up as you did with thisSize*
and targetSize*
?
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.
lines 105, 109, 120, 124
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.
We can do that later, I'm currently still working on this function.
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.
But thanks for noticing 👍
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's what they pay me for.
This allows to crop & resize in single pass.
@marcusnaslund review