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

WIP - Fix Porter-Duff Compositors #493

Merged
merged 5 commits into from
Mar 21, 2018
Merged

Conversation

JimBobSquarePants
Copy link
Member

@JimBobSquarePants JimBobSquarePants commented Mar 20, 2018

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

By my understanding our Porter-Duff equations are based upon the work here.

http://ssp.impulsetrain.com/porterduff.html

I've opened this PR to get work started on a fix.

  • Fixed Spelling of Subtract
  • Added input test images to match samples on site.
  • Added basic test to create output - (no comparison so far)
  • Fixed algorithm.

This is what we are looking for. Only a few of our output types are correct which leads me to think we've altered something fundamental when translating the formula. I think the input table values are correct.

table

I'm gonna need help on this as I can't make head-nor-tail of our interpretation of the formula. I'm a little concerned we'll need to create normalized vector methods for our IPixel implementations for it to work also.

@codecov
Copy link

codecov bot commented Mar 20, 2018

Codecov Report

Merging #493 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #493      +/-   ##
==========================================
+ Coverage   86.86%   86.89%   +0.03%     
==========================================
  Files         852      853       +1     
  Lines       36071    36095      +24     
  Branches     2654     2654              
==========================================
+ Hits        31332    31364      +32     
+ Misses       3978     3972       -6     
+ Partials      761      759       -2
Impacted Files Coverage Δ
.../PixelFormats/PixelBlenders/PorterDuffFunctions.cs 100% <ø> (ø) ⬆️
tests/ImageSharp.Tests/Drawing/DrawImageTest.cs 100% <ø> (ø) ⬆️
tests/ImageSharp.Tests/TestImages.cs 100% <ø> (ø) ⬆️
...ts/PixelBlenders/DefaultPixelBlenders.Generated.cs 96.42% <100%> (ø) ⬆️
...ats/PixelBlenders/PorterDuffFunctions.Generated.cs 78.18% <100%> (ø) ⬆️
...Tests/PixelFormats/PixelOperationsTests.Blender.cs 100% <100%> (ø) ⬆️
...lFormats/PixelBlenders/PorterDuffFunctionsTests.cs 100% <100%> (ø) ⬆️
...s/PixelBlenders/PorterDuffFunctionsTests_TPixel.cs 100% <100%> (ø) ⬆️
...xelFormats/PixelOperations{TPixel}.PixelBenders.cs 95.45% <100%> (ø) ⬆️
...Formats/PixelBlenders/PorterDuffCompositorTests.cs 100% <100%> (ø)
... and 5 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 d25c9dc...2b36c6a. Read the comment docs.

@dlemstra
Copy link
Member

@JimBobSquarePants Can we merge in the grammatical errors? To make sure this doesn't get to big? Maybe a new PR and rebase this one?

@JimBobSquarePants
Copy link
Member Author

Perhaps, I could be wrong though and the fix could be super simple.

@antonfirsov
Copy link
Member

@JimBobSquarePants great analysis of the problem! To summarize things further:

This is how our output looks like with following the original order in the article:
image

The list of the failing Blenders:

  • ATop
  • In
  • Out
  • Dest Atop
  • Dest In
  • Dest Out

@JimBobSquarePants JimBobSquarePants merged commit 742019f into master Mar 21, 2018
@JimBobSquarePants
Copy link
Member Author

Go team! 🥇

@JimBobSquarePants JimBobSquarePants deleted the js-fix-porter-duff branch March 21, 2018 01:17
antonfirsov pushed a commit to antonfirsov/ImageSharp that referenced this pull request Nov 11, 2019
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.

3 participants