-
Notifications
You must be signed in to change notification settings - Fork 30
some improvements to distance, apply and fill methods in Raster* #1823
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
Conversation
@@ -106,7 +115,7 @@ RasterMonochrome: class extends RasterPacked { | |||
result += distance sqrt() | |||
} | |||
} | |||
result /= (this size x squared + this size y squared as Float sqrt()) | |||
result /= (sizeX squared + sizeY squared as Float sqrt()) |
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'm pretty sure this is a bug (should be more like (x^2 + y^2) sqrt()
) but fixing it fails the RasterMonochrome lossy ascii serialization
test case.
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 definitely.
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 made an issue: #1824
@@ -172,9 +174,9 @@ RasterYuv420Semiplanar: class extends RasterImage { | |||
vSource += 2 | |||
} | |||
} | |||
yRow += this y stride | |||
yRow += yStride | |||
if (y % 2 == 1) { |
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.
You can remove these braces while you're at 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.
Updated.
Neat. I will just ask for two things:
|
Tested by running one of the tests in other project, which depends heavily on
after switching to this branch:
I will update the variable names. |
Complete test suite in the other project, before |
Nice! :) I'm happy once the variable names have changed. |
Variable names are updated, check the latest commit. |
@@ -61,14 +66,15 @@ RasterUv: class extends RasterPacked { | |||
vSource := vRow | |||
width := this size x | |||
height := this size y | |||
stride := this stride |
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.
well well well
Trying to trick me, eh? You should fear my power ⚡ |
sorry 😭 |
No, looks good now. But as punishment, I will wait an extra minute before merging this. |
mostly reducing count of function calls (property reads)
@marcusnaslund