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

Refactoring and tweaks (2) #1122

Merged
merged 10 commits into from
Feb 27, 2020
Merged

Refactoring and tweaks (2) #1122

merged 10 commits into from
Feb 27, 2020

Conversation

Sergio0694
Copy link
Member

@Sergio0694 Sergio0694 commented Feb 22, 2020

Fixes #1111.
Follow up from the (failed) #1120.

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following matches the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

  • Upgrading all the various struct constraints to unmanaged (eg. in where TPixel : unmanaged, IPixel<TPixel>, instead of the previous where TPixel : struct, IPixel<TPixel>)
  • Marking all the struct-s, or at least all the various method/property getters/etc. as readonly as possible (this is more expressive and avoids safety copies by the compiler)

@Sergio0694 Sergio0694 added the API label Feb 22, 2020
@Sergio0694 Sergio0694 added this to the 1.0.0-rc1 milestone Feb 22, 2020
@Sergio0694 Sergio0694 self-assigned this Feb 22, 2020
@codecov
Copy link

codecov bot commented Feb 23, 2020

Codecov Report

Merging #1122 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1122      +/-   ##
==========================================
- Coverage   82.31%   82.15%   -0.16%     
==========================================
  Files         678      686       +8     
  Lines       28941    29048     +107     
  Branches     3270     3308      +38     
==========================================
+ Hits        23822    23864      +42     
- Misses       4427     4485      +58     
- Partials      692      699       +7
Flag Coverage Δ
#unittests 82.15% <0%> (-0.16%) ⬇️
Impacted Files Coverage Δ
.../Transforms/Resamplers/NearestNeighborResampler.cs 0% <0%> (-33.34%) ⬇️
...ageSharp/PixelFormats/PixelImplementations/La16.cs 91.17% <0%> (-3.91%) ⬇️
...ageSharp/PixelFormats/PixelImplementations/La32.cs 92.2% <0%> (-3.51%) ⬇️
...ImageSharp/PixelFormats/PixelImplementations/L8.cs 90.9% <0%> (-3.83%) ⬇️
...xelFormats/PixelImplementations/NormalizedByte4.cs 83.33% <0%> (-3.04%) ⬇️
...elFormats/PixelImplementations/NormalizedShort4.cs 83.67% <0%> (-3%) ⬇️
...mageSharp/PixelFormats/PixelImplementations/L16.cs 93.1% <0%> (-3.06%) ⬇️
...ssors/Transforms/Resize/ResizeProcessor{TPixel}.cs 97.75% <0%> (-2.25%) ⬇️
...p/PixelFormats/PixelImplementations/Rgba1010102.cs 80.48% <0%> (-2.85%) ⬇️
...geSharp/PixelFormats/PixelImplementations/Byte4.cs 80.48% <0%> (-2.85%) ⬇️
... and 95 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6735eec...687d13a. Read the comment docs.

@JimBobSquarePants
Copy link
Member

I think we should get this one finished and merged asap. The longer it hangs around the more conflicts it will have to cope with.

@Sergio0694
Copy link
Member Author

@JimBobSquarePants This PR should be good to go, I've already made all the necessary changes we had discussed. I was really only waiting for the CI to come back to life so I could verify all the tests from here, but other then that it should be ok.

@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #1122 into master will decrease coverage by 0.15%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1122      +/-   ##
==========================================
- Coverage   82.31%   82.15%   -0.16%     
==========================================
  Files         678      686       +8     
  Lines       28941    29048     +107     
  Branches     3270     3308      +38     
==========================================
+ Hits        23822    23864      +42     
- Misses       4427     4485      +58     
- Partials      692      699       +7
Flag Coverage Δ
#unittests 82.15% <0%> (-0.16%) ⬇️
Impacted Files Coverage Δ
.../Transforms/Resamplers/NearestNeighborResampler.cs 0% <0%> (-33.34%) ⬇️
...ageSharp/PixelFormats/PixelImplementations/La16.cs 91.17% <0%> (-3.91%) ⬇️
...ageSharp/PixelFormats/PixelImplementations/La32.cs 92.2% <0%> (-3.51%) ⬇️
...ImageSharp/PixelFormats/PixelImplementations/L8.cs 90.9% <0%> (-3.83%) ⬇️
...xelFormats/PixelImplementations/NormalizedByte4.cs 83.33% <0%> (-3.04%) ⬇️
...elFormats/PixelImplementations/NormalizedShort4.cs 83.67% <0%> (-3%) ⬇️
...mageSharp/PixelFormats/PixelImplementations/L16.cs 93.1% <0%> (-3.06%) ⬇️
...ssors/Transforms/Resize/ResizeProcessor{TPixel}.cs 97.75% <0%> (-2.25%) ⬇️
...p/PixelFormats/PixelImplementations/Rgba1010102.cs 80.48% <0%> (-2.85%) ⬇️
...geSharp/PixelFormats/PixelImplementations/Byte4.cs 80.48% <0%> (-2.85%) ⬇️
... and 95 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6735eec...687d13a. Read the comment docs.

@antonfirsov
Copy link
Member

I will review the PR in the evening.

Those corflags.exe issues started to worry me, it doesn't look reliable on the CI in it's current form. Will keep thinking about it.

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, all changes are trivial. I will keep kicking the CI until the build succeeds, after that we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update type constraints and other optimizations
3 participants