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

Linear transform #1024

Merged
merged 6 commits into from
Feb 4, 2018
Merged

Linear transform #1024

merged 6 commits into from
Feb 4, 2018

Conversation

mbretschn
Copy link
Contributor

Hello,

i have done some refactoring for PR at #742 including the suggested changes. However, i have created a new branch with a fresh fork from the master branch in my account.
rfc.

Copy link
Owner

@lovell lovell left a comment

Choose a reason for hiding this comment

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

Thanks for this PR Marcel, looks good. I've left a small comment inline plus there are some linter errors:

lib/operation.js:434:2: Unnecessary semicolon.
test/unit/linear.js:79:3: Block must not be padded by blank lines.
test/unit/linear.js:81:1: Too many blank lines at the end of file. Max of 0 allowed.

lib/operation.js Outdated
} else if (is.number(b)) {
this.options.linearB = b;
} else {
throw new Error('Invalid linear transform multiplier ' + b);
Copy link
Owner

Choose a reason for hiding this comment

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

multiplier -> offset

src/pipeline.h Outdated
@@ -159,6 +161,8 @@ struct PipelineBaton {
thresholdGrayscale(true),
trimTolerance(0),
gamma(0.0),
linearA(1.0),
Copy link
Owner

Choose a reason for hiding this comment

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

Just spotted that these fields need to be initialised in the same order as they are declared to avoid a compiler warning.

../src/pipeline.h:83:10: warning: ‘PipelineBaton::gamma’ will be initialized after [-Wreorder]
   double gamma;
          ^
../src/pipeline.h:81:10: warning:   ‘double PipelineBaton::linearA’ [-Wreorder]
   double linearA;
          ^

Copy link
Contributor Author

@mbretschn mbretschn Nov 15, 2017

Choose a reason for hiding this comment

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

I like to change this - but how do i actually see these compiler warnings. I use npm install to build a new release (unfortunately under windows) and there i can't see these warnings.
(I have to admit that I'm not programming cpp for so long.)

Copy link
Owner

Choose a reason for hiding this comment

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

Thanks for updating - MSVC doesn't appear to warn about this but gcc and clang do.

Copy link
Owner

Choose a reason for hiding this comment

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

@coveralls
Copy link

coveralls commented Nov 15, 2017

Coverage Status

Coverage increased (+0.01%) to 99.239% when pulling 4f07488 on 3epnm:LinearTransform into 73edfb3 on lovell:master.

@lovell
Copy link
Owner

lovell commented Nov 15, 2017

Thanks, I'll look at merging this after the suit v0.19.0 WIP branch makes its way into master.

@lovell lovell added this to the v0.19.0 milestone Nov 15, 2017
@lovell
Copy link
Owner

lovell commented Dec 9, 2017

@3epnm Hello, there's a small conflict in the package.json file. Are you able to fix this?

Repository owner deleted a comment from coveralls Dec 9, 2017
Repository owner deleted a comment from coveralls Dec 9, 2017
Repository owner deleted a comment from coveralls Dec 9, 2017
@lovell lovell removed this from the v0.19.0 milestone Jan 12, 2018
@mbretschn
Copy link
Contributor Author

I have a look

package.json Outdated
@@ -39,6 +39,7 @@
"Guy Maliar <[email protected]>",
"Nicolas Coden <[email protected]>",
"Matt Parrish <[email protected]>",
"Marcel Bretschneider <[email protected]>"
Copy link
Owner

Choose a reason for hiding this comment

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

I think a trailing comma is required here.

@mbretschn
Copy link
Contributor Author

I made the required change in the package.json

@lovell lovell merged commit d599d1f into lovell:master Feb 4, 2018
@lovell
Copy link
Owner

lovell commented Feb 4, 2018

Thank you very much Marcel, your work will be included in the next release.

I notice from your profile that you're based in London so you may be interested in #1104

@lovell lovell added this to the v0.19.1 milestone Feb 4, 2018
lovell added a commit that referenced this pull request Feb 4, 2018
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